Update of /cvsroot/boost/boost/tools/regression/xsl_reports/db
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9390

Added Files:
      Tag: RC_1_34_0
        load.py sqlserver_schemas.sql test-runs.xsd 
Log Message:
Import test results into database

--- NEW FILE: load.py ---
import os
import win32com.client

objBL = win32com.client.Dispatch("SQLXMLBulkLoad.SQLXMLBulkload.3.0")
objBL.ConnectionString = "provider=SQLOLEDB;data 
source=localhost;database=boost;integrated security=SSPI"
objBL.ErrorLogFile = "c:\\error.log"
objBL.Execute( os.path.join( os.path.dirname( __file__ ), "test-runs.xsd" ), 
"Huang-WinXP-x64.xml" )
#objBL.Execute( os.path.join( os.path.dirname( __file__ ), "test-runs.xsd" ), 
"extended_test_results.xml" )
--- NEW FILE: sqlserver_schemas.sql ---
drop table [test-log]
go
CREATE TABLE [test-log] 
    (
    [runner] [varchar] (32) NOT NULL ,
        [timestamp] [varchar] (32) NOT NULL ,
        [test-name] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [test-run] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [test-type] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [test-program] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS 
NULL ,
        [target-directory] [varchar] (1024) NOT NULL ,
    [library] varchar(64)
    PRIMARY KEY ( runner, timestamp, [target-directory] )
    ) 
GO

drop table [test-run] 
go
CREATE TABLE [test-run] (
        [runner] [varchar] (32) NOT NULL ,
        [timestamp] [varchar] (32) NOT NULL ,
        [source] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [tag] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [platform] [varchar] (32),
        [run-type] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    PRIMARY KEY ( runner, timestamp )
    ) 
GO

drop table [compile] 
go
create table [compile]
    (
    [runner] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [target-directory] [varchar] (1024) COLLATE 
SQL_Latin1_General_CP1_CI_AS NULL ,
    [output] [text],
        [timestamp] [varchar] (32) NULL ,
    result [varchar] (16)
    
    )    


select * from [test-run]
select * from [test-log]
select * from compile
--- NEW FILE: test-runs.xsd ---
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified"
            xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
  
  <xs:annotation>
    <xs:appinfo>
      <sql:relationship name="test-run-test-log"
        parent="[test-run]"
        parent-key="runner timestamp"
        child="[test-log]"
        child-key="runner timestamp" />
      
      <sql:relationship name="test-log-compile"
        parent="[test-log]"
        parent-key="runner [target-directory]"
        child="[compile]"
        child-key="runner [target-directory]" />
    </xs:appinfo>
  </xs:annotation>
  
  <xs:element name="all-test-runs" sql:mapped="false" >
           <xs:complexType >
         <xs:sequence >
           <xs:element name="test-run" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
       </xs:complexType>
    </xs:element>
  <xs:element name="run" sql:mapped="false">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
        <xs:attribute name="result"/>
          <xs:attribute name="timestamp"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="link" sql:mapped="false">
        <xs:complexType >
          <xs:simpleContent>
            <xs:extension base="xs:string">
              <xs:attribute name="result"/>
          <xs:attribute name="timestamp"/>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
  </xs:element>
  <xs:element name="comment" type="xs:string"/>
  <xs:element name="test-run" sql:relation="[test-run]">
    <xs:complexType >
      <xs:sequence>
          <xs:element name="comment" sql:mapped="false" minOccurs="0" 
maxOccurs="1"/>
          <xs:element name="test-log"  sql:relation="[test-log]" 
sql:relationship="test-run-test-log"  minOccurs="0" maxOccurs="unbounded">
                <xs:complexType >
                <xs:sequence>
                  <xs:element name="notes"  minOccurs="0" sql:mapped="false"/>
                  <xs:element name="compile" sql:relation="[compile]" 
sql:relationship ="test-log-compile"  sql:overflow-field="output" minOccurs="0" 
 maxOccurs="unbounded" sql:field="output">
                        <xs:complexType >
                          <xs:simpleContent>
                            <xs:extension base="xs:string">
                              <xs:attribute name="result"/>
                              <xs:attribute name="timestamp"/>
                            </xs:extension>
                          </xs:simpleContent>
                        </xs:complexType>
                    </xs:element>
                    <xs:element ref="link" sql:mapped="false" />
                    <xs:element ref="run" sql:mapped="false" />
                </xs:sequence>
                <xs:attribute name="library" sql:field="library"/>
                 <xs:attribute name="test-name" sql:field="[test-name]"/>
                  <xs:attribute name="test-type" sql:field="[test-type]"/>
                  <xs:attribute name="test-program" sql:field="[test-program]"/>
                 <xs:attribute name="target-directory" 
sql:field="[target-directory]"/>
                <xs:attribute name="toolset" sql:mapped="false"/>
                <xs:attribute name="show-run-output" sql:mapped="false"/>
                <xs:attribute name="result" sql:mapped="false"/>
                <xs:attribute name="expected-result" sql:mapped="false"/>
                <xs:attribute name="expected-reason" sql:mapped="false"/>
                <xs:attribute name="status" sql:mapped="false"/>
                <xs:attribute name="is-new" sql:mapped="false"/>
                <xs:attribute name="category" sql:mapped="false"/>
              </xs:complexType>
          </xs:element>
        </xs:sequence>
      <xs:attribute name="source" sql:field="source"/>
      <xs:attribute name="runner" sql:field="runner"/>
      <xs:attribute name="timestamp" sql:field="timestamp"/>
      <xs:attribute name="platform" sql:field="platform"/>
      <xs:attribute name="tag" sql:field="tag"/>
      <xs:attribute name="run-type" sql:field="[run-type]"/>
    </xs:complexType>
  </xs:element>
</xs:schema>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to