mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
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
This commit is contained in:
@ -125,6 +125,10 @@ EXECUTION OPTIONS
|
|||||||
*--error-exitcode* argument for valgrind is used so that valgrind failures will
|
*--error-exitcode* argument for valgrind is used so that valgrind failures will
|
||||||
cause the program to exit with a non-zero status.
|
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-arg**\ =\ *ARG*
|
||||||
@ -133,6 +137,15 @@ EXECUTION OPTIONS
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**--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**
|
**--time-tests**
|
||||||
|
|
||||||
Track the wall time individual tests take to execute and includes the results in
|
Track the wall time individual tests take to execute and includes the results in
|
||||||
|
@ -23,4 +23,4 @@ config.test_exec_root = None
|
|||||||
config.target_triple = 'foo'
|
config.target_triple = 'foo'
|
||||||
|
|
||||||
# available_features: Used by ShTest and TclTest formats for REQUIRES checks.
|
# available_features: Used by ShTest and TclTest formats for REQUIRES checks.
|
||||||
config.available_features = ['some-feature-name']
|
config.available_features.add('some-feature-name')
|
||||||
|
4
utils/lit/lit/ExampleTests/vg-fail.c
Normal file
4
utils/lit/lit/ExampleTests/vg-fail.c
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// This test should XPASS, when run without valgrind.
|
||||||
|
|
||||||
|
// RUN: true
|
||||||
|
// XFAIL: valgrind
|
@ -42,14 +42,11 @@ class LitConfig:
|
|||||||
self.numWarnings = 0
|
self.numWarnings = 0
|
||||||
|
|
||||||
self.valgrindArgs = []
|
self.valgrindArgs = []
|
||||||
self.valgrindTriple = ""
|
|
||||||
if self.useValgrind:
|
if self.useValgrind:
|
||||||
self.valgrindTriple = "-vg"
|
|
||||||
self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
|
self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
|
||||||
'--tool=memcheck', '--trace-children=yes',
|
'--tool=memcheck', '--trace-children=yes',
|
||||||
'--error-exitcode=123']
|
'--error-exitcode=123']
|
||||||
if self.valgrindLeakCheck:
|
if self.valgrindLeakCheck:
|
||||||
self.valgrindTriple += "_leak"
|
|
||||||
self.valgrindArgs.append('--leak-check=full')
|
self.valgrindArgs.append('--leak-check=full')
|
||||||
else:
|
else:
|
||||||
# The default is 'summary'.
|
# The default is 'summary'.
|
||||||
|
@ -29,6 +29,13 @@ class TestingConfig:
|
|||||||
'TMP' : os.environ.get('TMP',''),
|
'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,
|
config = TestingConfig(parent,
|
||||||
name = '<unnamed>',
|
name = '<unnamed>',
|
||||||
suffixes = set(),
|
suffixes = set(),
|
||||||
@ -40,7 +47,7 @@ class TestingConfig:
|
|||||||
test_exec_root = None,
|
test_exec_root = None,
|
||||||
test_source_root = None,
|
test_source_root = None,
|
||||||
excludes = [],
|
excludes = [],
|
||||||
available_features = [])
|
available_features = available_features)
|
||||||
|
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
# FIXME: Improve detection and error reporting of errors in the
|
# FIXME: Improve detection and error reporting of errors in the
|
||||||
|
Reference in New Issue
Block a user