13 local uc_applet=$(echo $applet | tr a-z A-Z)
14 local testname=$(basename $testcase)
16 if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
17 echo UNTESTED: $testname
21 if grep -q "^# FEATURE: " $testcase; then
22 local feature=`sed -ne 's/^# FEATURE: //p' $testcase`
24 if grep -q "^# ${feature} is not set$" $bindir/.config; then
25 echo UNTESTED: $testname
34 # echo Running testcase $testcase
35 d=$tsdir sh -x -e $testcase >.logfile.txt 2>&1 || status=$?
37 if [ $status -ne 0 ]; then
39 if [ $verbose -gt 0 ]; then
61 for testcase in $tsdir/$applet/*; do
62 if [ "$testcase" = "$tsdir/$applet/CVS" ]; then
65 if ! run_applet_testcase $applet $testcase; then
77 [ -n "$tsdir" ] || tsdir=$(pwd)
78 [ -n "$bindir" ] || bindir=$(dirname $(pwd))
81 if [ x"$1" = x"-v" ]; then
83 export VERBOSE=$verbose
88 $bindir/busybox 2>&1 |
90 if test x"$line" = x"Currently defined functions:"; then
97 applets="$implemented"
102 # Populate a directory with links to all busybox applets
104 LINKSDIR="$bindir/runtest-tempdir-links"
105 rm -rf "$LINKSDIR" 2>/dev/null
107 for i in $implemented; do
108 ln -s $bindir/busybox "$LINKSDIR"/$i
111 # Set up option flags so tests can be selective.
113 configfile=${bindir}/.config
114 export OPTIONFLAGS=:$(sed -nr 's/^CONFIG_(.*)=.*/\1/p' $configfile | xargs | sed 's/ /:/g')
116 for applet in $applets; do
117 if [ "$applet" = "links" ]; then continue; fi
118 if [ "$applet" != "CVS" -a -d "$tsdir/$applet" ]; then
119 if ! run_applet_tests $applet; then
124 # Is this a new-style test?
125 if [ -f ${applet}.tests ]; then
126 if [ ! -h "$LINKSDIR/$applet" ] && [ "${applet:0:4}" != "all_" ]; then
127 echo "SKIPPED: $applet (not built)"
130 if PATH="$LINKSDIR:$tsdir:$bindir:$PATH" \
131 "${tsdir:-.}/$applet".tests
141 # Leaving the dir makes it somewhat easier to run failed test by hand
144 if [ $status != 0 -a x"$VERBOSE" = x ]; then
145 echo "Failures detected, running with VERBOSE=1 will give more info"