Skip to content

Commit

Permalink
Merge pull request #5789 from grom72/test-sh-disable
Browse files Browse the repository at this point in the history
Use dedicated DISABLED() function to disable tests in bash test framework
  • Loading branch information
janekmi authored Jul 13, 2023
2 parents f0815d4 + dec6620 commit 16f472e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/test/obj_sync/DISABLE_TEST2 → src/test/obj_sync/TEST2
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# src/test/obj_sync/TEST2 -- unit test for PMEM-resident locks
#

# XXX disable the test for 'helgrind'
# until https://github.com/pmem/pmdk/issues/5646 is fixed
# by adding the prefix DISABLE_ to the script name.

. ../unittest/unittest.sh

# XXX disable the test for 'helgrind'
# until https://github.com/pmem/pmdk/issues/5646 is fixed.
DISABLED

require_test_type medium

require_fs_type none
Expand Down
8 changes: 4 additions & 4 deletions src/test/obj_sync/DISABLE_TEST5 → src/test/obj_sync/TEST5
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# src/test/obj_sync/TEST5 -- unit test for PMEM-resident locks
#

# XXX disable the test for 'drd'
# until https://github.com/pmem/pmdk/issues/5646 is fixed
# by adding the prefix DISABLE_ to the script name.

. ../unittest/unittest.sh

# XXX disable the test for 'drd'
# until https://github.com/pmem/pmdk/issues/5646 is fixed.
DISABLED

require_test_type medium

require_fs_type none
Expand Down
8 changes: 4 additions & 4 deletions src/test/obj_sync/DISABLE_TEST6 → src/test/obj_sync/TEST6
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# src/test/obj_sync/TEST6 -- unit test for PMEM-resident locks
#

# XXX disable the test for 'helgrind'
# until https://github.com/pmem/pmdk/issues/5646 is fixed
# by adding the prefix DISABLE_ to the script name.

. ../unittest/unittest.sh

# XXX disable the test for 'helgrind'
# until https://github.com/pmem/pmdk/issues/5646 is fixed.
DISABLED

require_test_type medium

require_fs_type none
Expand Down
16 changes: 16 additions & 0 deletions src/test/unittest/unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ function interactive_green() {
interactive_color 2 "$@"
}

function interactive_yellow() {
interactive_color 3 "$@"
}

function verbose_msg() {
if [ "$UNITTEST_LOG_LEVEL" -ge 2 ]; then
echo "$*"
Expand Down Expand Up @@ -1902,6 +1906,18 @@ function pass() {
fi
}

#
# DISABLED -- print a message that the test has been intentionally disabled
# and abandon test execution
#
function DISABLED() {
msg=$(interactive_yellow STDOUT "DISABLED")
if [ "$UNITTEST_LOG_LEVEL" -ge 1 ]; then
echo -e "$UNITTEST_NAME: $msg ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM)"
fi
exit 0
}

# Length of pool file's signature
SIG_LEN=8

Expand Down

0 comments on commit 16f472e

Please sign in to comment.