diff options
-rwxr-xr-x | testsuite/busybox.tests | 19 | ||||
-rwxr-xr-x | testsuite/runtest | 18 |
2 files changed, 31 insertions, 6 deletions
diff --git a/testsuite/busybox.tests b/testsuite/busybox.tests index beb17440c..a671fa082 100755 --- a/testsuite/busybox.tests +++ b/testsuite/busybox.tests | |||
@@ -7,11 +7,22 @@ | |||
7 | . ./testing.sh | 7 | . ./testing.sh |
8 | test -f "$bindir/.config" && . "$bindir/.config" | 8 | test -f "$bindir/.config" && . "$bindir/.config" |
9 | 9 | ||
10 | ln -s `which busybox` unknown | 10 | if [ -f $bindir/busybox.exe ]; then |
11 | # Copy rather than link busybox.exe: we can only make hard | ||
12 | # links which can't be deleted because Windows sees the | ||
13 | # executable as running. | ||
14 | suffix=".exe" | ||
15 | lncmd="cp" | ||
16 | else | ||
17 | suffix="" | ||
18 | lncmd="ln -s" | ||
19 | fi | ||
20 | |||
21 | $lncmd `which busybox` unknown$suffix | ||
11 | 22 | ||
12 | testing "busybox as unknown name" "./unknown 2>&1" \ | 23 | testing "busybox as unknown name" "./unknown 2>&1" \ |
13 | "unknown: applet not found\n" "" "" | 24 | "unknown: applet not found\n" "" "" |
14 | rm unknown | 25 | rm unknown$suffix |
15 | 26 | ||
16 | # We need busybox --help to be enabled for the rest of tests | 27 | # We need busybox --help to be enabled for the rest of tests |
17 | test x"$CONFIG_BUSYBOX" = x"y" \ | 28 | test x"$CONFIG_BUSYBOX" = x"y" \ |
@@ -23,7 +34,7 @@ optional FEATURE_VERBOSE_USAGE | |||
23 | testing "busybox --help busybox" "true | busybox --help busybox 2>&1 | cat" "$HELPDUMP\n" "" "" | 34 | testing "busybox --help busybox" "true | busybox --help busybox 2>&1 | cat" "$HELPDUMP\n" "" "" |
24 | SKIP= | 35 | SKIP= |
25 | 36 | ||
26 | ln -s `which busybox` busybox-suffix | 37 | $lncmd `which busybox` busybox-suffix$suffix |
27 | for i in busybox ./busybox-suffix | 38 | for i in busybox ./busybox-suffix |
28 | do | 39 | do |
29 | testing "$i" "$i 2>&1 | cat" "$HELPDUMP\n" "" "" | 40 | testing "$i" "$i 2>&1 | cat" "$HELPDUMP\n" "" "" |
@@ -42,6 +53,6 @@ do | |||
42 | testing "$i --help unknown" "$i --help unknown 2>&1" \ | 53 | testing "$i --help unknown" "$i --help unknown 2>&1" \ |
43 | "unknown: applet not found\n" "" "" | 54 | "unknown: applet not found\n" "" "" |
44 | done | 55 | done |
45 | rm busybox-suffix | 56 | rm busybox-suffix$suffix |
46 | 57 | ||
47 | exit $FAILCOUNT | 58 | exit $FAILCOUNT |
diff --git a/testsuite/runtest b/testsuite/runtest index 44f9cd1a1..9f9e8d3bd 100755 --- a/testsuite/runtest +++ b/testsuite/runtest | |||
@@ -99,6 +99,20 @@ if [ x"$1" = x"-v" ]; then | |||
99 | shift | 99 | shift |
100 | fi | 100 | fi |
101 | 101 | ||
102 | if [ -f $bindir/busybox.exe ]; then | ||
103 | suffix=".exe" | ||
104 | lnflag="" | ||
105 | |||
106 | # Some tests require /bin/echo and /bin/true exist | ||
107 | test ! -d /tmp && mkdir /tmp | ||
108 | test ! -d /bin && mkdir /bin | ||
109 | test ! -f /bin/echo.exe && cp "$bindir/busybox.exe" /bin/echo.exe | ||
110 | test ! -f /bin/true.exe && cp "$bindir/busybox.exe" /bin/true.exe | ||
111 | else | ||
112 | suffix="" | ||
113 | lnflag="-s" | ||
114 | fi | ||
115 | |||
102 | implemented=$( | 116 | implemented=$( |
103 | printf "busybox " # always implemented | 117 | printf "busybox " # always implemented |
104 | "$bindir/busybox" 2>&1 | | 118 | "$bindir/busybox" 2>&1 | |
@@ -128,7 +142,7 @@ for i in $implemented; do | |||
128 | # Note: if $LINKSDIR/applet exists, we do not overwrite it. | 142 | # Note: if $LINKSDIR/applet exists, we do not overwrite it. |
129 | # Useful if one wants to run tests against a standard utility, | 143 | # Useful if one wants to run tests against a standard utility, |
130 | # not an applet. | 144 | # not an applet. |
131 | ln -s "$bindir/busybox" "$LINKSDIR/$i" 2>/dev/null | 145 | ln $lnflag "$bindir/busybox$suffix" "$LINKSDIR/$i$suffix" 2>/dev/null |
132 | done | 146 | done |
133 | 147 | ||
134 | # Set up option flags so tests can be selective. | 148 | # Set up option flags so tests can be selective. |
@@ -146,7 +160,7 @@ for applet in $applets; do | |||
146 | 160 | ||
147 | # Is this a new-style test? | 161 | # Is this a new-style test? |
148 | if [ -f "$applet.tests" ]; then | 162 | if [ -f "$applet.tests" ]; then |
149 | if [ ! -e "$LINKSDIR/$applet" ]; then | 163 | if [ ! -e "$LINKSDIR/$applet$suffix" ]; then |
150 | # (avoiding bash'ism "${applet:0:4}") | 164 | # (avoiding bash'ism "${applet:0:4}") |
151 | if ! echo "$applet" | grep "^all_" >/dev/null; then | 165 | if ! echo "$applet" | grep "^all_" >/dev/null; then |
152 | echo "SKIPPED: $applet (not built)" | 166 | echo "SKIPPED: $applet (not built)" |