2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / System.Data.OracleClient / run-tests.test.bat
blob20d982c4d929c854a19f2bee51dcf9b89fcbbf69
1 @echo off
2 REM ********************************************************
3 REM This batch file receives the follwing parameters:
4 REM build/rebuild (optional): should the solution file be rebuilded 
5 REM                             or just builded before test run (default is rebuild)
6 REM output files name prefix (mandratory) : prefix for naming output xml files
7 REM test fixture name (optional) : if you want to run some particular test fixture
8 REM directory to run tests (optional)
9 REM path back to root directory (opposite to previous param)
10 REM example run-tests build GhTests Test.Sys.Drawing Test\DrawingTest\Test ..\..\..\
11 REM will cause to build (and not rebuild) test solutions,
12 REM running Test.Sys.Drawing fixture in directory Test\DrawingTest\Test
13 REM with output files named GhTests.Net.xml and GhTests.GH.xml
14 REM ********************************************************
16 IF "%1"=="" GOTO USAGE
18 IF "%VMW_HOME%"=="" GOTO ENVIRONMENT_EXCEPTION
22 IF "%1"=="" (
23         set BUILD_OPTION=rebuild
24 ) ELSE (
25         set BUILD_OPTION=%1
28 REM ********************************************************
29 REM Set parameters
30 REM ********************************************************
32 set BUILD_OPTION=%1
33 set OUTPUT_FILE_PREFIX=System_Data_OracleClient
34 set RUNNING_FIXTURE=MonoTests.System.Data.OracleClient
35 set TEST_SOLUTION=Test\System.Data.OracleClient.Tests20.J2EE.sln
36 set TEST_ASSEMBLY=System.Data.OracleClient.Tests20.J2EE.jar
37 set PROJECT_CONFIGURATION=Debug_Java20
38 set APP_CONFIG_FILE=Test\System.Data.OracleClient.J2EE.config
41 set startDate=%date%
42 set startTime=%time%
43 set sdy=%startDate:~10%
44 set /a sdm=1%startDate:~4,2% - 100
45 set /a sdd=1%startDate:~7,2% - 100
46 set /a sth=%startTime:~0,2%
47 set /a stm=1%startTime:~3,2% - 100
48 set /a sts=1%startTime:~6,2% - 100
49 set TIMESTAMP=%sdy%_%sdm%_%sdd%_%sth%_%stm%
52 REM ********************************************************
53 REM @echo Set environment
54 REM ********************************************************
56 set JGAC_PATH=%VMW_HOME%\java_refs\framework\
57 set JAVA_HOME=%VMW_HOME%\jre
59 set RUNTIME_CLASSPATH=%JGAC_PATH%mscorlib.jar
60 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.jar
61 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Xml.jar
62 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Data.jar
63 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%J2SE.Helpers.jar
64 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%JGAC_PATH%System.Data.OracleClient.jar
66 set RUNTIME_CLASSPATH=%RUNTIME_CLASSPATH%;%VMW_HOME%\java_refs\jdbc\ojdbc14.jar
68 set NUNIT_OPTIONS=/exclude=NotWorking
70 if "%GH_VERSION%"=="" (
71         set GH_VERSION=0_0_0_0
74 set COMMON_PREFIX=%TIMESTAMP%_%OUTPUT_FILE_PREFIX%.GH_%GH_VERSION%.1.%USERNAME%
75 set GH_OUTPUT_XML=%COMMON_PREFIX%.xml
76 set BUILD_LOG=%COMMON_PREFIX%.build.log
77 set RUN_LOG=%COMMON_PREFIX%.run.log
79 set NUNIT_PATH=..\..\nunit20\
80 set NUNIT_CLASSPATH=%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.framework.jar
81 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.util.jar
82 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit.core.jar
83 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%NUNIT_PATH%nunit-console\bin\%PROJECT_CONFIGURATION%\nunit-console.jar
84 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;.
85 set NUNIT_CLASSPATH=%NUNIT_CLASSPATH%;%TEST_ASSEMBLY%
87 set CLASSPATH="%RUNTIME_CLASSPATH%;%NUNIT_CLASSPATH%"
89 REM ********************************************************
90 @echo Building GH solution...
91 REM ********************************************************
93 REM devenv %TEST_SOLUTION% /%BUILD_OPTION% %PROJECT_CONFIGURATION% >>%RUNNING_FIXTURE%_build.log.txt 2<&1
94 msbuild %TEST_SOLUTION% /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1
96 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
98 REM ********************************************************
99 @echo Building NUnit solution...
100 REM ********************************************************
102 if "%NUNIT_BUILD%" == "DONE" goto NUNITSKIP
104 REM devenv ..\..\nunit20\nunit.java.sln /%BUILD_OPTION% %PROJECT_CONFIGURATION% >>%RUNNING_FIXTURE%_build.log.txt 2<&1
105 msbuild ..\..\nunit20\nunit20.java.sln /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1
107 goto NUNITREADY
109 :NUNITSKIP
110 echo Skipping NUnit Build...
112 :NUNITREADY
113 set NUNIT_BUILD=DONE
115 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
117 REM ********************************************************
118 @echo Running GH tests...
119 REM ********************************************************
121 REM ********************************************************
122 @echo Running fixture "%RUNNING_FIXTURE%"
123 REM ********************************************************
125 copy Test\bin\%PROJECT_CONFIGURATION%\%TEST_ASSEMBLY% .
126 copy %APP_CONFIG_FILE% nunit-console.exe.config
128 REM @echo on
129 "%JAVA_HOME%\bin\java" -Xmx1024M -cp %CLASSPATH% NUnit.Console.ConsoleUi %TEST_ASSEMBLY%  %NUNIT_OPTIONS% /xml=%GH_OUTPUT_XML% >>%RUN_LOG% 2<&1
130 REM @echo off
132 REM ********************************************************
133 @echo Build XmlTool
134 REM ********************************************************
135 set XML_TOOL_PATH=..\..\tools\mono-xmltool
137 if "%XMLTOOL_BUILD%" == "DONE" goto XMLTOOLSKIP
139 REM devenv %XML_TOOL_PATH%\XmlTool.sln /%BUILD_OPTION% Debug_Java >>%RUNNING_FIXTURE%_build.log.txt 2<&1
140 msbuild %XML_TOOL_PATH%\XmlTool20.vmwcsproj /t:%BUILD_OPTION% /p:Configuration=%PROJECT_CONFIGURATION% >>%BUILD_LOG% 2<&1
142 IF %ERRORLEVEL% NEQ 0 GOTO BUILD_EXCEPTION
144 goto XMLTOOLREADY
146 :XMLTOOLSKIP
147 echo Skipping XmlToll build...
149 :XMLTOOLREADY
150 set XMLTOOL_BUILD=DONE
152 copy %XML_TOOL_PATH%\bin\%PROJECT_CONFIGURATION%\xmltool.exe .
153 copy %XML_TOOL_PATH%\nunit_transform.xslt .
155 REM ********************************************************
156 @echo Analyze and print results
157 REM ********************************************************
158 @echo on
159 xmltool.exe --transform nunit_transform.xslt %GH_OUTPUT_XML%
160 @echo off
162 :FINALLY
163 GOTO END
165 :ENVIRONMENT_EXCEPTION
166 @echo This test requires environment variable VMW_HOME to be defined
167 GOTO END
169 :BUILD_EXCEPTION
170 @echo Error in building solutions. See %BUILD_LOG% for details...
171 REM EXIT 1
172 GOTO END
174 :RUN_EXCEPTION
175 @echo Error in running fixture %RUNNING_FIXTURE%. See %RUN_LOG% for details...
176 REM EXIT 1
177 GOTO END
179 :USAGE
180 @echo Parameters: "[build|rebuild]"
181 GOTO END
183 :END
184 copy %RUN_LOG% ..\
185 copy %BUILD_LOG% ..\
186 copy %GH_OUTPUT_XML% ..\
188 REM EXIT 0