From f22fd396ef882b97c82f1dc938d4bf8a9a311bef Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Sat, 19 Jan 2013 16:41:19 +0000 Subject: [PATCH] write the test case name before it is run so if the test case crashes badly, we can trace back what test case it was at a later stage --- lib/core/testing.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/testing.py b/lib/core/testing.py index 647035487..f6ef2acab 100644 --- a/lib/core/testing.py +++ b/lib/core/testing.py @@ -167,6 +167,10 @@ def liveTest(): result = runCase(switches, parse) + test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING) + test_case_fd.write(name) + test_case_fd.close() + if result: logger.info("test passed") cleanCase() @@ -184,10 +188,6 @@ def liveTest(): logger.error(errMsg) - test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING) - test_case_fd.write(msg) - test_case_fd.close() - if failedParseOn: console_output_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "console_output"), "wb", UNICODE_ENCODING) console_output_fd.write(failedParseOn)