gnu: lz4: Update to 1.7.5.
[jackhill/guix/guix.git] / gnu / packages / patches / lz4-fix-test-failures.patch
1 These two patches fix some bugs in lz4's test suite:
2
3 https://github.com/lz4/lz4/issues/308
4
5 Patches copied from upstream source repository:
6
7 https://github.com/lz4/lz4/commit/b89cac7b2e92b792af98bb0a12e4d14684d07629
8 https://github.com/lz4/lz4/commit/0dfb0b9dad2a8cb7cc347d2139bf9b84de7e1481
9
10 From b89cac7b2e92b792af98bb0a12e4d14684d07629 Mon Sep 17 00:00:00 2001
11 From: Eric Siegerman <pub08-git@davor.org>
12 Date: Tue, 14 Feb 2017 14:17:06 -0500
13 Subject: [PATCH] Don't use "foo && false || true"
14
15 Replace it with either:
16 test ! -f $FILE_THAT_SHOULD_NOT_EXIST
17 or:
18 ! $COMMAND_THAT_SHOULD_FAIL
19
20 as appropriate.
21 ---
22 tests/Makefile | 38 +++++++++++++++++++-------------------
23 1 file changed, 19 insertions(+), 19 deletions(-)
24
25 diff --git a/tests/Makefile b/tests/Makefile
26 index 77e6ae7..ebab278 100644
27 --- a/tests/Makefile
28 +++ b/tests/Makefile
29 @@ -236,17 +236,17 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat
30 ./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
31 @echo "hello world" > tmp
32 $(LZ4) --rm -f tmp
33 - ls -ls tmp && false || true # must fail (--rm)
34 - ls -ls tmp.lz4
35 - $(PRGDIR)/lz4cat tmp.lz4 # must display hello world
36 - ls -ls tmp.lz4
37 + test ! -f tmp # must fail (--rm)
38 + test -f tmp.lz4
39 + $(PRGDIR)/lz4cat tmp.lz4 # must display hello world
40 + test -f tmp.lz4
41 $(PRGDIR)/unlz4 --rm tmp.lz4
42 - ls -ls tmp
43 - ls -ls tmp.lz4 && false || true # must fail (--rm)
44 - ls -ls tmp.lz4.lz4 && false || true # must fail (unlz4)
45 - $(PRGDIR)/lz4cat tmp # pass-through mode
46 - ls -ls tmp
47 - ls -ls tmp.lz4 && false || true # must fail (lz4cat)
48 + test -f tmp
49 + test ! -f tmp.lz4 # must fail (--rm)
50 + test ! -f tmp.lz4.lz4 # must fail (unlz4)
51 + $(PRGDIR)/lz4cat tmp # pass-through mode
52 + test -f tmp
53 + test ! -f tmp.lz4 # must fail (lz4cat)
54 $(LZ4) tmp # creates tmp.lz4
55 $(PRGDIR)/lz4cat < tmp.lz4 > tmp3 # checks lz4cat works with stdin (#285)
56 $(DIFF) -q tmp tmp3
57 @@ -262,22 +262,22 @@ test-lz4-hugefile: lz4 datagen
58
59 test-lz4-testmode: lz4 datagen
60 @echo "\n ---- bench mode ----"
61 - $(LZ4) -bi1
62 + $(LZ4) -bi1
63 @echo "\n ---- test mode ----"
64 - ./datagen | $(LZ4) -t && false || true
65 - ./datagen | $(LZ4) -tf && false || true
66 + ! ./datagen | $(LZ4) -t
67 + ! ./datagen | $(LZ4) -tf
68 @echo "\n ---- pass-through mode ----"
69 - ./datagen | $(LZ4) -d > $(VOID) && false || true
70 - ./datagen | $(LZ4) -df > $(VOID)
71 + ! ./datagen | $(LZ4) -d > $(VOID)
72 + ./datagen | $(LZ4) -df > $(VOID)
73 @echo "Hello World !" > tmp1
74 $(LZ4) -dcf tmp1
75 @echo "from underground..." > tmp2
76 $(LZ4) -dcfm tmp1 tmp2
77 @echo "\n ---- test cli ----"
78 - $(LZ4) file-does-not-exist && false || true
79 - $(LZ4) -f file-does-not-exist && false || true
80 - $(LZ4) -fm file1-dne file2-dne && false || true
81 - $(LZ4) -fm file1-dne file2-dne && false || true
82 + ! $(LZ4) file-does-not-exist
83 + ! $(LZ4) -f file-does-not-exist
84 + ! $(LZ4) -fm file1-dne file2-dne
85 + ! $(LZ4) -fm file1-dne file2-dne
86
87 test-lz4-opt-parser: lz4 datagen
88 @echo "\n ---- test opt-parser ----"
89 --
90 2.12.2
91
92 From 0dfb0b9dad2a8cb7cc347d2139bf9b84de7e1481 Mon Sep 17 00:00:00 2001
93 From: "Dmitry V. Levin" <ldv@altlinux.org>
94 Date: Sun, 5 Mar 2017 23:20:10 +0000
95 Subject: [PATCH] Fix test-lz4-basic
96
97 When no output filename is specified and stdout is not a terminal,
98 lz4 doesn't attempt to guess an output filename and uses stdout for
99 output.
100
101 This change fixes test-lz4-basic when run without a terminal
102 by specifying output filenames.
103 ---
104 tests/Makefile | 6 +++---
105 1 file changed, 3 insertions(+), 3 deletions(-)
106
107 diff --git a/tests/Makefile b/tests/Makefile
108 index ebab278..d68c700 100644
109 --- a/tests/Makefile
110 +++ b/tests/Makefile
111 @@ -235,19 +235,19 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat
112 ./datagen -g33M | $(LZ4) --no-frame-crc | $(LZ4) -t
113 ./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
114 @echo "hello world" > tmp
115 - $(LZ4) --rm -f tmp
116 + $(LZ4) --rm -f tmp tmp.lz4
117 test ! -f tmp # must fail (--rm)
118 test -f tmp.lz4
119 $(PRGDIR)/lz4cat tmp.lz4 # must display hello world
120 test -f tmp.lz4
121 - $(PRGDIR)/unlz4 --rm tmp.lz4
122 + $(PRGDIR)/unlz4 --rm tmp.lz4 tmp
123 test -f tmp
124 test ! -f tmp.lz4 # must fail (--rm)
125 test ! -f tmp.lz4.lz4 # must fail (unlz4)
126 $(PRGDIR)/lz4cat tmp # pass-through mode
127 test -f tmp
128 test ! -f tmp.lz4 # must fail (lz4cat)
129 - $(LZ4) tmp # creates tmp.lz4
130 + $(LZ4) tmp tmp.lz4 # creates tmp.lz4
131 $(PRGDIR)/lz4cat < tmp.lz4 > tmp3 # checks lz4cat works with stdin (#285)
132 $(DIFF) -q tmp tmp3
133 $(PRGDIR)/lz4cat < tmp > tmp2 # checks lz4cat works with stdin (#285)
134 --
135 2.12.2
136