mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
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.
This commit is contained in:
parent
04b7ef967b
commit
cd82c3c041
@ -37,7 +37,7 @@ export SKIP=
|
|||||||
|
|
||||||
# Helper functions
|
# Helper functions
|
||||||
|
|
||||||
optional ()
|
optional()
|
||||||
{
|
{
|
||||||
option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
|
option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
|
||||||
# Not set?
|
# Not set?
|
||||||
@ -55,7 +55,6 @@ testing ()
|
|||||||
{
|
{
|
||||||
NAME="$1"
|
NAME="$1"
|
||||||
[ -z "$1" ] && NAME=$2
|
[ -z "$1" ] && NAME=$2
|
||||||
ret=0
|
|
||||||
|
|
||||||
if [ $# -ne 5 ]
|
if [ $# -ne 5 ]
|
||||||
then
|
then
|
||||||
@ -77,15 +76,12 @@ testing ()
|
|||||||
echo -ne "$5" | eval "$2" > actual
|
echo -ne "$5" | eval "$2" > actual
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
|
|
||||||
cmp expected actual > /dev/null || ret=$?
|
cmp expected actual > /dev/null
|
||||||
if [ $ret -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
FAILCOUNT=$[$FAILCOUNT+1]
|
FAILCOUNT=$[$FAILCOUNT+1]
|
||||||
echo "FAIL: $NAME"
|
echo "FAIL: $NAME"
|
||||||
if [ -n "$VERBOSE" ]
|
[ -n "$VERBOSE" ] && diff -u expected actual
|
||||||
then
|
|
||||||
diff -u expected actual || /bin/true
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "PASS: $NAME"
|
echo "PASS: $NAME"
|
||||||
fi
|
fi
|
||||||
@ -101,7 +97,7 @@ testing ()
|
|||||||
# the file is assumed to already be there and only its library dependencies
|
# the file is assumed to already be there and only its library dependencies
|
||||||
# are copied.
|
# are copied.
|
||||||
|
|
||||||
mkchroot ()
|
function mkchroot
|
||||||
{
|
{
|
||||||
[ $# -lt 2 ] && return
|
[ $# -lt 2 ] && return
|
||||||
|
|
||||||
@ -130,7 +126,7 @@ mkchroot ()
|
|||||||
# Needed commands listed on command line
|
# Needed commands listed on command line
|
||||||
# Script fed to stdin.
|
# Script fed to stdin.
|
||||||
|
|
||||||
dochroot ()
|
function dochroot
|
||||||
{
|
{
|
||||||
mkdir tmpdir4chroot
|
mkdir tmpdir4chroot
|
||||||
mount -t ramfs tmpdir4chroot tmpdir4chroot
|
mount -t ramfs tmpdir4chroot tmpdir4chroot
|
||||||
|
Loading…
Reference in New Issue
Block a user