#!/bin/sh

# Usage:
# runtest [applet1] [applet2...]

# Helper for helpers. Oh my...
test x"$ECHO" != x"" || {
	ECHO="echo"
	test x"`echo -ne`" = x"" || {
		# Compile and use a replacement 'echo' which understands -e -n
		ECHO="$PWD/echo-ne"
		test -x "$ECHO" || {
			gcc -Os -o "$ECHO" ../scripts/echo.c || exit 1
		}
	}
	export ECHO
}

# Run one old-style test.
# Tests are stored in applet/testcase shell scripts.
# They are run using "sh -x -e applet/testcase".
# Option -e will make testcase stop on the first failed command.
run_applet_testcase()
{
	local applet="$1"
	local testcase="$2"

	local status=0
	local uc_applet=$(echo "$applet" | tr a-z A-Z)
	local testname="$testcase"

	testname="${testname##*/}" # take basename
	if grep "^# CONFIG_$uc_applet is not set$" "$bindir/.config" >/dev/null; then
		echo "UNTESTED: $testname"
		return 0
	fi

	if grep "^# FEATURE: " "$testcase" >/dev/null; then
		local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase")

		if grep "^# $feature is not set$" "$bindir/.config" >/dev/null; then
			echo "UNTESTED: $testname"
			return 0
		fi
	fi

	rm -rf ".tmpdir.$applet"
	mkdir -p ".tmpdir.$applet"
	cd ".tmpdir.$applet" || return 1

#	echo "Running testcase $testcase"
	d="$tsdir" \
		sh -x -e "$testcase" >"$testname.stdout.txt" 2>&1 || status=$?
	if [ $status -ne 0 ]; then
		echo "FAIL: $testname"
		if [ x"$VERBOSE" != x ]; then
			cat "$testname.stdout.txt"
		fi
	else
		echo "PASS: $testname"
	fi

	cd ..
	rm -rf ".tmpdir.$applet"

	return $status
}

# Run all old-style tests for given applet
run_oldstyle_applet_tests()
{
	local applet="$1"
	local status=0

	for testcase in "$tsdir/$applet"/*; do
		# switch on basename of $testcase
		case "${testcase##*/}" in
			.*)     continue ;;    # .svn, .git etc
			*~)     continue ;;    # backup files
			"CVS")  continue ;;
			\#*)    continue ;;    # CVS merge residues
			*.mine) continue ;;    # svn-produced junk
			*.r[0-9]*) continue ;; # svn-produced junk
		esac
		run_applet_testcase "$applet" "$testcase" || status=1
	done
	return $status
}



lcwd=$(pwd)
[ x"$tsdir" != x ] || tsdir="$lcwd"
[ x"$bindir" != x ] || bindir="${lcwd%/*}" # one directory up from $lcwd
PATH="$bindir:$PATH"

if [ x"$VERBOSE" = x ]; then
	export VERBOSE=
fi

if [ x"$1" = x"-v" ]; then
	export VERBOSE=1
	shift
fi

implemented=$(
	"$bindir/busybox" 2>&1 |
	while read line; do
		if [ x"$line" = x"Currently defined functions:" ]; then
			xargs | sed 's/,//g'
			break
		fi
	done
	)

applets="$implemented"
if [ $# -ne 0 ]; then
	applets="$@"
fi

# Populate a directory with links to all busybox applets

# Note: if $LINKSDIR/applet exists, we do not overwrite it.
# Useful if one wants to run tests against a standard utility, not an applet.
LINKSDIR="$bindir/runtest-tempdir-links"
#rm -rf "$LINKSDIR" 2>/dev/null
mkdir "$LINKSDIR" 2>/dev/null
for i in $implemented; do
	ln -s "$bindir/busybox" "$LINKSDIR/$i" 2>/dev/null
done

# Set up option flags so tests can be selective.
export OPTIONFLAGS=:$(
	sed -nr 's/^CONFIG_//p' "$bindir/.config" |
	sed 's/=.*//' | xargs | sed 's/ /:/g'
	)

status=0
for applet in $applets; do
	# Any old-style tests for this applet?
	if [ -d "$tsdir/$applet" ]; then
		run_oldstyle_applet_tests "$applet" || status=1
	fi

	# Is this a new-style test?
	if [ -f "$applet.tests" ]; then
		if [ ! -e "$LINKSDIR/$applet" ]; then
			# (avoiding bash'ism "${applet:0:4}")
			if ! echo "$applet" | grep "^all_" >/dev/null; then
				echo "SKIPPED: $applet (not built)"
				continue
			fi
		fi
#		echo "Running test $tsdir/$applet.tests"
		PATH="$LINKSDIR:$tsdir:$bindir:$PATH" \
			"$tsdir/$applet.tests" || status=1
	fi
done

# Leaving the dir makes it somewhat easier to run failed test by hand
#rm -rf "$LINKSDIR"

if [ $status -ne 0 ] && [ x"$VERBOSE" = x ]; then
	echo "Failures detected, running with -v (verbose) will give more info"
fi
exit $status
