aboutsummaryrefslogtreecommitdiffstats
path: root/testing/pixz/0001-use-posix-shell-for-tests.patch
blob: bdeefab273f1224d1c4ea41c066bd8a975456bda (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
From e33f9a54541915639b1a777ae0aa742b0105ed52 Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <clandmeter@alpinelinux.org>
Date: Mon, 19 Feb 2018 18:47:49 +0000
Subject: [PATCH] use posix shell for tests

---
 test/Makefile.am                  | 2 +-
 test/compress-file-permissions.sh | 4 ++--
 test/cppcheck-src.sh              | 2 +-
 test/single-file-round-trip.sh    | 4 ++--
 test/xz-compatibility-c-option.sh | 6 +++---
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 6aebb6f..3ed2f87 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,4 +7,4 @@ TESTS = \
 EXTRA_DIST = $(TESTS)
 
 TEST_EXTENSIONS = .sh
-SH_LOG_COMPILER = bash
+SH_LOG_COMPILER = sh
diff --git a/test/compress-file-permissions.sh b/test/compress-file-permissions.sh
index 28572c2..6218d90 100755
--- a/test/compress-file-permissions.sh
+++ b/test/compress-file-permissions.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 PIXZ=../src/pixz
 
@@ -10,4 +10,4 @@ echo foo > $INPUT
 
 $PIXZ $INPUT
 
-[[ $(stat -c "%a" $INPUT.xz) = 600 ]]
+[ "$(stat -c "%a" $INPUT.xz)" = 600 ]
diff --git a/test/cppcheck-src.sh b/test/cppcheck-src.sh
index 5c77b15..1b5954c 100755
--- a/test/cppcheck-src.sh
+++ b/test/cppcheck-src.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 if which cppcheck &> /dev/null ; then
   cppcheck --error-exitcode=1 $srcdir/../src
diff --git a/test/single-file-round-trip.sh b/test/single-file-round-trip.sh
index 5784138..c9bfa9a 100755
--- a/test/single-file-round-trip.sh
+++ b/test/single-file-round-trip.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 PIXZ=../src/pixz
 
@@ -11,4 +11,4 @@ trap "rm -f $COMPRESSED $UNCOMPRESSED" EXIT
 $PIXZ $INPUT $COMPRESSED
 $PIXZ -d $COMPRESSED $UNCOMPRESSED
 
-[[ $(cat $INPUT | md5sum) = $(cat $UNCOMPRESSED | md5sum) ]] || exit 1
+[ "$(cat $INPUT | md5sum)" = "$(cat $UNCOMPRESSED | md5sum)" ] || exit 1
diff --git a/test/xz-compatibility-c-option.sh b/test/xz-compatibility-c-option.sh
index 327d7f6..64556d2 100755
--- a/test/xz-compatibility-c-option.sh
+++ b/test/xz-compatibility-c-option.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 
 PIXZ=../src/pixz
 
-[[ "foo" = $(echo foo | xz    | xz    -dc) ]] || exit 1
-[[ "bar" = $(echo bar | $PIXZ | $PIXZ -dc) ]] || exit 1
+[ "foo" = "$(echo foo | xz    | xz    -dc)" ] || exit 1
+[ "bar" = "$(echo bar | $PIXZ | $PIXZ -dc)" ] || exit 1
-- 
2.16.1