Skip to content

Commit 0e93439

Browse files
committed
Added support for multiple arguments
This change provides greater flexibility by allowing users to provide specific parameters to individual testcases from run-test.sh Signed-off-by: Vamsee Narapareddi <[email protected]>
1 parent 5f0e933 commit 0e93439

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Runner/run-test.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ RESULTS_SKIP=""
3838

3939
execute_test_case() {
4040
test_path=$1
41+
shift
42+
4143
test_name=$(basename "$test_path")
4244

4345
if [ -d "$test_path" ]; then
4446
run_script="$test_path/run.sh"
4547
if [ -f "$run_script" ]; then
4648
log "Executing test case: $test_name"
47-
(cd "$test_path" && sh "./run.sh")
49+
(cd "$test_path" && sh "./run.sh" "$@")
4850
res_file="$test_path/$test_name.res"
4951
if [ -f "$res_file" ]; then
5052
if grep -q "SKIP" "$res_file"; then
@@ -88,12 +90,13 @@ execute_test_case() {
8890

8991
run_specific_test_by_name() {
9092
test_name=$1
93+
shift
9194
test_path=$(find_test_case_by_name "$test_name")
9295
if [ -z "$test_path" ]; then
9396
log_error "Test case with name $test_name not found."
9497
RESULTS_FAIL=$(printf "%s\n%s" "$RESULTS_FAIL" "$test_name (not found)")
9598
else
96-
execute_test_case "$test_path"
99+
execute_test_case "$test_path" "$@"
97100
fi
98101
}
99102

@@ -120,14 +123,16 @@ print_summary() {
120123
}
121124

122125
if [ "$#" -eq 0 ]; then
123-
log "Usage: $0 [all | <testcase_name>]"
126+
log "Usage: $0 [all | <testcase_name> [arg1 arg2 ...]]"
124127
exit 1
125128
fi
126129

127130
if [ "$1" = "all" ]; then
128131
run_all_tests
129132
else
130-
run_specific_test_by_name "$1"
133+
test_case_name="$1"
134+
shift
135+
run_specific_test_by_name "$test_case_name" "$@"
131136
fi
132137

133138
print_summary

0 commit comments

Comments
 (0)