Skip to content

Commit

Permalink
Merge pull request #5811 from grom72/test-force-enable-none
Browse files Browse the repository at this point in the history
test: 'none' value of force-enable to optimize PMem workflow
  • Loading branch information
janekmi authored Aug 18, 2023
2 parents 65ca2e9 + 379c3f9 commit 0de65de
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pmem_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
script: ['sh', 'py']
config: ['drd', 'pmemcheck', 'memcheck', 'helgrind']
config: ['none', 'drd', 'pmemcheck', 'memcheck', 'helgrind']
build: ['debug', 'nondebug']
os: [[self-hosted, rhel],[self-hosted, opensuse]]

Expand Down
4 changes: 2 additions & 2 deletions src/test/README
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ RUNTESTS.sh takes options to limit what it runs. The usage is:
RUNTESTS.sh [ -hnv ] [ -b build-type ] [ -t test-type ] [ -f fs-type ]
[ -o timeout ] [ -s test-file ] [ -k skip-dir ]
[[ -m memcheck ] [-p pmemcheck ] [ -e helgrind ] [ -d drd ] ||
[ --force-enable memcheck|pmemcheck|helgrind|drd ]] [ -c ]
[ --force-enable memcheck|pmemcheck|helgrind|drd|none ]] [ -c ]
[tests...]

Build types are: debug, nondebug, static_debug, static_nondebug, all (default)
Expand All @@ -77,7 +77,7 @@ RUNTESTS.sh takes options to limit what it runs. The usage is:
Default value is 3 minutes.
Test file is: a name of the particular test script (test case).
all (default), TEST0, TEST1, ...
Memcheck, helgrind, drd and pmemcheck modes are:
memcheck, helgrind, drd and pmemcheck modes are:
auto (default, enable/disable based on test requirements),
force-enable (enable when test does not require given valgrind tool,
but obey test's explicit tool disable)
Expand Down
7 changes: 5 additions & 2 deletions src/test/RUNTESTS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ usage()
Usage: $0 [ -hnv ] [ -b build-type ] [ -t test-type ] [ -f fs-type ]
[ -o timeout ] [ -s test-file | -u test-sequence ] [-k skip-dir ]
[[ -m memcheck ] [-p pmemcheck ] [ -e helgrind ] [ -d drd ] ||
[ --force-enable memcheck|pmemcheck|helgrind|drd ]]
[ --force-enable memcheck|pmemcheck|helgrind|drd|none ]]
[ -c ] [tests...]
-h print this help message
-n dry run
Expand Down Expand Up @@ -53,7 +53,7 @@ Usage: $0 [ -hnv ] [ -b build-type ] [ -t test-type ] [ -f fs-type ]
drd: auto (default, enable/disable based on test requirements),
force-enable (enable when test does not require drd, but
obey test's explicit drd disable)
--force-enable memcheck|pmemcheck|helgrind|drd
--force-enable memcheck|pmemcheck|helgrind|drd|none
allows to force the use of a specific valgrind tool,
but skips tests where the tool is explicitly disabled
Can not be use with -m, -p, -e, -d.
Expand Down Expand Up @@ -455,6 +455,9 @@ do

case "$receivetype"
in
none)
forcechecktype=$receivetype
;;
memcheck|pmemcheck|helgrind|drd)
;;
*)
Expand Down
9 changes: 6 additions & 3 deletions src/test/unittest/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def convert_internal(key, base):
convert_internal('test_type', test_types._TestType)
convert_internal('granularity', granularity.Granularity)

if config['force_enable'] is not None:
if config['force_enable'] is not None and config['force_enable'] != 'none':
config['force_enable'] = next(
t for t in vg.TOOLS
if t.name.lower() == config['force_enable'])
Expand Down Expand Up @@ -288,7 +288,10 @@ def ctx_choices(cls):
tracers.add_argument('--cgdb', dest='tracer', action='store_const',
const='cgdb --args', help='run cgdb as a tracer')

fe_choices = [str(t) for t in vg.TOOLS]
parser.add_argument('--force-enable', choices=fe_choices, default=None)
fe_choices = [str(t) for t in vg.TOOLS] + ['none']
parser.add_argument('--force-enable', choices=fe_choices, default=None,
help='allows to force the use of a specific '
'valgrind tool, but skips tests where the tool is '
'explicitly disabled')

return parser
4 changes: 4 additions & 0 deletions src/test/unittest/unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,10 @@ function valgrind_version_no_check() {
# valgrind package is installed
#
function require_valgrind() {
if [ "$FORCE_CHECK_TYPE" == "none" ]; then
msg "$UNITTEST_NAME: SKIP valgrind test"
exit 0
fi
# bc is used inside valgrind_version_no_check
require_command bc
require_no_asan
Expand Down

0 comments on commit 0de65de

Please sign in to comment.