summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-09-03 06:01:52 +0000
committerJustin Bogner <mail@justinbogner.com>2014-09-03 06:01:52 +0000
commit2cfd1fed21db5fe9d5538ca88ec63f77b4c9c385 (patch)
tree5f3c1f0a962309d67e55a7a6935d01fcbb04805d /libcxx/test
parentca988749433e018cbd88c479d809e5c691ccec80 (diff)
downloadbcm5719-llvm-2cfd1fed21db5fe9d5538ca88ec63f77b4c9c385.tar.gz
bcm5719-llvm-2cfd1fed21db5fe9d5538ca88ec63f77b4c9c385.zip
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. llvm-svn: 217017
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/lit.cfg9
-rw-r--r--libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp2
2 files changed, 8 insertions, 3 deletions
diff --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg
index 023ac4a1189..37f6357b914 100644
--- a/libcxx/test/lit.cfg
+++ b/libcxx/test/lit.cfg
@@ -67,6 +67,7 @@ class LibcxxTestFormat(lit.formats.FileBasedTest):
# 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.FileBasedTest):
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.FileBasedTest):
', '.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.FileBasedTest):
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)
diff --git a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
index 140b203b673..95350a6fc0e 100644
--- a/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
+++ b/libcxx/test/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
@@ -15,6 +15,8 @@
// default unique_ptr ctor should require default Deleter ctor
+// USE_VERIFY
+
#include <memory>
class Deleter
OpenPOWER on IntegriCloud