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.
9 # verify the applet order is correct in applets.h, otherwise applets won't
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
23 # We need to test under calling the binary under other names.
26 testing "busybox --help busybox" "busybox --help busybox" "$HELPDUMP\n\n" "" ""
28 ln -s `which busybox` busybox-suffix
29 for i in busybox ./busybox-suffix
31 # The gratuitous "\n"s are due to a shell idiosyncrasy:
32 # environment variables seem to strip trailing whitespace.
34 testing "" "$i" "$HELPDUMP\n\n" "" ""
36 testing "$i unknown" "$i unknown 2>&1" \
37 "unknown: applet not found\n" "" ""
39 testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" ""
42 testing "" "$i cat" "moo" "" "moo"
43 testing "$i --help cat" "$i --help cat 2>&1 | grep prints" \
44 "Concatenates FILE(s) and prints them to stdout.\n" "" ""
47 testing "$i --help unknown" "$i --help unknown 2>&1" \
48 "unknown: applet not found\n" "" ""
52 ln -s `which busybox` unknown
54 testing "busybox as unknown name" "./unknown 2>&1" \
55 "unknown: applet not found\n" "" ""