3 [ -n "$srcdir" ] || srcdir=$(pwd)
4 [ -n "$bindir" ] || bindir=$(dirname $(pwd))
15 local uc_applet=$(echo $applet | tr a-z A-Z)
16 local testname=$(basename $testcase)
18 if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
19 echo UNTESTED: $testname
23 if grep -q "^# FEATURE: " $testcase; then
24 local feature=`sed -ne 's/^# FEATURE: //p' $testcase`
26 if grep -q "^# ${feature} is not set$" $bindir/.config; then
27 echo UNTESTED: $testname
36 d=$srcdir sh -x -e $testcase >.logfile.txt 2>&1
40 if [ $verbose -gt 0 ]; then
63 for testcase in $srcdir/$applet/*; do
64 if [ "$testcase" = "$srcdir/$applet/CVS" ]; then
68 if run_applet_testcase $applet $testcase; then
82 if [ x"$1" = x"-v" ]; then
84 export VERBOSE=$verbose
89 applets=$(cd $srcdir ; for i in $@; do ls ${i}* ; done)
94 # Set up option flags so tests can be selective.
96 configfile=${bindir:-../../}/.config
97 export OPTIONFLAGS=:$(echo $(sed -nr 's/^CONFIG_(.*)=.*/\1/p' $configfile) | sed 's/ /:/')
99 for applet in $applets; do
100 if [ "$applet" = "links" ]; then continue; fi
101 if [ "$applet" != "CVS" -a -d "$srcdir/$applet" ]; then
102 if run_applet_tests $applet; then
109 # Is this a new-style test?
110 applet=$(echo "$applet" | sed -n 's/\.tests$//p')
111 if [ ${#applet} -ne 0 ]
113 appcfg=`grep -i "^# CONFIG_$applet" $configfile`
116 echo "SKIPPED: $applet (is configured out)"
119 # Setup environment for test.
120 if [ -d links ]; then
121 rm -f links/"$applet"
123 mkdir links 2> /dev/null
125 ln -s ${bindir:-../..}/busybox links/"$applet"
126 PATH="$srcdir:$PATH" COMMAND="links/$applet" \
127 "${srcdir:-.}/$applet".tests
128 if [ $? -ne 0 ]; then status=1; fi