3 [ -n "$srcdir" ] || srcdir=$(pwd)
4 [ -n "$bindir" ] || bindir=$(dirname $(pwd))
17 local uc_applet=$(echo $applet | tr a-z A-Z)
18 local testname=$(basename $testcase)
20 if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
21 echo UNTESTED: $testname
25 if grep -q "^# FEATURE: " $testcase; then
26 local feature=`sed -ne 's/^# FEATURE: //p' $testcase`
28 if grep -q "^# ${feature} is not set$" $bindir/.config; then
29 echo UNTESTED: $testname
38 d=$srcdir sh -x -e $testcase >.logfile.txt 2>&1 || status=$?
40 if [ $status -ne 0 ] ; then
42 if [ $verbose -gt 0 ]; then
64 for testcase in $srcdir/$applet/*; do
65 if [ "$testcase" = "$srcdir/$applet/CVS" ]; then
69 if run_applet_testcase $applet $testcase; then
83 if [ x"$1" = x"-v" ]; then
85 export VERBOSE=$verbose
90 applets=$(cd $srcdir ; for i in $@; do ls ${i}* ; done)
95 # Populate a directory with links to all busybox applets
97 LINKSDIR="$bindir/runtest-tempdir-links"
98 implemented=$($bindir/busybox 2>&1 |
101 if test x"$line" = x"Currently defined functions:"
108 rm -rf "$LINKSDIR" 2>/dev/null
110 for i in $implemented
112 ln -s $bindir/busybox "$LINKSDIR"/$i
115 # Set up option flags so tests can be selective.
117 configfile=${bindir:-../../}/.config
118 export OPTIONFLAGS=:$(echo $(sed -nr 's/^CONFIG_(.*)=.*/\1/p' $configfile) | sed 's/ /:/g')
120 for applet in $applets; do
121 if [ "$applet" = "links" ]; then continue; fi
122 if [ "$applet" != "CVS" -a -d "$srcdir/$applet" ]; then
123 if run_applet_tests $applet; then
130 # Is this a new-style test?
131 applet=$(echo "$applet" | sed -n 's/\.tests$//p')
132 if [ ${#applet} -ne 0 ]
134 if [ ! -h "$LINKSDIR/$applet" ] && [ "${applet:0:4}" != "all_" ]
136 echo "SKIPPED: $applet (not built)"
139 if PATH="$LINKSDIR":$srcdir:$bindir:$PATH \
140 "${srcdir:-.}/$applet".tests