#!/bin/sh

# Run old-style test.

run_applet_testcase()
{
	local applet=$1
	local testcase=$2

	local status=0
	local RES=

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

	if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
		echo UNTESTED: $testname
		return 0
	fi

	if grep -q "^# FEATURE: " $testcase; then
		local feature=`sed -ne 's/^# FEATURE: //p' $testcase`

		if grep -q "^# ${feature} is not set$" $bindir/.config; then
			echo UNTESTED: $testname
			return 0
		fi
	fi

	rm -rf tmp
	mkdir -p tmp
	pushd tmp > /dev/null

#	echo Running testcase $testcase
	d=$tsdir sh -x -e $testcase >.logfile.txt 2>&1 || status=$?

	if [ $status -ne 0 ]; then
		echo FAIL: $testname
		if [ $verbose -gt 0 ]; then
			cat .logfile.txt
		fi
		status=$?
	else
		echo PASS: $testname
		rm -f .logfile.txt
		status=$?
	fi

	popd > /dev/null
	rm -rf tmp

	return $status
}

run_applet_tests()
{
	local applet=$1

	local status=0

	for testcase in $tsdir/$applet/*; do
		if [ "$testcase" = "$tsdir/$applet/CVS" ]; then
			continue
		fi
		if ! run_applet_testcase $applet $testcase; then
			status=1
		fi
	done

	return $status
}


status=0
verbose=0

[ -n "$tsdir" ] || tsdir=$(pwd)
[ -n "$bindir" ] || bindir=$(dirname $(pwd))
PATH="$bindir:$PATH"

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

implemented=$(
	$bindir/busybox 2>&1 |
	while read line; do
		if test 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

LINKSDIR="$bindir/runtest-tempdir-links"
rm -rf "$LINKSDIR" 2>/dev/null
mkdir "$LINKSDIR"
for i in $implemented; do
	ln -s $bindir/busybox "$LINKSDIR"/$i
done

# Set up option flags so tests can be selective.

configfile=${bindir}/.config
export OPTIONFLAGS=:$(sed -nr 's/^CONFIG_(.*)=.*/\1/p' $configfile | xargs | sed 's/ /:/g')

for applet in $applets; do
	if [ "$applet" = "links" ]; then continue; fi
	if [ "$applet" != "CVS" -a -d "$tsdir/$applet" ]; then
		if ! run_applet_tests $applet; then
			status=1
		fi
	fi

	# Is this a new-style test?
	if [ -f ${applet}.tests ]; then
		if [ ! -h "$LINKSDIR/$applet" ] && [ "${applet:0:4}" != "all_" ]; then
			echo "SKIPPED: $applet (not built)"
			continue
		fi
		if PATH="$LINKSDIR":$tsdir:$bindir:$PATH \
				"${tsdir:-.}/$applet".tests
		then
			:
		else
			status=1
		fi
	fi

done
rm -rf "$LINKSDIR"
exit $status
