Skip to content

Commit

Permalink
tests: skip tests which apply to disabled compression
Browse files Browse the repository at this point in the history
If configured --without-libzstd, for example, the diskdump-basic-zstd
test will return an ERROR code, causing "make check" to fail. Even using
XFAIL_TESTS will not resolve the error, because the return code is
ERROR, not FAIL.

Instead, conditionally include the tests based on whether we are
compiling with each compression format. This way, we don't test
unsupported features.

Signed-off-by: Stephen Brennan <[email protected]>
  • Loading branch information
brenns10 authored and ptesarik committed Jan 22, 2024
1 parent 713927d commit d529a57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions m4/compression.m4
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ AC_SUBST([$2][_REQUIRES])
AC_SUBST([$2][_CFLAGS])
AC_SUBST([$2][_LIBS])
AC_SUBST([$2][_PC_LIBS])
AM_CONDITIONAL(HAVE_$2, test "x$have_$1" = xyes)
])
17 changes: 13 additions & 4 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ test_scripts = \
diskdump-empty-s390x \
diskdump-empty-x86_64 \
diskdump-basic-raw \
diskdump-basic-zlib \
diskdump-basic-lzo \
diskdump-basic-snappy \
diskdump-basic-zstd \
diskdump-flat-raw \
diskdump-multiread \
diskdump-excluded \
Expand Down Expand Up @@ -331,6 +327,19 @@ test_scripts = \
xlat-xen-x86_64-4.6-bigmem \
zero-size

if HAVE_ZSTD
test_scripts += diskdump-basic-zstd
endif
if HAVE_ZLIB
test_scripts += diskdump-basic-zlib
endif
if HAVE_LZO
test_scripts += diskdump-basic-lzo
endif
if HAVE_SNAPPY
test_scripts += diskdump-basic-snappy
endif

dist_check_DATA = \
addrmap-single-begin.expect \
addrmap-single-middle.expect \
Expand Down

0 comments on commit d529a57

Please sign in to comment.