Skip to content

Commit

Permalink
runtests: add the test files under scenarion folder with -s function
Browse files Browse the repository at this point in the history
Signed-off-by: Pengfei Xu <[email protected]>
  • Loading branch information
xupengfe committed Jul 4, 2024
1 parent c1576d0 commit 0e5b33d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion BM/runtests
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Usage: ${0##*/} [-f CMDFILES] [-c CMDLINE] [-o LOGFILE]
-d DEPENDENCE_FILE check dependence for specified feature tests
-t TYPE_FILE check test type like tests-server|tests-client
-c CMDLINE execute test case
-s SCENARIO_FOLDER all tests-* files under target folder
-o LOGFILE redirect output of tests to file
Examples:
Expand All @@ -51,6 +52,7 @@ Examples:
./runtests -t tests-client // type like tests-client|tests for all subfolders
./runtests -t tests-server // type like tests-server|tests for all subfolders
./runtests -c ./cet/quick_test -o cet_quick_test.log
./runtests -s ../scenario/emr-oe // scenario test files folder
./runtests -d cet/tests // check cet dependence
./runtests -d tests-server // check tests-server/tests for all subfolders dependence
_EOF
Expand Down Expand Up @@ -414,7 +416,7 @@ run_tests() {
: CMDFILES=""
: CMDLINE=""

while getopts ":o:d:f:t:c:h" opt; do
while getopts ":o:d:f:t:s:c:h" opt; do
case "$opt" in
o)
LOGFILE=$OPTARG
Expand Down Expand Up @@ -445,6 +447,24 @@ while getopts ":o:d:f:t:c:h" opt; do
# If tests-server type will list tests-server in all subfolders
[[ "$CMDFILES" == *"-"* ]] && list_all_test_files "$CMDFILES"
;;
s)
test_files=""

SCENARIO_FOLDER=$OPTARG
[[ -d "$SCENARIO_FOLDER" ]] || usage
test_files=$(find "$SCENARIO_FOLDER" -name "tests-*")
[[ -z "$test_files" ]] && append_log "No tests-* files under $SCENARIO_FOLDER"
for cmdfile in $test_files; do
check_test_file_legal "$cmdfile"

check_dep_feature "$cmdfile" || {
append_log "Skip $cmdfile due to dependece, please check $DEP_LOG" "$LOGFILE"
DEP_EXIT=$BLOCK_CODE
continue
}
CMDFILES="$CMDFILES,$cmdfile"
done
;;
c)
CMDLINE=$OPTARG
;;
Expand Down

0 comments on commit 0e5b33d

Please sign in to comment.