aboutsummaryrefslogtreecommitdiff
path: root/testsuite/busybox.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/busybox.tests')
-rwxr-xr-xtestsuite/busybox.tests46
1 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/busybox.tests b/testsuite/busybox.tests
new file mode 100755
index 000000000..26536c656
--- /dev/null
+++ b/testsuite/busybox.tests
@@ -0,0 +1,46 @@
1#!/bin/sh
2
3# Tests for busybox applet itself.
4# Copyright 2005 by Rob Landley <rob@landley.net>
5# Licensed under GPL v2, see file LICENSE for details.
6
7. testing.sh
8
9HELPDUMP=`busybox`
10
11# We need to test under calling the binary under other names.
12
13
14testing "busybox --help busybox" "busybox --help busybox" "$HELPDUMP\n\n" "" ""
15
16ln -s `which busybox` busybox-suffix
17for i in busybox ./busybox-suffix
18do
19 # The gratuitous "\n"s are due to a shell idiosyncrasy:
20 # environment variables seem to strip trailing whitespace.
21
22 testing "" "$i" "$HELPDUMP\n\n" "" ""
23
24 testing "$i unknown" "$i unknown 2>&1" \
25 "unknown: applet not found\n" "" ""
26
27 testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" ""
28
29 optional CAT
30 testing "" "$i cat" "moo" "" "moo"
31 testing "$i --help cat" "$i --help cat 2>&1 | grep prints" \
32 "Concatenates FILE(s) and prints them to stdout.\n" "" ""
33 optional ""
34
35 testing "$i --help unknown" "$i --help unknown 2>&1" \
36 "unknown: applet not found\n" "" ""
37done
38rm busybox-suffix
39
40ln -s `which busybox` unknown
41
42testing "busybox as unknown name" "./unknown 2>&1" \
43 "unknown: applet not found\n" "" ""
44rm unknown
45
46exit $FAILCOUNT