From: Jeff Lucovsky Date: Wed, 19 Feb 2020 14:21:17 +0000 (-0500) Subject: run: Improved support of shell tests X-Git-Tag: suricata-6.0.4~344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc31da50aa92e7ff94304487493027f09c12be9f;p=thirdparty%2Fsuricata-verify.git run: Improved support of shell tests --- diff --git a/run.py b/run.py index bbfd269ec..24951fbaf 100755 --- a/run.py +++ b/run.py @@ -118,8 +118,9 @@ def pipe_reader(fileobj, output=None, verbose=False): def handle_exceptions(func): def applicator(*args, **kwargs): + result = False try: - func(*args,**kwargs) + result = func(*args,**kwargs) except TestError as te: print("Sub test #{}: FAIL : {}".format(kwargs["test_num"], te)) check_args_fail() @@ -128,7 +129,11 @@ def handle_exceptions(func): print("Sub test #{}: SKIPPED : {}".format(kwargs["test_num"], ue)) kwargs["count"]["skipped"] += 1 else: - kwargs["count"]["success"] += 1 + if result: + kwargs["count"]["success"] += 1 + else: + print("\nSub test #{}: FAIL : {}".format(kwargs["test_num"], kwargs["check"]["args"])) + kwargs["count"]["failure"] += 1 return kwargs["count"] return applicator diff --git a/tests/pcre-invalid-rule-01/.test.rules.swp b/tests/pcre-invalid-rule-01/.test.rules.swp deleted file mode 100644 index 6258592bc..000000000 Binary files a/tests/pcre-invalid-rule-01/.test.rules.swp and /dev/null differ diff --git a/tests/pcre-invalid-rule-01/.test.yaml.swp b/tests/pcre-invalid-rule-01/.test.yaml.swp deleted file mode 100644 index e9f65157e..000000000 Binary files a/tests/pcre-invalid-rule-01/.test.yaml.swp and /dev/null differ