diff --git a/game/tests/run_tests.gd b/game/tests/run_tests.gd index 8f305dd..5a0ea89 100644 --- a/game/tests/run_tests.gd +++ b/game/tests/run_tests.gd @@ -2,7 +2,8 @@ extends SceneTree ## Runs every test script in res://tests whose file name starts with "test_". ## Every method whose name starts with "test_" is one test. A test fails if a ## check fails or if an error is reported while it runs, for example a call -## on a null value. Exits with code 1 if any test failed. +## on a null value. Exits with code 1 if any test failed or if no test ran, +## so that a renamed test folder or misnamed tests cannot pass as a clean run. ## ## From the repository root: ## godot --headless --path game -s res://tests/run_tests.gd @@ -78,4 +79,4 @@ func _run_all() -> void: print(" " + failure) OS.remove_logger(counter) print("%d passed, %d failed" % [passed, failed]) - quit(1 if failed > 0 else 0) + quit(1 if failed > 0 or passed == 0 else 0)