source: MondoRescue/branches/3.3/mindi-busybox/testsuite/busybox.tests@ 3621

Last change on this file since 3621 was 3621, checked in by Bruno Cornec, 7 years ago

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/sh
2
3# Tests for busybox applet itself.
4# Copyright 2005 by Rob Landley <rob@landley.net>
5# Licensed under GPLv2, see file LICENSE in this source tree.
6
7. ./testing.sh
8
9ln -s `which busybox` unknown
10
11testing "busybox as unknown name" "./unknown 2>&1" \
12 "unknown: applet not found\n" "" ""
13rm unknown
14
15# We need busybox --help to be enabled for the rest of tests
16test x"$CONFIG_BUSYBOX" = x"y" \
17|| { echo "SKIPPED: busybox --help"; exit 0; }
18
19HELPDUMP=`true | busybox 2>&1 | cat`
20
21# We need to test under calling the binary under other names.
22
23optional FEATURE_VERBOSE_USAGE
24testing "busybox --help busybox" "true | busybox --help busybox 2>&1 | cat" "$HELPDUMP\n\n" "" ""
25SKIP=
26
27ln -s `which busybox` busybox-suffix
28for i in busybox ./busybox-suffix
29do
30 # The gratuitous "\n"s are due to a shell idiosyncrasy:
31 # environment variables seem to strip trailing whitespace.
32
33 testing "" "$i" "$HELPDUMP\n\n" "" ""
34
35 testing "$i unknown" "$i unknown 2>&1" \
36 "unknown: applet not found\n" "" ""
37
38 testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" ""
39
40 optional FEATURE_VERBOSE_USAGE CAT
41 testing "" "$i cat" "moo" "" "moo"
42 testing "$i --help cat" "$i --help cat 2>&1 | grep print" \
43 "Concatenate FILEs and print them to stdout\n" "" ""
44 SKIP=
45
46 testing "$i --help unknown" "$i --help unknown 2>&1" \
47 "unknown: applet not found\n" "" ""
48done
49rm busybox-suffix
50
51exit $FAILCOUNT
Note: See TracBrowser for help on using the repository browser.