[llvm-commits] [zorg] r150593 - /zorg/trunk/lnt/lnt/tests/compile.py

Daniel Dunbar daniel at zuster.org
Wed Feb 15 10:01:10 PST 2012


Author: ddunbar
Date: Wed Feb 15 12:01:10 2012
New Revision: 150593

URL: http://llvm.org/viewvc/llvm-project?rev=150593&view=rev
Log:
[lnt] lnt runtest compile: Pass -DSPEC_CPU_MACOSX to 403.gcc.
 - These tests are pretty OS X specific for now, obviously.

Modified:
    zorg/trunk/lnt/lnt/tests/compile.py

Modified: zorg/trunk/lnt/lnt/tests/compile.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/compile.py?rev=150593&r1=150592&r2=150593&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/tests/compile.py (original)
+++ zorg/trunk/lnt/lnt/tests/compile.py Wed Feb 15 12:01:10 2012
@@ -14,6 +14,8 @@
 # Interface to runN.
 #
 # FIXME: Simplify.
+#
+# FIXME: Figure out a better way to deal with need to run as root.
 def runN(args, N, cwd, preprocess_cmd=None, env=None, sample_mem=False,
          ignore_stderr=False):
     cmd = ['runN', '-a']
@@ -146,8 +148,8 @@
         yield (success, tname, info, samples)
 
 def test_compile(name, run_info, variables, input, output, pch_input,
-                 flags, stage):
-    extra_flags = []
+                 flags, stage, extra_flags=[]):
+    extra_flags = list(extra_flags)
 
     cc_name = variables.get('cc_name')
     is_llvm = not (cc_name == 'gcc')
@@ -158,7 +160,7 @@
         return ()
 
     # Ignore 'init' and 'irgen_only' stages for non-Clang.
-    if not is_clang and stage in ('init','irgen_only'):
+    if not is_clang and stage in ('init', 'irgen_only'):
         return ()
 
     # Force gnu99 mode for all compilers.
@@ -205,8 +207,8 @@
                            'Inputs')
 g_output_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                             'Output')
-all_inputs = [('Sketch/SKTGraphicView/SKTGraphicView.m',True),
-               ('403.gcc/combine/combine.c',False)]
+all_inputs = [('Sketch/Sketch+Accessibility/SKTGraphicView.m', True, ()),
+               ('403.gcc/combine.c', False, ('-DSPEC_CPU_MACOSX',))]
 
 flags_to_test = [('-O0',), ('-O0','-g',), ('-Os',)]
 stages_to_test = ['driver', 'init', 'syntax', 'irgen_only', 'irgen', 'codegen',
@@ -220,7 +222,7 @@
                   curry(test_compile, input='Cocoa_Prefix.h',
                         output='Cocoa_Prefix.h.gch', pch_input=None, flags=f,
                         stage='pch-gen')))
-    for input,uses_pch in all_inputs:
+    for input,uses_pch,extra_flags in all_inputs:
         name = os.path.dirname(input)
         output = os.path.splitext(os.path.basename(input))[0] + '.o'
         for stage in stages_to_test:
@@ -229,7 +231,8 @@
                 pch_input = 'Cocoa_Prefix.h.gch'
             all_tests.append(('compile/%s/%s' % (name.replace('.','_'), stage),
                               curry(test_compile, input=input, output=output,
-                                    pch_input=pch_input, flags=f, stage=stage)))
+                                    pch_input=pch_input, flags=f, stage=stage,
+                                    extra_flags=extra_flags)))
 
 tests_by_name = dict([(k,(k,v)) for k,v in all_tests])
 
@@ -606,7 +609,7 @@
         else:
             output = open(output,'w')
         print >>output, report.render()
-        if output is not sys.stderr:
+        if output is not sys.stdout:
             output.close()
 
         return report





More information about the llvm-commits mailing list