echo " -h|--help Show help message"
echo " -k|--keep Keep passed test logs"
echo " -v|--verbose Show all stdout messages in testcases"
+echo " -q|--quiet Do not show error log on stdout"
echo " -d|--debug Debug mode (trace all shell commands)"
exit $1
}
VERBOSE=1
shift 1
;;
+ --quiet|-q)
+ BE_QUIET=1
+ shift 1
+ ;;
--debug|-d)
DEBUG=1
shift 1
KEEP_LOG=0
DEBUG=0
VERBOSE=0
+BE_QUIET=0
# Parse command-line options
parse_opts $*
__run_test() { # testfile
# setup PID and PPID, $$ is not updated.
- (cd $TRACING_DIR; read PID _ < /proc/self/stat ; set -e; set -x; . $1)
+ (cd $TRACING_DIR; read PID _ < /proc/self/stat; set -e; set -x; initialize_ftrace; . $1)
[ $? -ne 0 ] && kill -s $SIG_FAIL $SIG_PID
}
run_test() { # testfile
local testname=`basename $1`
local testlog=`mktemp $LOG_DIR/${testname}-log.XXXXXX`
+ export TMPDIR=`mktemp -d /tmp/ftracetest-dir.XXXXXX`
testcase $1
echo "execute: "$1 > $testlog
SIG_RESULT=0
# Remove test log if the test was done as it was expected.
[ $KEEP_LOG -eq 0 ] && rm $testlog
else
- catlog $testlog
+ [ $BE_QUIET -eq 0 ] && catlog $testlog
TOTAL_RESULT=1
fi
+ rm -rf $TMPDIR
}
# load in the helper functions