diff options
author | 2011-07-05 08:40:13 +0200 | |
---|---|---|
committer | 2011-07-05 08:40:13 +0200 | |
commit | ac4bedcd7ff6765b996c7c76b34231871eb19973 (patch) | |
tree | b1c92dd74386b0a1f06b3434cd998033b7a3ff3b /Chalice/tests/test-scripts | |
parent | 7d9941a885ef162d7e5bc5cd68ca4a422e0dc62a (diff) |
Chalice: Completely switch to new testing scripts (more flexible and fine-grained testing) and remove old test.bat. New testing scripts are described in Chalice/tests/readme.txt.
Diffstat (limited to 'Chalice/tests/test-scripts')
-rw-r--r-- | Chalice/tests/test-scripts/generate_reference.bat | 1 | ||||
-rw-r--r-- | Chalice/tests/test-scripts/generate_reference_all.bat | 5 | ||||
-rw-r--r-- | Chalice/tests/test-scripts/getboogieoutput.bat | 26 | ||||
-rw-r--r-- | Chalice/tests/test-scripts/reg_test.bat | 27 | ||||
-rw-r--r-- | Chalice/tests/test-scripts/test.bat | 7 |
5 files changed, 54 insertions, 12 deletions
diff --git a/Chalice/tests/test-scripts/generate_reference.bat b/Chalice/tests/test-scripts/generate_reference.bat index a2e9c443..0c480e5c 100644 --- a/Chalice/tests/test-scripts/generate_reference.bat +++ b/Chalice/tests/test-scripts/generate_reference.bat @@ -1,5 +1,4 @@ @echo off
-
set getboogieoutput="%~dp0\getboogieoutput.bat"
echo Generating reference for %1.chalice ...
diff --git a/Chalice/tests/test-scripts/generate_reference_all.bat b/Chalice/tests/test-scripts/generate_reference_all.bat index 83b04700..1e9e7cfb 100644 --- a/Chalice/tests/test-scripts/generate_reference_all.bat +++ b/Chalice/tests/test-scripts/generate_reference_all.bat @@ -1,10 +1,9 @@ @echo off
-set getboogieoutput="%~dp0\getboogieoutput.bat"
+set generatereference="%~dp0\generate_reference.bat"
for /F %%f in ('dir *.chalice /b') do (
- echo Generating reference for %%~nf.chalice ...
- call %getboogieoutput% %%~nf %1 %2 %3 %4 %5 %6 %7
+ call %generatereference% %%~nf %1 %2 %3 %4 %5 %6 %7
)
exit /b 0
diff --git a/Chalice/tests/test-scripts/getboogieoutput.bat b/Chalice/tests/test-scripts/getboogieoutput.bat index eb7d99a4..40590120 100644 --- a/Chalice/tests/test-scripts/getboogieoutput.bat +++ b/Chalice/tests/test-scripts/getboogieoutput.bat @@ -1,13 +1,33 @@ @echo off
-
set chalice="%~dp0\..\..\chalice.bat"
+set getparams="%~dp0\getparams.bat"
set output="%1.output.txt"
-echo Verification of %1.chalice > %output%
+:: get parameters
+set chaliceparameters=
+setlocal EnableDelayedExpansion
+set done=0
+set key=a
+FOR /F "usebackq tokens=1,2 delims==" %%i in (%1.chalice) do (
+
+ if !done!==0 (
+ set key=%%i
+ set param=%%j
+ )
+
+ set done=1
+)
+set str=// chalice-parameter
+if "!key!"=="!str!" (
+ set chaliceparameters=!param!
+)
+
+echo Verification of %1.chalice using parameters="%chaliceparameters%" > %output%
echo.>> %output%
-call %chalice% "%1.chalice" %2 %3 %4 %5 >> %output% 2>&1
+call %chalice% "%1.chalice" %chaliceparameters% %2 %3 %4 %5 %6 %7 >> %output% 2>&1
set o=%~dp1%out.bpl
if exist "%o%" copy "%o%" "%1.bpl">nul
if exist "%o%" del "%~dp1%out.bpl"
+goto :eof
diff --git a/Chalice/tests/test-scripts/reg_test.bat b/Chalice/tests/test-scripts/reg_test.bat index d31773da..0e5e4dbf 100644 --- a/Chalice/tests/test-scripts/reg_test.bat +++ b/Chalice/tests/test-scripts/reg_test.bat @@ -1,15 +1,34 @@ @echo off
-
+setlocal
set chalice="%~dp0\..\..\chalice.bat"
set diff="%~dp0\diff.bat"
if not exist "%1.chalice" goto errorNotFound
if not exist "%1.output.txt" goto errorNoRef
+:: get parameters
+set chaliceparameters=
+setlocal EnableDelayedExpansion
+set done=0
+set key=a
+FOR /F "usebackq tokens=1,2 delims==" %%i in (%1.chalice) do (
+
+ if !done!==0 (
+ set key=%%i
+ set param=%%j
+ )
+
+ set done=1
+)
+set str=// chalice-parameter
+if "!key!"=="!str!" (
+ set chaliceparameters=!param!
+)
+
set output=output.txt
-echo Verification of %1.chalice > %output%
+echo Verification of %1.chalice using parameters="%chaliceparameters%" > %output%
echo.>> %output%
-call %chalice% "%1.chalice" %2 %3 %4 %5 %6 %7 >> %output% 2>&1
+call %chalice% "%1.chalice" %chaliceparameters% %2 %3 %4 %5 %6 %7 >> %output% 2>&1
fc "%1.output.txt" output.txt > nul
if not errorlevel 1 goto passTest
@@ -27,11 +46,13 @@ goto errorEnd :errorEnd
if exist out.bpl del out.bpl
if exist output.txt del output.txt
+endlocal
exit /b 1
:end
if exist out.bpl del out.bpl
if exist output.txt del output.txt
+endlocal
exit /b 0
:errorNotFound
diff --git a/Chalice/tests/test-scripts/test.bat b/Chalice/tests/test-scripts/test.bat index 321fdcef..3908ae68 100644 --- a/Chalice/tests/test-scripts/test.bat +++ b/Chalice/tests/test-scripts/test.bat @@ -1,13 +1,16 @@ @echo off
set chalice="%~dp0\..\..\chalice.bat"
+set getparams="%~dp0\getparams.bat"
if not exist "%1.chalice" goto errorNotFound
set output=output.txt
-echo Verification of %1.chalice > %output%
+set chaliceparameters=
+call %getparams% %1 chaliceparameters
+echo Verification of %1.chalice using parameters="%chaliceparameters%" > %output%
echo.>> %output%
-call %chalice% "%1.chalice" %2 %3 %4 %5 %6 %7 >> %output% 2>&1
+call %chalice% "%1.chalice" %chaliceparameters% %2 %3 %4 %5 %6 %7 >> %output% 2>&1
type %output%
exit /B 0
|