tests: exit 1 if tests fail

This commit is contained in:
Nicola Guerrera
2024-04-09 04:23:48 +02:00
parent 6602b89750
commit ba966f01d1
3 changed files with 2 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ def checkRegex(regex, should_work=True, upper=False):
if server.sendCheckData(secrets.token_bytes(200) + base64.b64decode(regex) + secrets.token_bytes(200)):
puts(f"The request wasn't blocked ✔", color=colors.green)
else:
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red)
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red); exit_test(1)
checkRegex(regex)

View File

@@ -95,7 +95,7 @@ def checkRegex(regex, should_work=True, upper=False):
if server.sendCheckData(secrets.token_bytes(200) + base64.b64decode(regex) + secrets.token_bytes(200)):
puts(f"The request wasn't blocked ✔", color=colors.green)
else:
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red)
puts(f"Test Failed: The request was blocked when it shouldn't have", color=colors.red); exit_test(1)
checkRegex(regex)

0
tests/run_tests.sh Executable file → Normal file
View File