aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/lz4-fix-test-failures.patch
blob: d38357d40292b6855f175a101a4950d16905738d (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
These two patches fix some bugs in lz4's test suite:

https://github.com/lz4/lz4/issues/308

Patches copied from upstream source repository:

https://github.com/lz4/lz4/commit/b89cac7b2e92b792af98bb0a12e4d14684d07629
https://github.com/lz4/lz4/commit/0dfb0b9dad2a8cb7cc347d2139bf9b84de7e1481

From b89cac7b2e92b792af98bb0a12e4d14684d07629 Mon Sep 17 00:00:00 2001
From: Eric Siegerman <pub08-git@davor.org>
Date: Tue, 14 Feb 2017 14:17:06 -0500
Subject: [PATCH] Don't use "foo && false || true"

Replace it with either:
    test ! -f $FILE_THAT_SHOULD_NOT_EXIST
or:
    ! $COMMAND_THAT_SHOULD_FAIL

as appropriate.
---
 tests/Makefile | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 77e6ae7..ebab278 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -236,17 +236,17 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat
 	./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
 	@echo "hello world" > tmp
 	$(LZ4) --rm -f tmp
-	ls -ls tmp         && false || true   # must fail (--rm)
-	ls -ls tmp.lz4
-	$(PRGDIR)/lz4cat tmp.lz4              # must display hello world
-	ls -ls tmp.lz4
+	test ! -f tmp                      # must fail (--rm)
+	test   -f tmp.lz4
+	$(PRGDIR)/lz4cat tmp.lz4           # must display hello world
+	test   -f tmp.lz4
 	$(PRGDIR)/unlz4 --rm tmp.lz4
-	ls -ls tmp
-	ls -ls tmp.lz4     && false || true   # must fail (--rm)
-	ls -ls tmp.lz4.lz4 && false || true   # must fail (unlz4)
-	$(PRGDIR)/lz4cat tmp                  # pass-through mode
-	ls -ls tmp
-	ls -ls tmp.lz4     && false || true   # must fail (lz4cat)
+	test   -f tmp
+	test ! -f tmp.lz4                  # must fail (--rm)
+	test ! -f tmp.lz4.lz4              # must fail (unlz4)
+	$(PRGDIR)/lz4cat tmp               # pass-through mode
+	test   -f tmp
+	test ! -f tmp.lz4                  # must fail (lz4cat)
 	$(LZ4) tmp                         # creates tmp.lz4
 	$(PRGDIR)/lz4cat < tmp.lz4 > tmp3  # checks lz4cat works with stdin (#285)
 	$(DIFF) -q tmp tmp3
@@ -262,22 +262,22 @@ test-lz4-hugefile: lz4 datagen
 
 test-lz4-testmode: lz4 datagen
 	@echo "\n ---- bench mode ----"
-	$(LZ4) -bi1
+	  $(LZ4) -bi1
 	@echo "\n ---- test mode ----"
-	./datagen | $(LZ4) -t             && false || true
-	./datagen | $(LZ4) -tf            && false || true
+	! ./datagen | $(LZ4) -t
+	! ./datagen | $(LZ4) -tf
 	@echo "\n ---- pass-through mode ----"
-	./datagen | $(LZ4) -d  > $(VOID)  && false || true
-	./datagen | $(LZ4) -df > $(VOID)
+	! ./datagen | $(LZ4) -d  > $(VOID)
+	  ./datagen | $(LZ4) -df > $(VOID)
 	@echo "Hello World !" > tmp1
 	$(LZ4) -dcf tmp1
 	@echo "from underground..." > tmp2
 	$(LZ4) -dcfm tmp1 tmp2
 	@echo "\n ---- test cli ----"
-	$(LZ4)     file-does-not-exist    && false || true
-	$(LZ4) -f  file-does-not-exist    && false || true
-	$(LZ4) -fm file1-dne file2-dne    && false || true
-	$(LZ4) -fm file1-dne file2-dne    && false || true
+	! $(LZ4)     file-does-not-exist
+	! $(LZ4) -f  file-does-not-exist
+	! $(LZ4) -fm file1-dne file2-dne
+	! $(LZ4) -fm file1-dne file2-dne
 
 test-lz4-opt-parser: lz4 datagen
 	@echo "\n ---- test opt-parser ----"
-- 
2.12.2

From 0dfb0b9dad2a8cb7cc347d2139bf9b84de7e1481 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Sun, 5 Mar 2017 23:20:10 +0000
Subject: [PATCH] Fix test-lz4-basic

When no output filename is specified and stdout is not a terminal,
lz4 doesn't attempt to guess an output filename and uses stdout for
output.

This change fixes test-lz4-basic when run without a terminal
by specifying output filenames.
---
 tests/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index ebab278..d68c700 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -235,19 +235,19 @@ test-lz4-basic: lz4 datagen unlz4 lz4cat
 	./datagen -g33M   | $(LZ4) --no-frame-crc | $(LZ4) -t
 	./datagen -g256MB | $(LZ4) -vqB4D | $(LZ4) -t
 	@echo "hello world" > tmp
-	$(LZ4) --rm -f tmp
+	$(LZ4) --rm -f tmp tmp.lz4
 	test ! -f tmp                      # must fail (--rm)
 	test   -f tmp.lz4
 	$(PRGDIR)/lz4cat tmp.lz4           # must display hello world
 	test   -f tmp.lz4
-	$(PRGDIR)/unlz4 --rm tmp.lz4
+	$(PRGDIR)/unlz4 --rm tmp.lz4 tmp
 	test   -f tmp
 	test ! -f tmp.lz4                  # must fail (--rm)
 	test ! -f tmp.lz4.lz4              # must fail (unlz4)
 	$(PRGDIR)/lz4cat tmp               # pass-through mode
 	test   -f tmp
 	test ! -f tmp.lz4                  # must fail (lz4cat)
-	$(LZ4) tmp                         # creates tmp.lz4
+	$(LZ4) tmp tmp.lz4                 # creates tmp.lz4
 	$(PRGDIR)/lz4cat < tmp.lz4 > tmp3  # checks lz4cat works with stdin (#285)
 	$(DIFF) -q tmp tmp3
 	$(PRGDIR)/lz4cat < tmp > tmp2      # checks lz4cat works with stdin (#285)
-- 
2.12.2