[PATCH] [libcxx] Add numerous options to libc++ LIT test suite configuration.

Dan Albert danalbert at google.com
Tue Nov 11 09:53:34 PST 2014


A bunch of style nits and a few doc changes, but otherwise looks good.

================
Comment at: test/lit.cfg:41
@@ +40,3 @@
+    def execute_command(self, cmd, cwd=None, env=None):
+        out,err,exitCode = lit.util.executeCommand(cmd,cwd=cwd,env=env)
+        report = """Command: %s\n""" %\
----------------
Spaces after commas.

================
Comment at: test/lit.cfg:42
@@ +41,3 @@
+        out,err,exitCode = lit.util.executeCommand(cmd,cwd=cwd,env=env)
+        report = """Command: %s\n""" %\
+                ' '.join(["'%s'" % a for a in cmd])
----------------
Why the docstring? I see you didn't actually put them here, but what's the point?

Same goes for the rest of them.

================
Comment at: test/lit.cfg:55
@@ -56,1 +54,3 @@
+        report += '\n'
+        return out,err,exitCode,report
 
----------------
Spaces after commas.

================
Comment at: test/lit.cfg:128
@@ -127,3 +127,3 @@
                 expected_rc = 0
-            out, err, rc = self.execute_command(cmd)
+            out,err,rc,report = self.execute_command(cmd)
             if rc == expected_rc:
----------------
Spaces after commas.

================
Comment at: test/lit.cfg:142
@@ -149,12 +141,3 @@
                 cmd = compile_cmd
-                out, err, exitCode = self.execute_command(cmd)
-                if exitCode != 0:
-                    report = """Command: %s\n""" % ' '.join(["'%s'" % a
-                                                             for a in cmd])
-                    report += """Exit Code: %d\n""" % exitCode
-                    if out:
-                        report += """Standard Output:\n--\n%s--""" % out
-                    if err:
-                        report += """Standard Error:\n--\n%s--""" % err
-                    report += "\n\nCompilation failed unexpectedly!"
-                    return lit.Test.FAIL, report
+                out,err,rc,report = self.execute_command(cmd)
+                if rc != 0:
----------------
Spaces after commas.

================
Comment at: test/lit.cfg:154
@@ -169,3 +153,3 @@
                     cmd = lit_config.valgrindArgs + cmd
-                out, err, exitCode = self.execute_command(cmd, source_dir)
-                if exitCode != 0:
+                out,err,rc,report = self.execute_command(cmd, cwd=source_dir)
+                if rc != 0:
----------------
Again.

================
Comment at: test/lit.cfg:219
@@ +218,3 @@
+        self.lit_config.note('Using link_flags: %s\n' % self.link_flags)
+        self.lit_config.note('Using available_features: %s\n' %\
+                              self.config.available_features)
----------------
Don't need the trailing \ when it's inside parentheses.

================
Comment at: test/lit.cfg:344
@@ -362,1 +343,3 @@
+        libcxx_headers = self.get_lit_conf('libcxx_headers',
+                                        os.path.join(self.src_root, 'include'))
         # Configure extra compiler flags.
----------------
Alignment.

================
Comment at: test/lit.cfg:359
@@ +358,3 @@
+        if self.use_system_lib and libcxx_library is not None:
+            self.lit_config.fatal(
+                'conflicting options given: use_system_lib and libcxx_library')
----------------
Agreed. Fatal makes more sense.

================
Comment at: test/lit.cfg:370
@@ -371,1 +369,3 @@
+                self.link_flags += ['-L' + self.obj_root + '/lib',
+                             '-Wl,-rpath,' + os.path.join(self.obj_root, 'lib')]
         # Configure library search paths
----------------
Alignment.

================
Comment at: www/lit_usage.html:15
@@ +14,3 @@
+      font-size: medium;
+      color:#2d58b7
+    }
----------------
Space after colon.

================
Comment at: www/lit_usage.html:53
@@ +52,3 @@
+<p>
+libc++ uses LIT to configure and run it's tests. The primary way to run the
+libc++ tests is by using <code>make check-libcxx</code>. However since libc++
----------------
s/it's/its/

================
Comment at: www/lit_usage.html:61
@@ +60,3 @@
+Documentation for LIT can be found
+<a href='http://llvm.org/docs/CommandGuide/lit.html'>here</a>.
+</p>
----------------
s/"/'/

================
Comment at: www/lit_usage.html:135
@@ +134,3 @@
+<blockquote class="lit-option-desc">
+Specify an additional list of linker flags to use.
+</blockquote>
----------------
Should say how the list is delimited. Same for the others.

================
Comment at: www/lit_usage.html:142
@@ +141,3 @@
+<blockquote class="lit-option-desc">
+<b>Values: </b><code>c++98, c++03, c++11, c++1z, c++14</code></br>
+Change the standard version used when building the tests.
----------------
1z should probably come after 14.

http://reviews.llvm.org/D5877






More information about the cfe-commits mailing list