[cfe-commits] [libcxx] r113935 - /libcxx/trunk/test/lit.cfg

Daniel Dunbar daniel at zuster.org
Tue Sep 14 21:31:58 PDT 2010


Author: ddunbar
Date: Tue Sep 14 23:31:58 2010
New Revision: 113935

URL: http://llvm.org/viewvc/llvm-project?rev=113935&view=rev
Log:
tests/lit: Split options into two groups, so we don't get driver warnings about
unused linker arguments for compile only tests.

Modified:
    libcxx/trunk/test/lit.cfg

Modified: libcxx/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=113935&r1=113934&r2=113935&view=diff
==============================================================================
--- libcxx/trunk/test/lit.cfg (original)
+++ libcxx/trunk/test/lit.cfg Tue Sep 14 23:31:58 2010
@@ -18,9 +18,10 @@
       FOO.fail.cpp - Negative test case which is expected to fail compilation.
     """
 
-    def __init__(self, cxx_under_test, options):
+    def __init__(self, cxx_under_test, cpp_flags, ld_flags):
         self.cxx_under_test = cxx_under_test
-        self.options = list(options)
+        self.cpp_flags = list(cpp_flags)
+        self.ld_flags = list(ld_flags)
 
     def execute_command(self, command):
         p = subprocess.Popen(command, stdin=subprocess.PIPE,
@@ -45,7 +46,7 @@
         # If this is a compile (failure) test, build it and check for failure.
         if expected_compile_fail:
             cmd = [self.cxx_under_test, '-c',
-                   '-o', '/dev/null', source_path] + self.options
+                   '-o', '/dev/null', source_path] + self.cpp_flags
             out, err, exitCode = self.execute_command(cmd)
             if exitCode == 1:
                 return lit.Test.PASS, ""
@@ -58,7 +59,7 @@
                 if err:
                     report += """Standard Error:\n--\n%s--""" % err
                 report += "\n\nExpected compilation to fail!"
-                return Test.FAIL, report
+                return lit.Test.FAIL, report
         else:
             exec_file = tempfile.NamedTemporaryFile(suffix="exe", delete=False)
             exec_path = exec_file.name
@@ -66,7 +67,7 @@
 
             try:
                 cmd = [self.cxx_under_test, '-o', exec_path,
-                       source_path] + self.options
+                       source_path] + self.cpp_flags + self.ld_flags
                 out, err, exitCode = self.execute_command(cmd)
                 if exitCode != 0:
                     report = """Command: %s\n""" % ' '.join(["'%s'" % a
@@ -113,9 +114,9 @@
     lit.fatal('must specify user parameter cxx_under_test '
               '(e.g., --param=cxx_under_test=clang++)')
 config.test_format = LibcxxTestFormat(cxx_under_test,
-                                      ['-nostdinc++',
-                                       '-I/usr/include/c++/v1',
-                                       '-nodefaultlibs', '-lc++',
-                                       '-lSystem'])
+                                      cpp_flags = ['-nostdinc++',
+                                                   '-I/usr/include/c++/v1'],
+                                      ld_flags = ['-nodefaultlibs', '-lc++',
+                                                  '-lSystem'])
 
 config.target_triple = None





More information about the cfe-commits mailing list