summaryrefslogtreecommitdiff
path: root/Chalice
diff options
context:
space:
mode:
authorGravatar stefanheule <unknown>2011-07-07 17:45:57 +0200
committerGravatar stefanheule <unknown>2011-07-07 17:45:57 +0200
commit37b1d69f307247afb237a8f4a6eb4a7555df6e2e (patch)
tree5897c726fec97782e90c17327fc96e2151aa9934 /Chalice
parent2c3e6b564ac92f7b4cd53779406b5c1359832792 (diff)
Chalice: New test script to execute all tests (in all folder) at once. Test scripts now set the errorlevel to the number of failed tests.
Diffstat (limited to 'Chalice')
-rw-r--r--Chalice/tests/runalltests.bat32
-rw-r--r--Chalice/tests/test-scripts/reg_test.bat11
-rw-r--r--Chalice/tests/test-scripts/reg_test_all.bat23
3 files changed, 61 insertions, 5 deletions
diff --git a/Chalice/tests/runalltests.bat b/Chalice/tests/runalltests.bat
new file mode 100644
index 00000000..3b0df4a4
--- /dev/null
+++ b/Chalice/tests/runalltests.bat
@@ -0,0 +1,32 @@
+@echo off
+
+setlocal EnableDelayedExpansion
+
+:: no-summary command line parameter
+set nosummary=0
+if "%1"=="-no-summary" (
+ set nosummary=1
+ SHIFT
+)
+
+set t=0
+set c=0
+for %%f in (examples permission-model) do (
+ echo Running tests in %%f ...
+ echo ------------------------------------------------------
+ cd %%f
+ set tt=0
+ for %%f in (*.chalice) do set /A tt+=1
+ call reg_test_all.bat -no-summary
+ set /A c=!c!+!errorlevel!
+ set /A t=!t!+!tt!
+ cd ..
+ echo ------------------------------------------------------
+)
+
+if !nosummary!==0 (
+ echo.
+ if !c!==0 (echo SUMMARY: completed !t! tests successfully.) else (echo SUMMARY: !c! of !t! tests failed.)
+)
+
+exit /b !c!
diff --git a/Chalice/tests/test-scripts/reg_test.bat b/Chalice/tests/test-scripts/reg_test.bat
index 0e5e4dbf..530d1d19 100644
--- a/Chalice/tests/test-scripts/reg_test.bat
+++ b/Chalice/tests/test-scripts/reg_test.bat
@@ -3,6 +3,13 @@ setlocal
set chalice="%~dp0\..\..\chalice.bat"
set diff="%~dp0\diff.bat"
+:: no-diff command line parameter
+set nodiff=0
+if "%1"=="-no-diff" (
+ set nodiff=1
+ SHIFT
+)
+
if not exist "%1.chalice" goto errorNotFound
if not exist "%1.output.txt" goto errorNoRef
@@ -40,7 +47,9 @@ goto end
:failTest
echo FAIL: %1.chalice
-call %diff% "%1.output.txt" output.txt
+if %nodiff%==0 (
+ call %diff% "%1.output.txt" output.txt
+)
goto errorEnd
:errorEnd
diff --git a/Chalice/tests/test-scripts/reg_test_all.bat b/Chalice/tests/test-scripts/reg_test_all.bat
index 6bbac775..23aca316 100644
--- a/Chalice/tests/test-scripts/reg_test_all.bat
+++ b/Chalice/tests/test-scripts/reg_test_all.bat
@@ -1,9 +1,24 @@
@echo off
-set regtest="%~dp0\reg_test.bat"
+setlocal EnableDelayedExpansion
-for /F %%f in ('dir *.chalice /b') do (
- call %regtest% %%~nf %1 %2 %3 %4 %5 %6 %7 %8
+:: no-summary command line parameter
+set nosummary=0
+if "%1"=="-no-summary" (
+ set nosummary=1
+ SHIFT /1
)
-exit /b 0
+set regtest="%~dp0\reg_test.bat"
+set t=0
+set c=0
+for /F %%f in ('dir *.chalice /b') do (
+ call %regtest% -no-diff %%~nf %1 %2 %3 %4 %5 %6 %7 %8
+ set /A c=!c!+!errorlevel!
+ set /A t=!t!+1
+)
+if !nosummary!==0 (
+ echo.
+ if !c!==0 (echo SUMMARY: completed !t! tests successfully.) else (echo SUMMARY: failed !c! of !t! tests.)
+)
+exit /b !c!