diff options
| author | Rob Landley <rob@landley.net> | 2006-06-15 20:07:57 +0000 |
|---|---|---|
| committer | Rob Landley <rob@landley.net> | 2006-06-15 20:07:57 +0000 |
| commit | cd82c3c041139c03fceea7e76fb48280b00d73da (patch) | |
| tree | 403a08d61e570a94e887007685e8ee1bca0150d5 | |
| parent | 04b7ef967bfb5a4b97600b27d60eb42e0346d8ab (diff) | |
| download | busybox-w32-cd82c3c041139c03fceea7e76fb48280b00d73da.tar.gz busybox-w32-cd82c3c041139c03fceea7e76fb48280b00d73da.tar.bz2 busybox-w32-cd82c3c041139c03fceea7e76fb48280b00d73da.zip | |
Don't do workarounds for broken shells. Busybox is about to grow a shell that
we can run our own testsuite under, and I want it to handle the full range of
strange and peverted behavior you can find in real world shell scripts.
In the meantime, I'll just say #!/bin/bash in places that may care.
| -rwxr-xr-x | testsuite/testing.sh | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/testsuite/testing.sh b/testsuite/testing.sh index 7897c1622..8bd23d803 100755 --- a/testsuite/testing.sh +++ b/testsuite/testing.sh | |||
| @@ -37,7 +37,7 @@ export SKIP= | |||
| 37 | 37 | ||
| 38 | # Helper functions | 38 | # Helper functions |
| 39 | 39 | ||
| 40 | optional () | 40 | optional() |
| 41 | { | 41 | { |
| 42 | option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"` | 42 | option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"` |
| 43 | # Not set? | 43 | # Not set? |
| @@ -55,7 +55,6 @@ testing () | |||
| 55 | { | 55 | { |
| 56 | NAME="$1" | 56 | NAME="$1" |
| 57 | [ -z "$1" ] && NAME=$2 | 57 | [ -z "$1" ] && NAME=$2 |
| 58 | ret=0 | ||
| 59 | 58 | ||
| 60 | if [ $# -ne 5 ] | 59 | if [ $# -ne 5 ] |
| 61 | then | 60 | then |
| @@ -77,15 +76,12 @@ testing () | |||
| 77 | echo -ne "$5" | eval "$2" > actual | 76 | echo -ne "$5" | eval "$2" > actual |
| 78 | RETVAL=$? | 77 | RETVAL=$? |
| 79 | 78 | ||
| 80 | cmp expected actual > /dev/null || ret=$? | 79 | cmp expected actual > /dev/null |
| 81 | if [ $ret -ne 0 ] | 80 | if [ $? -ne 0 ] |
| 82 | then | 81 | then |
| 83 | FAILCOUNT=$[$FAILCOUNT+1] | 82 | FAILCOUNT=$[$FAILCOUNT+1] |
| 84 | echo "FAIL: $NAME" | 83 | echo "FAIL: $NAME" |
| 85 | if [ -n "$VERBOSE" ] | 84 | [ -n "$VERBOSE" ] && diff -u expected actual |
| 86 | then | ||
| 87 | diff -u expected actual || /bin/true | ||
| 88 | fi | ||
| 89 | else | 85 | else |
| 90 | echo "PASS: $NAME" | 86 | echo "PASS: $NAME" |
| 91 | fi | 87 | fi |
| @@ -101,7 +97,7 @@ testing () | |||
| 101 | # the file is assumed to already be there and only its library dependencies | 97 | # the file is assumed to already be there and only its library dependencies |
| 102 | # are copied. | 98 | # are copied. |
| 103 | 99 | ||
| 104 | mkchroot () | 100 | function mkchroot |
| 105 | { | 101 | { |
| 106 | [ $# -lt 2 ] && return | 102 | [ $# -lt 2 ] && return |
| 107 | 103 | ||
| @@ -130,7 +126,7 @@ mkchroot () | |||
| 130 | # Needed commands listed on command line | 126 | # Needed commands listed on command line |
| 131 | # Script fed to stdin. | 127 | # Script fed to stdin. |
| 132 | 128 | ||
| 133 | dochroot () | 129 | function dochroot |
| 134 | { | 130 | { |
| 135 | mkdir tmpdir4chroot | 131 | mkdir tmpdir4chroot |
| 136 | mount -t ramfs tmpdir4chroot tmpdir4chroot | 132 | mount -t ramfs tmpdir4chroot tmpdir4chroot |
