aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-02-09 09:52:52 +0000
committerDenys Vlasenko <vda.linux@googlemail.com>2018-04-09 20:35:48 +0200
commit1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7 (patch)
treea41b553f1cd5506d94a1c60951cdafbe9f6f6917 /testsuite
parent9db344a0f4ed5f6f893940b734215d05e48320e9 (diff)
downloadbusybox-w32-1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7.tar.gz
busybox-w32-1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7.tar.bz2
busybox-w32-1f27fa98380c134cd0f5f03b4cd3dfe2e83c09b7.zip
testsuite: allow tests to work in paths containing spaces
Tweak some tests so they work when the path to the test directory or $HOME contains spaces. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/grep.tests2
-rwxr-xr-xtestsuite/printf.tests2
-rw-r--r--testsuite/pwd/pwd-prints-working-directory2
-rwxr-xr-xtestsuite/sum.tests6
-rw-r--r--testsuite/xargs/xargs-works6
5 files changed, 10 insertions, 8 deletions
diff --git a/testsuite/grep.tests b/testsuite/grep.tests
index d0b0d2767..e57889790 100755
--- a/testsuite/grep.tests
+++ b/testsuite/grep.tests
@@ -15,7 +15,7 @@
15 15
16testing "grep (exit with error)" "grep nonexistent 2> /dev/null ; echo \$?" \ 16testing "grep (exit with error)" "grep nonexistent 2> /dev/null ; echo \$?" \
17 "1\n" "" "" 17 "1\n" "" ""
18testing "grep (exit success)" "grep grep $0 > /dev/null 2>&1 ; echo \$?" "0\n" \ 18testing "grep (exit success)" "grep grep '$0' > /dev/null 2>&1 ; echo \$?" "0\n" \
19 "" "" 19 "" ""
20# Test various data sources and destinations 20# Test various data sources and destinations
21 21
diff --git a/testsuite/printf.tests b/testsuite/printf.tests
index 9a3c87473..963ded94b 100755
--- a/testsuite/printf.tests
+++ b/testsuite/printf.tests
@@ -20,7 +20,7 @@ testing "printf produces no further output 2" \
20 "" "" 20 "" ""
21 21
22testing "printf repeatedly uses pattern for each argv" \ 22testing "printf repeatedly uses pattern for each argv" \
23 "${bb}printf '%s\n' foo \$HOME" \ 23 "${bb}printf '%s\n' foo '$HOME'" \
24 "foo\n$HOME\n" \ 24 "foo\n$HOME\n" \
25 "" "" 25 "" ""
26 26
diff --git a/testsuite/pwd/pwd-prints-working-directory b/testsuite/pwd/pwd-prints-working-directory
index 971adb5a6..fc7fea7c9 100644
--- a/testsuite/pwd/pwd-prints-working-directory
+++ b/testsuite/pwd/pwd-prints-working-directory
@@ -1,4 +1,4 @@
1# shell's $PWD may leave symlinks unresolved. 1# shell's $PWD may leave symlinks unresolved.
2# "pwd" may be a built-in and have the same problem. 2# "pwd" may be a built-in and have the same problem.
3# External pwd _can't_ have that problem (current dir on Unix is physical). 3# External pwd _can't_ have that problem (current dir on Unix is physical).
4test $(`which pwd`) = $(busybox pwd) 4test "$(`which pwd`)" = "$(busybox pwd)"
diff --git a/testsuite/sum.tests b/testsuite/sum.tests
index b9f4cbfa8..e6379349f 100755
--- a/testsuite/sum.tests
+++ b/testsuite/sum.tests
@@ -13,12 +13,12 @@
13# test can create a file "actual" instead of writing to stdout 13# test can create a file "actual" instead of writing to stdout
14 14
15testing "sum -r file doesn't print file's name" \ 15testing "sum -r file doesn't print file's name" \
16 "sum -r $0 | grep -c $0 && echo wrongly_printed_filename || echo yes" \ 16 "sum -r '$0' | grep -c '$0' && echo wrongly_printed_filename || echo yes" \
17 "0\nyes\n" "" "" 17 "0\nyes\n" "" ""
18testing "sum -r file file does print both names" \ 18testing "sum -r file file does print both names" \
19 "sum -r $0 $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \ 19 "sum -r '$0' '$0' | grep -c '$0' && echo yes || echo wrongly_omitted_filename" \
20 "2\nyes\n" "" "" 20 "2\nyes\n" "" ""
21testing "sum -s file does print file's name" \ 21testing "sum -s file does print file's name" \
22 "sum -s $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \ 22 "sum -s '$0' | grep -c '$0' && echo yes || echo wrongly_omitted_filename" \
23 "1\nyes\n" "" "" 23 "1\nyes\n" "" ""
24exit $FAILCOUNT 24exit $FAILCOUNT
diff --git a/testsuite/xargs/xargs-works b/testsuite/xargs/xargs-works
index c95869e89..a4bba7630 100644
--- a/testsuite/xargs/xargs-works
+++ b/testsuite/xargs/xargs-works
@@ -1,4 +1,6 @@
1# FEATURE: CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
2
1[ -n "$d" ] || d=.. 3[ -n "$d" ] || d=..
2find "$d" -name \*works -type f | xargs md5sum > logfile.gnu 4find "$d" -name \*works -type f -print0 | xargs -0 md5sum > logfile.gnu
3find "$d" -name \*works -type f | busybox xargs md5sum > logfile.bb 5find "$d" -name \*works -type f -print0 | busybox xargs -0 md5sum > logfile.bb
4diff -u logfile.gnu logfile.bb 6diff -u logfile.gnu logfile.bb