*--error-exitcode* argument for valgrind is used so that valgrind failures will
cause the program to exit with a non-zero status.
+ When this option is enabled, **lit** will also automatically provide a
+ "valgrind" feature that can be used to conditionally disable (or expect failure
+ in) certain tests.
+
**--vg-arg**\ =\ *ARG*
+**--vg-leak**
+
+ When *--vg* is used, enable memory leak checks. When this option is enabled,
+ **lit** will also automatically provide a "valgrind-leaks" feature that can be
+ used to conditionally disable (or expect failure in) certain tests.
+
+
+
+
**--time-tests**
Track the wall time individual tests take to execute and includes the results in
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')
--- /dev/null
+// This test should XPASS, when run without valgrind.
+
+// RUN: true
+// XFAIL: valgrind
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'.
'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(),
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