2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / class / System.Data / run-tests.test.connected.bat
blobad5f2deaff6265028b18a0238f8fc9fbfd38e115
1 @echo off\r
2 REM ********************************************************\r
3 REM This batch file receives the follwing parameters:\r
4 REM build/rebuild (optional): should the solution file be rebuilded \r
5 REM                             or just builded before test run (default is rebuild)\r
6 REM output files name prefix (mandratory) : prefix for naming output xml files\r
7 REM test fixture name (optional) : if you want to run some particular test fixture\r
8 REM directory to run tests (optional)\r
9 REM path back to root directory (opposite to previous param)\r
10 REM example run-tests build GhTests Test.Sys.Drawing Test\DrawingTest\Test ..\..\..\\r
11 REM will cause to build (and not rebuild) test solutions,\r
12 REM running Test.Sys.Drawing fixture in directory Test\DrawingTest\Test\r
13 REM with output files named GhTests.Net.xml and GhTests.GH.xml\r
14 REM ********************************************************\r
16 IF "%1"=="" GOTO USAGE\r
18 IF "%VMW_HOME%"=="" GOTO ENVIRONMENT_EXCEPTION\r
22 IF "%1"=="" (\r
23         set BUILD_OPTION=rebuild\r
24 ) ELSE (\r
25         set BUILD_OPTION=%1\r
26 )\r
28 REM ********************************************************\r
29 REM Set parameters\r
30 REM ********************************************************\r
32 set BUILD_OPTION=%1\r
33 set OUTPUT_FILE_PREFIX=System_Data_connected\r
34 set RUNNING_FIXTURE=MonoTests.System.Data\r
35 set TEST_SOLUTION=Test\ProviderTests\System.Data.OleDb.Tests20.J2EE.sln\r
36 set TEST_ASSEMBLY=System.Data.OleDb.Tests.J2EE.jar\r
37 set PROJECT_CONFIGURATION=Debug_Java20\r
38 set APP_CONFIG_FILE=Test\ProviderTests\System.Data.OleDb.J2EE.config\r
41 set startDate=%date%\r
42 set startTime=%time%\r
43 set sdy=%startDate:~10%\r
44 set /a sdm=1%startDate:~4,2% - 100\r
45 set /a sdd=1%startDate:~7,2% - 100\r
46 set /a sth=%startTime:~0,2%\r
47 set /a stm=1%startTime:~3,2% - 100\r
48 set /a sts=1%startTime:~6,2% - 100\r
49 set TIMESTAMP=%sdy%_%sdm%_%sdd%_%sth%_%stm%\r
53 REM ********************************************************\r
54 REM @echo Set environment\r
55 REM ********************************************************\r
57 set JGAC_PATH=%VMW_HOME%\java_refs\framework\\r
58 set JAVA_HOME=%VMW_HOME%\jre\r
60 set RUNTIME_CLASSPATH=%JGAC_PATH%mscorlib.jar\r
61 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.jar\r
62 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Xml.jar\r
63 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Data.jar\r
64 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%J2SE.Helpers.jar\r
66 rem set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\msbase.jar\r
67 rem set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\mssqlserver.jar\r
68 rem set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\msutil.jar\r
70 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\sqljdbc.jar\r
72 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\postgresql-8.0.309.jdbc3.jar\r
74 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\ojdbc14.jar\r
76 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\db2jcc.jar\r
77 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\db2jcc_license_cu.jar\r
79 set NUNIT_OPTIONS=/exclude=NotWorking\r
81 if "%GH_VERSION%"=="" (\r
82         set GH_VERSION=0_0_0_0\r
83 )\r
85 set COMMON_PREFIX=%TIMESTAMP%_%OUTPUT_FILE_PREFIX%.GH_%GH_VERSION%.1.%USERNAME%\r
86 set GH_OUTPUT_XML=%COMMON_PREFIX%.xml\r
87 set BUILD_LOG=%COMMON_PREFIX%.build.log\r
88 set RUN_LOG=%COMMON_PREFIX%.run.log\r
90 set NUNIT_PATH=..\..\nunit20\\r
91 set NUNIT_CLASSPATH=%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.framework.jar\r
92 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.util.jar\r
93 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.core.jar\r
94 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit-console.jar\r
95 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;.\r
96 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%TEST_ASSEMBLY%\r
98 set CLASSPATH="%RUNTIME_CLASSPATH%;%NUNIT_CLASSPATH%"\r
100 REM ********************************************************\r
101 @echo Building GH solution...\r
102 REM ********************************************************\r
104 rem devenv %TEST_SOLUTION% /%BUILD_OPTION% %PROJECT_CONFIGURATION% >>%RUNNING_FIXTURE%_build.%RUN_ID%.log.txt 2<&1\r
105 msbuild %TEST_SOLUTION% /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1\r
107 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION\r
109 REM ********************************************************\r
110 @echo Building NUnit solution...\r
111 REM ********************************************************\r
113 if "%NUNIT_BUILD%" == "DONE" goto NUNITSKIP\r
115 rem devenv ..\..\nunit20\nunit.java.sln /%BUILD_OPTION% %PROJECT_CONFIGURATION% >>%RUNNING_FIXTURE%_build.%RUN_ID%.log.txt 2<&1\r
116 msbuild ..\..\nunit20\nunit20.java.sln /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1\r
118 goto NUNITREADY\r
120 :NUNITSKIP\r
121 echo Skipping NUnit Build...\r
123 :NUNITREADY\r
124 set NUNIT_BUILD=DONE\r
126 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION\r
128 REM ********************************************************\r
129 @echo Running GH tests...\r
130 REM ********************************************************\r
132 REM ********************************************************\r
133 @echo Running fixture "%RUNNING_FIXTURE%"\r
134 REM ********************************************************\r
136 copy Test\ProviderTests\bin\%PROJECT_CONFIGURATION%\%TEST_ASSEMBLY% .\r
137 copy %APP_CONFIG_FILE% nunit-console.exe.config\r
139 REM @echo on\r
140 "%JAVA_HOME%\bin\java" -Xmx1024M -cp %CLASSPATH% NUnit.Console.ConsoleUi %TEST_ASSEMBLY% %NUNIT_OPTIONS% /xml=%GH_OUTPUT_XML% >>%RUN_LOG% 2<&1\r
141 REM @echo off\r
143 REM ********************************************************\r
144 @echo Build XmlTool\r
145 REM ********************************************************\r
146 set XML_TOOL_PATH=..\..\tools\mono-xmltool\r
148 if "%XMLTOOL_BUILD%" == "DONE" goto XMLTOOLSKIP\r
150 rem devenv %XML_TOOL_PATH%\XmlTool.sln /%BUILD_OPTION% %PROJECT_CONFIGURATION% >>%RUNNING_FIXTURE%_build.%RUN_ID%.log.txt 2<&1\r
151 msbuild %XML_TOOL_PATH%\XmlTool20.vmwcsproj /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1\r
153 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION\r
155 goto XMLTOOLREADY\r
157 :XMLTOOLSKIP\r
158 echo Skipping XmlToll build...\r
160 :XMLTOOLREADY\r
161 set XMLTOOL_BUILD=DONE\r
163 copy %XML_TOOL_PATH%\bin\%PROJECT_CONFIGURATION%\xmltool.exe .\r
164 copy %XML_TOOL_PATH%\nunit_transform.xslt .\r
166 REM ********************************************************\r
167 @echo Analyze and print results\r
168 REM ********************************************************\r
169 @echo on\r
170 xmltool.exe --transform nunit_transform.xslt %GH_OUTPUT_XML%\r
171 @echo off\r
173 :FINALLY\r
174 GOTO END\r
176 :ENVIRONMENT_EXCEPTION\r
177 @echo This test requires environment variable VMW_HOME to be defined\r
178 GOTO END\r
180 :BUILD_EXCEPTION\r
181 @echo Error in building solutions. See %BUILD_LOG% for details...\r
182 REM EXIT 1\r
183 GOTO END\r
185 :RUN_EXCEPTION\r
186 @echo Error in running fixture %RUNNING_FIXTURE%. See %RUN_LOG% for details...\r
187 REM EXIT 1\r
188 GOTO END\r
190 :USAGE\r
191 @echo Parameters: "[build|rebuild]"\r
192 GOTO END\r
194 :END\r
195 copy %RUN_LOG% ..\\r
196 copy %BUILD_LOG% ..\\r
197 copy %GH_OUTPUT_XML% ..\\r
199 REM EXIT 0\r