|
@@ -13,8 +13,8 @@ echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
|
|
echo " Options:"
|
|
echo " Options:"
|
|
echo " -h|--help Show help message"
|
|
echo " -h|--help Show help message"
|
|
echo " -k|--keep Keep passed test logs"
|
|
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 " -v|--verbose Increase verbosity of test messages"
|
|
|
|
+echo " -vv Alias of -v -v (Show all results in stdout)"
|
|
echo " -d|--debug Debug mode (trace all shell commands)"
|
|
echo " -d|--debug Debug mode (trace all shell commands)"
|
|
exit $1
|
|
exit $1
|
|
}
|
|
}
|
|
@@ -55,12 +55,9 @@ parse_opts() { # opts
|
|
KEEP_LOG=1
|
|
KEEP_LOG=1
|
|
shift 1
|
|
shift 1
|
|
;;
|
|
;;
|
|
- --verbose|-v)
|
|
|
|
- VERBOSE=1
|
|
|
|
- shift 1
|
|
|
|
- ;;
|
|
|
|
- --quiet|-q)
|
|
|
|
- BE_QUIET=1
|
|
|
|
|
|
+ --verbose|-v|-vv)
|
|
|
|
+ VERBOSE=$((VERBOSE + 1))
|
|
|
|
+ [ $1 == '-vv' ] && VERBOSE=$((VERBOSE + 1))
|
|
shift 1
|
|
shift 1
|
|
;;
|
|
;;
|
|
--debug|-d)
|
|
--debug|-d)
|
|
@@ -106,7 +103,6 @@ LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`/
|
|
KEEP_LOG=0
|
|
KEEP_LOG=0
|
|
DEBUG=0
|
|
DEBUG=0
|
|
VERBOSE=0
|
|
VERBOSE=0
|
|
-BE_QUIET=0
|
|
|
|
# Parse command-line options
|
|
# Parse command-line options
|
|
parse_opts $*
|
|
parse_opts $*
|
|
|
|
|
|
@@ -246,7 +242,7 @@ run_test() { # testfile
|
|
testcase $1
|
|
testcase $1
|
|
echo "execute: "$1 > $testlog
|
|
echo "execute: "$1 > $testlog
|
|
SIG_RESULT=0
|
|
SIG_RESULT=0
|
|
- if [ $VERBOSE -ne 0 ]; then
|
|
|
|
|
|
+ if [ $VERBOSE -ge 2 ]; then
|
|
__run_test $1 2>> $testlog | tee -a $testlog
|
|
__run_test $1 2>> $testlog | tee -a $testlog
|
|
else
|
|
else
|
|
__run_test $1 >> $testlog 2>&1
|
|
__run_test $1 >> $testlog 2>&1
|
|
@@ -256,7 +252,7 @@ run_test() { # testfile
|
|
# Remove test log if the test was done as it was expected.
|
|
# Remove test log if the test was done as it was expected.
|
|
[ $KEEP_LOG -eq 0 ] && rm $testlog
|
|
[ $KEEP_LOG -eq 0 ] && rm $testlog
|
|
else
|
|
else
|
|
- [ $BE_QUIET -eq 0 ] && catlog $testlog
|
|
|
|
|
|
+ [ $VERBOSE -ge 1 ] && catlog $testlog
|
|
TOTAL_RESULT=1
|
|
TOTAL_RESULT=1
|
|
fi
|
|
fi
|
|
rm -rf $TMPDIR
|
|
rm -rf $TMPDIR
|