diff --git a/ags3/auto-test/Game.agf b/ags3/auto-test/Game.agf index 15fdf7a..729fdc4 100644 --- a/ags3/auto-test/Game.agf +++ b/ags3/auto-test/Game.agf @@ -1,6 +1,6 @@ - + False @@ -2190,10 +2190,10 @@ diff --git a/ags3/auto-test/run-tests.asc b/ags3/auto-test/run-tests.asc index 55cf2f0..cc29c8c 100644 --- a/ags3/auto-test/run-tests.asc +++ b/ags3/auto-test/run-tests.asc @@ -31,5 +31,10 @@ void RunTests() if(tap.AnyTestFailed()) { AbortGame("ERROR: test(s) have failed."); } + + if(tap.PlannedTests != tap.ExecutedTests) { + AbortGame("ERROR: Plan mismatch! Planned %d tests, but ran %d tests.", tap.PlannedTests, tap.ExecutedTests); + } + QuitGame(0); } \ No newline at end of file diff --git a/ags3/auto-test/tap.asc b/ags3/auto-test/tap.asc index 82476b5..d84466e 100644 --- a/ags3/auto-test/tap.asc +++ b/ags3/auto-test/tap.asc @@ -240,6 +240,16 @@ static void tap::Comment(String comment) { _test_printer(String.Format("# %s", comment)); } +int get_PlannedTests(static tap) +{ + return _planned_tests; +} + +int get_ExecutedTests(static tap) +{ + return _test_count - 1; +} + // refer to the game forum topic or github repository for updated current documentation. // the below text is only provided as a last resort in case you are offline. // diff --git a/ags3/auto-test/tap.ash b/ags3/auto-test/tap.ash index 9016a06..22a8663 100644 --- a/ags3/auto-test/tap.ash +++ b/ags3/auto-test/tap.ash @@ -56,4 +56,10 @@ struct tap{ /// add a comment to output import static void Comment(String comment); + + /// gets the number of tests that are planned + import static readonly attribute int PlannedTests; + + /// gets the number of tests executed so far + import static readonly attribute int ExecutedTests; }; diff --git a/ags4/auto-test/Game.agf b/ags4/auto-test/Game.agf index 462e9e1..e65804e 100644 --- a/ags4/auto-test/Game.agf +++ b/ags4/auto-test/Game.agf @@ -1726,10 +1726,10 @@ diff --git a/ags4/auto-test/run-tests.asc b/ags4/auto-test/run-tests.asc index 55cf2f0..cc29c8c 100644 --- a/ags4/auto-test/run-tests.asc +++ b/ags4/auto-test/run-tests.asc @@ -31,5 +31,10 @@ void RunTests() if(tap.AnyTestFailed()) { AbortGame("ERROR: test(s) have failed."); } + + if(tap.PlannedTests != tap.ExecutedTests) { + AbortGame("ERROR: Plan mismatch! Planned %d tests, but ran %d tests.", tap.PlannedTests, tap.ExecutedTests); + } + QuitGame(0); } \ No newline at end of file diff --git a/ags4/auto-test/tap.asc b/ags4/auto-test/tap.asc index 82476b5..d84466e 100644 --- a/ags4/auto-test/tap.asc +++ b/ags4/auto-test/tap.asc @@ -240,6 +240,16 @@ static void tap::Comment(String comment) { _test_printer(String.Format("# %s", comment)); } +int get_PlannedTests(static tap) +{ + return _planned_tests; +} + +int get_ExecutedTests(static tap) +{ + return _test_count - 1; +} + // refer to the game forum topic or github repository for updated current documentation. // the below text is only provided as a last resort in case you are offline. // diff --git a/ags4/auto-test/tap.ash b/ags4/auto-test/tap.ash index cab81a5..de69cba 100644 --- a/ags4/auto-test/tap.ash +++ b/ags4/auto-test/tap.ash @@ -56,4 +56,10 @@ struct tap{ /// add a comment to output import static void Comment(String comment); + + /// gets the number of tests that are planned + import static readonly attribute int PlannedTests; + + /// gets the number of tests executed so far + import static readonly attribute int ExecutedTests; };