#!/bin/sh

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

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

	d=$srcdir sh -x -e $testcase >.logfile.txt 2>&1

	if [ $? != 0 ] ; then
		echo FAIL: $testname
		if [ $verbose -gt 0 ]; then
			cat .logfile.txt
			#exit 1;
		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 $srcdir/$applet/*; do
		if [ "$testcase" = "$srcdir/$applet/CVS" ]; then
			continue
		fi

		if run_applet_testcase $applet $testcase; then
			:
		else
			status=1
		fi
	done

	return $status
}


status=0
verbose=0

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

if [ $# -ne 0 ]; then
	applets=$(cd $srcdir ; for i in $@; do ls ${i}* ; done)
else
	applets=$(ls $srcdir)
fi

# Set up option flags so tests can be selective.

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

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

	# Is this a new-style test?
	applet=$(echo "$applet" | sed -n 's/\.tests$//p')
	if [ ${#applet} -ne 0 ]
	then
		appcfg=`grep -i "^# CONFIG_$applet" $configfile`
		if [ -n "$appcfg" ]
		then
			echo "SKIPPED: $applet (is configured out)"
			continue
		fi
		# Setup environment for test.
		if [ -d links ]; then
			rm -f links/"$applet" 
		else
			mkdir links 2> /dev/null
		fi
		ln -s ${bindir:-../..}/busybox links/"$applet"
		PATH="$srcdir:$PATH" COMMAND="links/$applet" \
			"${srcdir:-.}/$applet".tests
		if [ $? -ne 0 ]; then status=1; fi
	fi

done
rm -f links/*
rmdir links
exit $status
