[libcxx] r217017 - test: Make it possible to opt in to use_clang_verify per test

Justin Bogner mail at justinbogner.com
Tue Sep 2 23:01:53 PDT 2014


Author: bogner
Date: Wed Sep  3 01:01:52 2014
New Revision: 217017

URL: http://llvm.org/viewvc/llvm-project?rev=217017&view=rev
Log:
test: Make it possible to opt in to use_clang_verify per test

This modifies the use_clang_verify parameter I added in r217009 to
only apply to tests that specifically ask for it via // USE_VERIFY.
This allows us to incrementally convert tests, but start enjoying the
benefits right away.

Suggested by Eric Fiselier in code review.

Modified:
    libcxx/trunk/test/lit.cfg
    libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp

Modified: libcxx/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=217017&r1=217016&r2=217017&view=diff
==============================================================================
--- libcxx/trunk/test/lit.cfg (original)
+++ libcxx/trunk/test/lit.cfg Wed Sep  3 01:01:52 2014
@@ -67,6 +67,7 @@ class LibcxxTestFormat(lit.formats.FileB
         # Extract test metadata from the test file.
         requires = []
         unsupported = []
+        use_verify = False
         with open(test.getSourcePath()) as f:
             for ln in f:
                 if 'XFAIL:' in ln:
@@ -78,6 +79,8 @@ class LibcxxTestFormat(lit.formats.FileB
                 elif 'UNSUPPORTED:' in ln:
                     items = ln[ln.index('UNSUPPORTED:') + 12:].split(',')
                     unsupported.extend([s.strip() for s in items])
+                elif 'USE_VERIFY' in ln and self.use_verify_for_fail:
+                    use_verify = True
                 elif not ln.strip().startswith("//") and ln.strip():
                     # Stop at the first non-empty line that is not a C++
                     # comment.
@@ -103,9 +106,9 @@ class LibcxxTestFormat(lit.formats.FileB
                        ', '.join(unsupported_features),))
 
         # Evaluate the test.
-        return self._evaluate_test(test, lit_config)
+        return self._evaluate_test(test, use_verify, lit_config)
 
-    def _evaluate_test(self, test, lit_config):
+    def _evaluate_test(self, test, use_verify, lit_config):
         name = test.path_in_suite[-1]
         source_path = test.getSourcePath()
         source_dir = os.path.dirname(source_path)
@@ -119,7 +122,7 @@ class LibcxxTestFormat(lit.formats.FileB
             cmd = [self.cxx_under_test, '-c',
                    '-o', '/dev/null', source_path] + self.cpp_flags
             expected_rc = 1
-            if self.use_verify_for_fail:
+            if use_verify:
                 cmd += ['-Xclang', '-verify']
                 expected_rc = 0
             out, err, rc = self.execute_command(cmd)

Modified: libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp?rev=217017&r1=217016&r2=217017&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp (original)
+++ libcxx/trunk/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp Wed Sep  3 01:01:52 2014
@@ -15,6 +15,8 @@
 
 // default unique_ptr ctor should require default Deleter ctor
 
+// USE_VERIFY
+
 #include <memory>
 
 class Deleter





More information about the cfe-commits mailing list