Skip to content

Commit

Permalink
runtests: Add option to skip dependence check
Browse files Browse the repository at this point in the history
In some case, users don't want to check the dependence. They guarantee
the execution environment.

Signed-off-by: Yi Sun <[email protected]>
  • Loading branch information
ysun committed Aug 30, 2024
1 parent ce0f7a1 commit 311b0b5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions BM/runtests
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ TEST_FILES=""
SUB_FOLDERS=""
TEST_LIST_FILE="/tmp/tests"
OLD_IFS=""
SKIP_DEP_CHECK="false"

# For dependence check parameters, set skip for unknow staus as default
readonly MARK_HW_DEP="@hw_dep:"
Expand All @@ -45,6 +46,7 @@ Usage: ${0##*/} [-f CMDFILES] [-c CMDLINE] [-o LOGFILE]
-c CMDLINE execute test case
-s SCENARIO_FOLDER all tests-* files under target folder
-o LOGFILE redirect output of tests to file
-k skip dependence check
Examples:
./runtests -f cet/tests
Expand Down Expand Up @@ -398,11 +400,13 @@ run_tests() {
for cmdfile in $(tr "," " " <<< "$CMDFILES"); do
check_test_file_legal "$cmdfile" || continue

check_dep_feature "$cmdfile" || {
append_log "Skip $cmdfile due to dependece, please check $DEP_LOG" "$LOGFILE"
DEP_EXIT=$BLOCK_CODE
continue
}
if [ "$SKIP_DEP_CHECK" == "false" ]; then
check_dep_feature "$cmdfile" || {
append_log "Skip $cmdfile due to dependece, please check $DEP_LOG" "$LOGFILE"
DEP_EXIT=$BLOCK_CODE
continue
}
fi
append_log "Next run cases from $cmdfile" "$LOGFILE"
runcmdfile "$cmdfile" "$LOGFILE"
done
Expand All @@ -417,7 +421,7 @@ run_tests() {
: CMDFILES=""
: CMDLINE=""

while getopts ":o:d:f:t:s:c:h" opt; do
while getopts ":o:d:f:t:s:c:kh" opt; do
case "$opt" in
o)
LOGFILE=$OPTARG
Expand Down Expand Up @@ -465,6 +469,9 @@ while getopts ":o:d:f:t:s:c:h" opt; do
c)
CMDLINE=$OPTARG
;;
k)
SKIP_DEP_CHECK="true"
;;
h)
usage
exit 0
Expand Down

0 comments on commit 311b0b5

Please sign in to comment.