summaryrefslogtreecommitdiff
path: root/dev-libs/libkdumpfile/files/libkdumpfile-0.5.4-disabled-compression-tests.patch
blob: 5748a27e1e817c26572c5b3cb06e133ae8aa36c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
https://github.com/ptesarik/libkdumpfile/commit/d529a573ab2cdbda501309e377007812e6de3351

From d529a573ab2cdbda501309e377007812e6de3351 Mon Sep 17 00:00:00 2001
From: Stephen Brennan <stephen.s.brennan@oracle.com>
Date: Fri, 19 Jan 2024 11:52:24 -0800
Subject: [PATCH] tests: skip tests which apply to disabled compression

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 <stephen.s.brennan@oracle.com>
---
 m4/compression.m4 |  1 +
 tests/Makefile.am | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/m4/compression.m4 b/m4/compression.m4
index 6755ef13..8cb7ce2d 100644
--- a/m4/compression.m4
+++ b/m4/compression.m4
@@ -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)
 ])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0c03b20b..8ac90b39 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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 \
@@ -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 \