1@echo off
2
3REM default java executable
4set vm=java
5
6REM reset list of ant targets in test.xml to execute
7set tests=
8
9REM default switch to determine if eclipse should be reinstalled between running of tests
10set installmode=clean
11
12REM property file to pass to Ant scripts
13set properties=
14
15REM default values for os, ws and arch
16set os=win32
17set ws=win32
18set arch=x86
19
20REM reset ant command line args
21set ANT_CMD_LINE_ARGS=
22
23REM ****************************************************************
24REM
25REM Delete previous Eclipse installation and workspace
26REM (This is the Eclipse that controls the test. The test will start another Eclipse.
27REM
28REM ****************************************************************
29if EXIST eclipse rmdir /S /Q eclipse
30if EXIST workspace rmdir /s /Q workspace
31
32REM ****************************************************************
33REM
34REM Install Eclipse and org.eclipse.test plugin
35REM
36REM ****************************************************************
37
38unzip -qq -o eclipse-SDK*.zip
39unzip -qq -o -C VE-junit-tests*.zip */plugins/org.eclipse.test*
40
41
42:processcmdlineargs
43
44REM ****************************************************************
45REM
46REM Process command line arguments
47REM
48REM ****************************************************************
49
50if x%1==x goto setup
51if x%1==x-ws set ws=%2 && shift && shift && goto processcmdlineargs
52if x%1==x-os set os =%2 && shift && shift && goto processcmdlineargs
53if x%1==x-arch set arch=%2 && shift && shift && goto processcmdlineargs
54if x%1==x-noclean set installmode=noclean && shift && goto processcmdlineargs
55if x%1==x-properties set properties=-propertyfile %2 && shift && shift && goto processcmdlineargs
56if x%1==x-vm set vm=%2 && shift && shift && goto processcmdlineargs
57
58set tests=%tests% %1 && shift && goto processcmdlineargs
59
60
61:setup
62REM ****************************************************************
63REM
64REM	Setup up the test (target) GEF SDK
65REM
66REM	** if -noclean set, Eclipse will be re-installed only if the 
67REM	directory target\eclipse does not exist.  If this directory
68REM	exists in a partially installed state, it should be deleted manually
69REM	and the script rerun with the same parameter settings. **
70REM
71REM ****************************************************************
72
73REM command for executing antRunner headless
74set antRunner=%vm% -cp eclipse\startup.jar -Dosgi.ws=%ws% -Dosgi.os=%os% -Dosgi.arch=%arch% org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner
75
76if %installmode%==noclean %antRunner% -file test.xml setup -Dws=%ws% -Dos=%os% -Darch=%arch% "-D%installmode%=true" -logger org.apache.tools.ant.DefaultLogger
77goto run
78
79
80:run
81REM ***************************************************************************
82REM	Run tests by running Ant in Eclipse on the test.xml script
83REM ***************************************************************************
84
85%antRunner% -file test.xml %tests% -Dws=%ws% -Dos=%os% -Darch=%arch% %properties%  "-D%installmode%=true" -logger org.apache.tools.ant.DefaultLogger
86goto end
87
88:end