From 064f8156698101eaf525006d8b2ea99a91cb379b Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 5 Apr 2021 15:36:54 -0700 Subject: [PATCH] check_test_ran.py: remove grep/xsltproc (#203) We aren't using QTest anymore in ign-gui, so remove the parts of check_test_ran.py that translated QTest xml files into junit, since they don't work easily on Windows and aren't needed any longer. Fixes #198. Signed-off-by: Steve Peters --- tools/check_test_ran.py | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/tools/check_test_ran.py b/tools/check_test_ran.py index a6d87e6c6..481693435 100755 --- a/tools/check_test_ran.py +++ b/tools/check_test_ran.py @@ -44,7 +44,6 @@ import os import sys -import subprocess def usage(): print("""Usage: @@ -53,29 +52,6 @@ def usage(): print(sys.argv) sys.exit(getattr(os, 'EX_USAGE', 1)) -def run_grep(filename, arg): - process = subprocess.Popen(['grep', arg, filename], stdout=subprocess.PIPE) - stdout, stderr = process.communicate() - return stdout, stderr - -def run_xsltproc(stylesheet, document): - try: - process = subprocess.Popen(['xsltproc', stylesheet, document], stdout=subprocess.PIPE) - stdout, stderr = process.communicate() - # Overwrite same document - open(document, 'w').write(stdout) - except OSError as err: - test_name = os.path.basename(document) - f = open(document, 'w') - d = {'test': test_name, 'test_file': document, 'test_no_xml': test_name.replace('.xml', '')} - f.write(""" - - - - -"""%d) - sys.exit(getattr(os, 'EX_USAGE', 1)) - def check_main(): if len(sys.argv) < 2: usage() @@ -98,14 +74,6 @@ def check_main(): """%d) - sys.exit(getattr(os, 'EX_USAGE', 1)) - - # Checking if test is a QTest file - stdout, stderr = run_grep(test_file, "QtVersion") - if (stdout): - print("Detect QTest xml file. Converting to JUNIT ...") - stylesheet = os.path.dirname(os.path.abspath(__file__)) + "/qtest_to_junit.xslt" - run_xsltproc(stylesheet, test_file) if __name__ == '__main__': check_main()