diff options
author | Ron Yorston <rmy@pobox.com> | 2018-02-09 09:01:19 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-12 15:32:02 +0100 |
commit | ecaec1dbecda67e5b740694878c0780eb4347d26 (patch) | |
tree | 950dac8ecc0efd67affc76d330883c6d0c1bc065 | |
parent | 7f441403cbcb6cce864bae66e1fc7bb626954e04 (diff) | |
download | busybox-w32-ecaec1dbecda67e5b740694878c0780eb4347d26.tar.gz busybox-w32-ecaec1dbecda67e5b740694878c0780eb4347d26.tar.bz2 busybox-w32-ecaec1dbecda67e5b740694878c0780eb4347d26.zip |
testsuite: update busybox and bzcat tests
Test scripts that use CONFIG_* variables need to source .config.
Since this wasn't being done for busybox many tests were skipped.
As a result new failures due to changes in help output were missed.
Also remove some unnecessary echos in the bzcat script.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-x | testsuite/busybox.tests | 16 | ||||
-rwxr-xr-x | testsuite/bzcat.tests | 10 |
2 files changed, 12 insertions, 14 deletions
diff --git a/testsuite/busybox.tests b/testsuite/busybox.tests index 545cad5c0..beb17440c 100755 --- a/testsuite/busybox.tests +++ b/testsuite/busybox.tests | |||
@@ -5,6 +5,7 @@ | |||
5 | # Licensed under GPLv2, see file LICENSE in this source tree. | 5 | # Licensed under GPLv2, see file LICENSE in this source tree. |
6 | 6 | ||
7 | . ./testing.sh | 7 | . ./testing.sh |
8 | test -f "$bindir/.config" && . "$bindir/.config" | ||
8 | 9 | ||
9 | ln -s `which busybox` unknown | 10 | ln -s `which busybox` unknown |
10 | 11 | ||
@@ -18,29 +19,24 @@ test x"$CONFIG_BUSYBOX" = x"y" \ | |||
18 | 19 | ||
19 | HELPDUMP=`true | busybox 2>&1 | cat` | 20 | HELPDUMP=`true | busybox 2>&1 | cat` |
20 | 21 | ||
21 | # We need to test under calling the binary under other names. | ||
22 | |||
23 | optional FEATURE_VERBOSE_USAGE | 22 | optional FEATURE_VERBOSE_USAGE |
24 | testing "busybox --help busybox" "true | busybox --help busybox 2>&1 | cat" "$HELPDUMP\n\n" "" "" | 23 | testing "busybox --help busybox" "true | busybox --help busybox 2>&1 | cat" "$HELPDUMP\n" "" "" |
25 | SKIP= | 24 | SKIP= |
26 | 25 | ||
27 | ln -s `which busybox` busybox-suffix | 26 | ln -s `which busybox` busybox-suffix |
28 | for i in busybox ./busybox-suffix | 27 | for i in busybox ./busybox-suffix |
29 | do | 28 | do |
30 | # The gratuitous "\n"s are due to a shell idiosyncrasy: | 29 | testing "$i" "$i 2>&1 | cat" "$HELPDUMP\n" "" "" |
31 | # environment variables seem to strip trailing whitespace. | ||
32 | |||
33 | testing "" "$i" "$HELPDUMP\n\n" "" "" | ||
34 | 30 | ||
35 | testing "$i unknown" "$i unknown 2>&1" \ | 31 | testing "$i unknown" "$i unknown 2>&1" \ |
36 | "unknown: applet not found\n" "" "" | 32 | "unknown: applet not found\n" "" "" |
37 | 33 | ||
38 | testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" "" | 34 | testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n" "" "" |
39 | 35 | ||
40 | optional FEATURE_VERBOSE_USAGE CAT | 36 | optional FEATURE_VERBOSE_USAGE CAT |
41 | testing "" "$i cat" "moo" "" "moo" | 37 | testing "" "$i cat" "moo" "" "moo" |
42 | testing "$i --help cat" "$i --help cat 2>&1 | grep print" \ | 38 | testing "$i --help cat" "$i --help cat 2>&1 | grep Print" \ |
43 | "Concatenate FILEs and print them to stdout\n" "" "" | 39 | "Print FILEs to stdout\n" "" "" |
44 | SKIP= | 40 | SKIP= |
45 | 41 | ||
46 | testing "$i --help unknown" "$i --help unknown 2>&1" \ | 42 | testing "$i --help unknown" "$i --help unknown 2>&1" \ |
diff --git a/testsuite/bzcat.tests b/testsuite/bzcat.tests index 0ae530dc7..32c1c5d7f 100755 --- a/testsuite/bzcat.tests +++ b/testsuite/bzcat.tests | |||
@@ -1,5 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | test -f "$bindir/.config" && . "$bindir/.config" | ||
4 | |||
3 | FAILCOUNT=0 | 5 | FAILCOUNT=0 |
4 | 6 | ||
5 | bb="busybox " | 7 | bb="busybox " |
@@ -73,7 +75,7 @@ done | |||
73 | 75 | ||
74 | # "input" file is bzipped file with "a\n" data | 76 | # "input" file is bzipped file with "a\n" data |
75 | testing "bzcat can print many files" \ | 77 | testing "bzcat can print many files" \ |
76 | "$ECHO -ne '$hexdump' | bzcat input input; echo \$?" \ | 78 | "bzcat input input; echo \$?" \ |
77 | "\ | 79 | "\ |
78 | a | 80 | a |
79 | a | 81 | a |
@@ -86,7 +88,7 @@ a | |||
86 | 88 | ||
87 | # "input" file is bzipped zero byte file | 89 | # "input" file is bzipped zero byte file |
88 | testing "bzcat can handle compressed zero-length bzip2 files" \ | 90 | testing "bzcat can handle compressed zero-length bzip2 files" \ |
89 | "$ECHO -ne '$hexdump' | bzcat input input; echo \$?" \ | 91 | "bzcat input input; echo \$?" \ |
90 | "0\n" \ | 92 | "0\n" \ |
91 | "\x42\x5a\x68\x39\x17\x72\x45\x38\x50\x90\x00\x00\x00\x00" "" | 93 | "\x42\x5a\x68\x39\x17\x72\x45\x38\x50\x90\x00\x00\x00\x00" "" |
92 | 94 | ||
@@ -95,7 +97,7 @@ testing "bzcat can handle compressed zero-length bzip2 files" \ | |||
95 | # "input" file is compressed (.Z) file with "a\n" data | 97 | # "input" file is compressed (.Z) file with "a\n" data |
96 | test x"$CONFIG_UNCOMPRESS" = x"y" && \ | 98 | test x"$CONFIG_UNCOMPRESS" = x"y" && \ |
97 | testing "zcat can print many files" \ | 99 | testing "zcat can print many files" \ |
98 | "$ECHO -ne '$hexdump' | zcat input input; echo \$?" \ | 100 | "zcat input input; echo \$?" \ |
99 | "\ | 101 | "\ |
100 | a | 102 | a |
101 | a | 103 | a |
@@ -107,7 +109,7 @@ a | |||
107 | # "input" file is compressed (.Z) zero byte file | 109 | # "input" file is compressed (.Z) zero byte file |
108 | test x"$CONFIG_UNCOMPRESS" = x"y" && \ | 110 | test x"$CONFIG_UNCOMPRESS" = x"y" && \ |
109 | testing "zcat can handle compressed zero-length (.Z) files" \ | 111 | testing "zcat can handle compressed zero-length (.Z) files" \ |
110 | "$ECHO -ne '$hexdump' | zcat input input; echo \$?" \ | 112 | "zcat input input; echo \$?" \ |
111 | "0\n" \ | 113 | "0\n" \ |
112 | "\x1f\x9d\x90\x00" "" | 114 | "\x1f\x9d\x90\x00" "" |
113 | 115 | ||