diff --git a/.slugignore b/.slugignore index 2fc0a8054..149a7095a 100644 --- a/.slugignore +++ b/.slugignore @@ -5,7 +5,7 @@ Examples QuickFIXn.sln docs spec -acceptance_test.bat +acceptance_test.ps1 generator unit_test.bat PerformanceTests diff --git a/README.md b/README.md index c1138bdf1..9e5932960 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Acceptance Tests ---------------- To run the full suite of acceptance tests: - acceptance_test.bat + acceptance_test.ps1 An HTML report of the test results will then be available here: @@ -94,7 +94,7 @@ To run one particular acceptance test, e.g. fix42\14e_IncorrectEnumValue.def: cd AcceptanceTest runat.ps1 release 5003 definitions\server\fix42\14e_IncorrectEnumValue.def cfg\at_42.cfg -(See acceptance_test.bat for the proper port numbers and config files to use in the above command.) +(See acceptance_test.ps1 for the proper port numbers and config files to use in the above command.) The test results will then be available in AcceptanceTests\TestResults.xml and debug information will be available in the AcceptanceTests\log directory. diff --git a/acceptance_test.bat b/acceptance_test.bat deleted file mode 100755 index cd82fa7b2..000000000 --- a/acceptance_test.bat +++ /dev/null @@ -1,107 +0,0 @@ -REM reset script vars that this script uses -REM (in case the environment has them inexplicably set already) -set RESULT40= -set RESULT41= -set RESULT42= -set RESULT43= -set RESULT44= -set RESULT44_NORESET= -set RESULT50= -set RESULT50SP1= -set RESULT50SP2= -set RESULTMISC= -set RETURNVALUE= - -pushd AcceptanceTest - del AcceptanceTests_*.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5001 definitions/server/fix40/*.def cfg/at_40.cfg - if ERRORLEVEL 1 set RESULT40=1 - echo "40 tests result: %RESULT40%" - copy TestResult.xml AcceptanceTests_40.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5002 definitions/server/fix41/*.def cfg/at_41.cfg - if ERRORLEVEL 1 set RESULT41=1 - echo "41 tests result: %RESULT41%" - copy TestResult.xml AcceptanceTests_41.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5003 definitions/server/fix42/*.def cfg/at_42.cfg - if ERRORLEVEL 1 set RESULT42=1 - echo "42 tests result: %RESULT42%" - copy TestResult.xml AcceptanceTests_42.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5004 definitions/server/fix43/*.def cfg/at_43.cfg - if ERRORLEVEL 1 set RESULT43=1 - echo "43 tests result: %RESULT43%" - copy TestResult.xml AcceptanceTests_43.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5005 definitions/server/fix44/*.def cfg/at_44.cfg - if ERRORLEVEL 1 set RESULT44=1 - echo "44 tests result: %RESULT44%" - copy TestResult.xml AcceptanceTests_44.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5005 definitions/server/fix44noreset/*.def cfg/at_44_noreset.cfg - if ERRORLEVEL 1 set RESULT44_NORESET=1 - echo "44 tests result: %RESULT44_NORESET%" - copy TestResult.xml AcceptanceTests_44_noreset.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5006 definitions/server/fix50/*.def cfg/at_50.cfg - if ERRORLEVEL 1 set RESULT50=1 - echo "50 tests result: %RESULT50%" - copy TestResult.xml AcceptanceTests_50.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5007 definitions/server/fix50sp1/*.def cfg/at_50_sp1.cfg - if ERRORLEVEL 1 set RESULT50SP1=1 - echo "50 SP1 tests result: %RESULT50SP1%" - copy TestResult.xml AcceptanceTests_50_SP1.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5008 definitions/server/fix50sp2/*.def cfg/at_50_sp2.cfg - if ERRORLEVEL 1 set RESULT50SP2=1 - echo "50 SP2 tests result: %RESULT50SP2%" - copy TestResult.xml AcceptanceTests_50_SP2.xml - - call pause - del TestResult.xml - PowerShell .\runat.ps1 release 5003 definitions/server/misc/*.def cfg/at_42.misc.cfg - if ERRORLEVEL 1 set RESULTMISC=1 - echo "Misc tests result: %RESULTMISC%" - copy TestResult.xml AcceptanceTests_Misc.xml -popd - -echo "" -echo "" -echo "test suite results (blank means success):" -echo " 40: %RESULT40%" -echo " 41: %RESULT41%" -echo " 42: %RESULT42%" -echo " 43: %RESULT43%" -echo " 44: %RESULT44%" -echo " 44nr: %RESULT44_NORESET%" -echo " 50: %RESULT50%" -echo "50 SP1: %RESULT50SP1%" -echo "50 SP2: %RESULT50SP2%" -echo " MISC: %RESULTMISC%" - -set /a RETURNVALUE=RESULT40+RESULT41+RESULT42+RESULT43+RESULT44+RESULT44_NORESET+RESULT50+RESULT50SP1+RESULT50SP2+RESULTMISC - -echo "Script returns: %RETURNVALUE%" -echo "(0 means success)" -exit /B %RETURNVALUE% diff --git a/acceptance_test.ps1 b/acceptance_test.ps1 new file mode 100644 index 000000000..a28fc219d --- /dev/null +++ b/acceptance_test.ps1 @@ -0,0 +1,73 @@ +$return_value=0 +$success_string="`r`nTest Suite Results:" + +function TestSpec +{ + param( + [Parameter(Mandatory=$True,Position=0)] + [string]$release, + + [Parameter(Mandatory=$True,Position=1)] + [string]$port, + + [Parameter(Mandatory=$True,Position=2)] + [string]$def, + + [Parameter(Mandatory=$True,Position=3)] + [string]$conf, + + [Parameter(Mandatory=$True,Position=4)] + [string]$dest + ) + if(Test-Path TestResult.xml){ Remove-Item TestResult.xml } + + Invoke-Expression ".\runat.ps1 $release $port $def $conf" + + if($LASTEXITCODE -eq 1){ $script:return_value = $script:return_value + 1 } + $result = "$dest tests result:$LASTEXITCODE" + echo $result + $script:success_string = $script:success_string + "`r`n`t$result" + Copy-Item TestResult.xml -Destination $dest +} + +Push-Location -Path "AcceptanceTest" -StackName AcceptanceTest + + Remove-Item AcceptanceTests_*.xml + + # Fix 40 + TestSpec "release" "5001" "definitions/server/fix40/*.def" "cfg/at_40.cfg" "AcceptanceTests_40.xml" + + # Fix 41 + TestSpec "release" "5002" "definitions/server/fix41/*.def" "cfg/at_41.cfg" "AcceptanceTests_41.xml" + + # Fix 42 + TestSpec "release" "5003" "definitions/server/fix42/*.def" "cfg/at_42.cfg" "AcceptanceTests_42.xml" + + # Fix 43 + TestSpec "release" "5004" "definitions/server/fix43/*.def" "cfg/at_43.cfg" "AcceptanceTests_43.xml" + + # Fix 44 + TestSpec "release" "5005" "definitions/server/fix44/*.def" "cfg/at_44.cfg" "AcceptanceTests_44.xml" + + # Fix 44 No Reset + TestSpec "release" "5005" "definitions/server/fix44noreset/*.def" "cfg/at_44_noreset.cfg" "AcceptanceTests_44_noreset.xml" + + # Fix 50 + TestSpec "release" "5006" "definitions/server/fix50/*.def" "cfg/at_50.cfg" "AcceptanceTests_50.xml" + + # Fix 50sp1 + TestSpec "release" "5007" "definitions/server/fix50sp1/*.def" "cfg/at_50_sp1.cfg" "AcceptanceTests_50_SP1.xml" + + # Fix 50sp2 + TestSpec "release" "5008" "definitions/server/fix50sp2/*.def" "cfg/at_50_sp2.cfg" "AcceptanceTests_50_SP2.xml" + + # Misc + TestSpec "release" "5003" "definitions/server/misc/*.def" "cfg/at_42.misc.cfg" "AcceptanceTests_Misc.xml" + +Pop-Location -StackName AcceptanceTest + +echo $success_string + +echo "Script returns: $return_value" +echo "(0 means success)" +Exit $return_value diff --git a/appveyor.yml b/appveyor.yml index 4dd88ce7d..564a1b360 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ version: 1.0.{build} install: - cmd: >- gem install nokogiri - + generate.bat build_script: - cmd: build.bat @@ -11,5 +11,5 @@ build_script: test_script: - cmd: >- unit_test.bat - + acceptance_test.bat diff --git a/appveyor_test.bat b/appveyor_test.bat new file mode 100644 index 000000000..9aeb063fc --- /dev/null +++ b/appveyor_test.bat @@ -0,0 +1 @@ + PowerShell .\acceptance_test.ps1 \ No newline at end of file