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