[test-suite] r291933 - litsupport: Add compatibility cludge so it still works with the pypy version of lit

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 10:36:20 PST 2017


Author: matze
Date: Fri Jan 13 12:36:20 2017
New Revision: 291933

URL: http://llvm.org/viewvc/llvm-project?rev=291933&view=rev
Log:
litsupport: Add compatibility cludge so it still works with the pypy version of lit

Modified:
    test-suite/trunk/litsupport/testfile.py

Modified: test-suite/trunk/litsupport/testfile.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/testfile.py?rev=291933&r1=291932&r2=291933&view=diff
==============================================================================
--- test-suite/trunk/litsupport/testfile.py (original)
+++ test-suite/trunk/litsupport/testfile.py Fri Jan 13 12:36:20 2017
@@ -27,16 +27,19 @@ def parse(context, filename):
     runscript = []
     verifyscript = []
     metricscripts = {}
-    keywords = ['PREPARE:', 'RUN:', 'VERIFY:', 'METRIC:']
+    # Note that we keep both "RUN" and "RUN:" in the list to stay compatible
+    # with older lit versions.
+    keywords = ['PREPARE:', 'PREPARE', 'RUN:', 'RUN', 'VERIFY:', 'VERIFY',
+                'METRIC:', 'METRIC']
     for line_number, command_type, ln in \
             parseIntegratedTestScriptCommands(filename, keywords):
-        if command_type == 'PREPARE:':
+        if command_type.startswith('PREPARE'):
             _parseShellCommand(preparescript, ln)
-        elif command_type == 'RUN:':
+        elif command_type.startswith('RUN'):
             _parseShellCommand(runscript, ln)
-        elif command_type == 'VERIFY:':
+        elif command_type.startswith('VERIFY'):
             _parseShellCommand(verifyscript, ln)
-        elif command_type == 'METRIC:':
+        elif command_type.startswith('METRIC'):
             metric, ln = ln.split(':', 1)
             metricscript = metricscripts.setdefault(metric.strip(), list())
             _parseShellCommand(metricscript, ln)




More information about the llvm-commits mailing list