summaryrefslogtreecommitdiffstats
path: root/xlate-test.py
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-11-06 21:10:45 +0100
committerPhil Sutter <phil@nwl.cc>2021-11-08 12:22:44 +0100
commitafa525ee81aa799284c35575c945785fa8b82b13 (patch)
tree6630c7450a2d824d5c779b48bb0895343d93c1cd /xlate-test.py
parentb8d5271de4f7cc6ffeeca589ea4706e316599015 (diff)
xlate-test: Print full path if testing all files
Lines won't become too long and it's more clear to users where test input comes from this way. Signed-off-by: Phil Sutter <phil@nwl.cc> Tested-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'xlate-test.py')
-rwxr-xr-xxlate-test.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/xlate-test.py b/xlate-test.py
index 4a56e798..d78e8648 100755
--- a/xlate-test.py
+++ b/xlate-test.py
@@ -80,15 +80,15 @@ def run_test(name, payload):
def load_test_files():
test_files = total_tests = total_passed = total_error = total_failed = 0
- for test in sorted(os.listdir("extensions")):
- if test.endswith(".txlate"):
- with open("extensions/" + test, "r") as payload:
- tests, passed, failed, errors = run_test(test, payload)
- test_files += 1
- total_tests += tests
- total_passed += passed
- total_failed += failed
- total_error += errors
+ tests = sorted(os.listdir("extensions"))
+ for test in ['extensions/' + f for f in tests if f.endswith(".txlate")]:
+ with open(test, "r") as payload:
+ tests, passed, failed, errors = run_test(test, payload)
+ test_files += 1
+ total_tests += tests
+ total_passed += passed
+ total_failed += failed
+ total_error += errors
return (test_files, total_tests, total_passed, total_failed, total_error)