summaryrefslogtreecommitdiff
path: root/testsuite/busybox.tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-03-16 15:20:45 +0000
committerRob Landley <rob@landley.net>2006-03-16 15:20:45 +0000
commit4bb1b04fd1d7d6fe410e1af14816d11da456aac5 (patch)
tree601a54598057fc267def41fce1acecfb8e5a2845 /testsuite/busybox.tests
parentea9a471acd94f604f360ea16df5896e795361ac7 (diff)
downloadbusybox-w32-4bb1b04fd1d7d6fe410e1af14816d11da456aac5.tar.gz
busybox-w32-4bb1b04fd1d7d6fe410e1af14816d11da456aac5.tar.bz2
busybox-w32-4bb1b04fd1d7d6fe410e1af14816d11da456aac5.zip
Redo test suite to be able to test more than one command at a time. Eliminate
$COMMAND environment variable, instead put full command line (including command to run) in second argument. Modify $PATH to have test versions of commands at start of path. (Also more infrastructure for testing as root, work in progress...)
Diffstat (limited to 'testsuite/busybox.tests')
-rwxr-xr-xtestsuite/busybox.tests56
1 files changed, 27 insertions, 29 deletions
diff --git a/testsuite/busybox.tests b/testsuite/busybox.tests
index f31f38f06..30d96f946 100755
--- a/testsuite/busybox.tests
+++ b/testsuite/busybox.tests
@@ -4,57 +4,55 @@
4# Copyright 2005 by Rob Landley <rob@landley.net> 4# Copyright 2005 by Rob Landley <rob@landley.net>
5# Licensed under GPL v2, see file LICENSE for details. 5# Licensed under GPL v2, see file LICENSE for details.
6 6
7if [ ${#COMMAND} -eq 0 ]; then COMMAND=busybox; fi
8. testing.sh 7. testing.sh
9 8
10HELPDUMP=`$COMMAND` 9# verify the applet order is correct in applets.h, otherwise applets won't
10# be called properly.
11#sed -n -e '/^USE_^\tAPPLET/{s:.*(::;s:,.*::;s:"::g;p}'
12# ../include/applets.h > applet.order1
13#LC_ALL=C sort applet.order.current > applet.order.correct
14#diff -u applet.order.current applet.order.correct
15#FAILCOUNT=$[$FAILCOUNT+$?]
16#rm -f applet.order.current applet.order.correct
17
18
19
20
21HELPDUMP=`busybox`
11 22
12# We need to test under calling the binary under other names. 23# We need to test under calling the binary under other names.
13 24
14ln -s `which "$COMMAND"` busybox-suffix
15ln -s `which "$COMMAND"` unknown
16 25
17testing "busybox --help busybox" "--help busybox" "$HELPDUMP\n\n" "" "" 26testing "busybox --help busybox" "busybox --help busybox" "$HELPDUMP\n\n" "" ""
18 27
19for i in busybox busybox-suffix 28ln -s `which busybox` busybox-suffix
29for i in busybox ./busybox-suffix
20do 30do
21 # The gratuitous "\n"s are due to a shell idiosyncrasy: 31 # The gratuitous "\n"s are due to a shell idiosyncrasy:
22 # environment variables seem to strip trailing whitespace. 32 # environment variables seem to strip trailing whitespace.
23 33
24 testing "$i" "" "$HELPDUMP\n\n" "" "" 34 testing "" "$i" "$HELPDUMP\n\n" "" ""
25 35
26 testing "$i unknown" "unknown 2>&1" \ 36 testing "$i unknown" "$i unknown 2>&1" \
27 "unknown: applet not found\n" "" "" 37 "unknown: applet not found\n" "" ""
28 38
29 testing "$i --help" "--help 2>&1" "$HELPDUMP\n\n" "" "" 39 testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" ""
30 40
31 optional CAT 41 optional CAT
32 testing "$i cat" "cat" "moo" "" "moo" 42 testing "" "$i cat" "moo" "" "moo"
33 testing "$i --help cat" "--help cat 2>&1 | grep prints" \ 43 testing "$i --help cat" "$i --help cat 2>&1 | grep prints" \
34 "Concatenates FILE(s) and prints them to stdout.\n" "" "" 44 "Concatenates FILE(s) and prints them to stdout.\n" "" ""
35 optional "" 45 optional ""
36 46
37 testing "$i --help unknown" "--help unknown 2>&1" \ 47 testing "$i --help unknown" "$i --help unknown 2>&1" \
38 "unknown: applet not found\n" "" "" 48 "unknown: applet not found\n" "" ""
39
40 COMMAND=./busybox-suffix
41done 49done
50rm busybox-suffix
42 51
43COMMAND="./unknown" 52ln -s `which busybox` unknown
44testing "busybox as unknown name" "2>&1" "unknown: applet not found\n" "" ""
45
46rm -f busybox-suffix unknown
47
48
49# verify the applet order is correct in applets.h
50# otherwise applets wont be called properly
51sed -n \
52 -e '/^\tAPPLET/{s:.*(::;s:,.*::;s:"::g;p}' \
53 ../include/applets.h > applet.order.current
54LC_ALL=C sort applet.order.current > applet.order.correct
55diff -u applet.order.current applet.order.correct
56FAILCOUNT=$[$FAILCOUNT+$?]
57rm -f applet.order.current applet.order.correct
58 53
54testing "busybox as unknown name" "./unknown 2>&1" \
55 "unknown: applet not found\n" "" ""
56rm unknown
59 57
60exit $FAILCOUNT 58exit $FAILCOUNT