llvm.org GIT mirror llvm / f854597
lit: Add 'valgrind' and 'valgrind-leaks' features when valgrind is used. - These can be used with the XFAIL options. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166303 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 7 years ago
5 changed file(s) with 26 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
124124 *--error-exitcode* argument for valgrind is used so that valgrind failures will
125125 cause the program to exit with a non-zero status.
126126
127 When this option is enabled, **lit** will also automatically provide a
128 "valgrind" feature that can be used to conditionally disable (or expect failure
129 in) certain tests.
130
127131
128132
129133 **--vg-arg**\ =\ *ARG*
130134
131135 When *--vg* is used, specify an additional argument to pass to valgrind itself.
136
137
138
139 **--vg-leak**
140
141 When *--vg* is used, enable memory leak checks. When this option is enabled,
142 **lit** will also automatically provide a "valgrind-leaks" feature that can be
143 used to conditionally disable (or expect failure in) certain tests.
144
132145
133146
134147
2222 config.target_triple = 'foo'
2323
2424 # available_features: Used by ShTest and TclTest formats for REQUIRES checks.
25 config.available_features = ['some-feature-name']
25 config.available_features.add('some-feature-name')
0 // This test should XPASS, when run without valgrind.
1
2 // RUN: true
3 // XFAIL: valgrind
4141 self.numWarnings = 0
4242
4343 self.valgrindArgs = []
44 self.valgrindTriple = ""
4544 if self.useValgrind:
46 self.valgrindTriple = "-vg"
4745 self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
4846 '--tool=memcheck', '--trace-children=yes',
4947 '--error-exitcode=123']
5048 if self.valgrindLeakCheck:
51 self.valgrindTriple += "_leak"
5249 self.valgrindArgs.append('--leak-check=full')
5350 else:
5451 # The default is 'summary'.
2828 'TMP' : os.environ.get('TMP',''),
2929 })
3030
31 # Set the default available features based on the LitConfig.
32 available_features = []
33 if litConfig.useValgrind:
34 available_features.append('valgrind')
35 if litConfig.valgrindLeakCheck:
36 available_features.append('valgrind-leaks')
37
3138 config = TestingConfig(parent,
3239 name = '',
3340 suffixes = set(),
3946 test_exec_root = None,
4047 test_source_root = None,
4148 excludes = [],
42 available_features = [])
49 available_features = available_features)
4350
4451 if os.path.exists(path):
4552 # FIXME: Improve detection and error reporting of errors in the