diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-10-19 20:12:00 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-10-19 20:12:00 +0000 |
commit | 519a349c8a91873edc3b68a522f7338559cbe0a0 (patch) | |
tree | d5b85357b1e19b0e97c34b4afaa8e1fe1a5a6cd7 /llvm/utils/lit | |
parent | 37c4275a92e8b39e761b693002eaf4fc1ec8f158 (diff) | |
download | bcm5719-llvm-519a349c8a91873edc3b68a522f7338559cbe0a0.tar.gz bcm5719-llvm-519a349c8a91873edc3b68a522f7338559cbe0a0.zip |
lit: Add 'valgrind' and 'valgrind-leaks' features when valgrind is used.
- These can be used with the XFAIL options.
llvm-svn: 166303
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r-- | llvm/utils/lit/lit/ExampleTests/lit.cfg | 2 | ||||
-rw-r--r-- | llvm/utils/lit/lit/ExampleTests/vg-fail.c | 4 | ||||
-rw-r--r-- | llvm/utils/lit/lit/LitConfig.py | 3 | ||||
-rw-r--r-- | llvm/utils/lit/lit/TestingConfig.py | 9 |
4 files changed, 13 insertions, 5 deletions
diff --git a/llvm/utils/lit/lit/ExampleTests/lit.cfg b/llvm/utils/lit/lit/ExampleTests/lit.cfg index 20ee37dcef2..2629918d9f6 100644 --- a/llvm/utils/lit/lit/ExampleTests/lit.cfg +++ b/llvm/utils/lit/lit/ExampleTests/lit.cfg @@ -23,4 +23,4 @@ config.test_exec_root = None config.target_triple = 'foo' # available_features: Used by ShTest and TclTest formats for REQUIRES checks. -config.available_features = ['some-feature-name'] +config.available_features.add('some-feature-name') diff --git a/llvm/utils/lit/lit/ExampleTests/vg-fail.c b/llvm/utils/lit/lit/ExampleTests/vg-fail.c new file mode 100644 index 00000000000..e3339ff91aa --- /dev/null +++ b/llvm/utils/lit/lit/ExampleTests/vg-fail.c @@ -0,0 +1,4 @@ +// This test should XPASS, when run without valgrind. + +// RUN: true +// XFAIL: valgrind diff --git a/llvm/utils/lit/lit/LitConfig.py b/llvm/utils/lit/lit/LitConfig.py index c71c0ccdea9..0a359a3db8e 100644 --- a/llvm/utils/lit/lit/LitConfig.py +++ b/llvm/utils/lit/lit/LitConfig.py @@ -42,14 +42,11 @@ class LitConfig: self.numWarnings = 0 self.valgrindArgs = [] - self.valgrindTriple = "" if self.useValgrind: - self.valgrindTriple = "-vg" self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no', '--tool=memcheck', '--trace-children=yes', '--error-exitcode=123'] if self.valgrindLeakCheck: - self.valgrindTriple += "_leak" self.valgrindArgs.append('--leak-check=full') else: # The default is 'summary'. diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py index 1465fec6f66..192e140538f 100644 --- a/llvm/utils/lit/lit/TestingConfig.py +++ b/llvm/utils/lit/lit/TestingConfig.py @@ -29,6 +29,13 @@ class TestingConfig: 'TMP' : os.environ.get('TMP',''), }) + # Set the default available features based on the LitConfig. + available_features = [] + if litConfig.useValgrind: + available_features.append('valgrind') + if litConfig.valgrindLeakCheck: + available_features.append('valgrind-leaks') + config = TestingConfig(parent, name = '<unnamed>', suffixes = set(), @@ -40,7 +47,7 @@ class TestingConfig: test_exec_root = None, test_source_root = None, excludes = [], - available_features = []) + available_features = available_features) if os.path.exists(path): # FIXME: Improve detection and error reporting of errors in the |