Skip to content

Commit 62237f5

Browse files
committed
Pass arguments to python scripts in containers.
1 parent 84d8620 commit 62237f5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/runTests.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# $4 : Path of the installation directory
77
# $5 : Test script to execute
88

9-
usage="$(basename "$0") [-h] [-t tutorial_branch] [-b su2_branch] [-c testcases_branch] [-s test_script]
9+
usage="$(basename "$0") [-h] [-t tutorial_branch] [-b su2_branch] [-c testcases_branch] [-s test_script] [-a args]
1010
where:
1111
-h show this help text
1212
-t branch of su2code/su2code.github.io repo
@@ -15,7 +15,8 @@ where:
1515
(if not provided, it is assumed that it is mounted at /src/Tutorials)
1616
-c branch of su2code/TestCases repo.
1717
(if not provided, it is assumed that it is mounted at /src/TestData)
18-
-s name of the test script to execute (default: parallel_regression.py).
18+
-s name of the test script to execute (default: parallel_regression.py)
19+
-a arguments that should be passed to the test script (default: empty)
1920
2021
Compiled binaries must be mounted at /install/ !
2122
@@ -26,6 +27,7 @@ su2branch=""
2627
testbranch=""
2728
tutorialbranch=""
2829
script="parallel_regression.py"
30+
args=""
2931

3032
while [ "`echo $1 | cut -c1`" = "-" ]
3133
do
@@ -46,6 +48,10 @@ do
4648
script=$2
4749
shift 2
4850
;;
51+
-a)
52+
args=$2
53+
shift 2
54+
;;
4955
*)
5056
echo "$usage" >&2
5157
exit 1
@@ -122,7 +128,7 @@ alias mpirun='mpirun --allow-run-as-root'
122128

123129
# Run Test Script
124130
cd tests/TestCases
125-
python $script
131+
python $script $args
126132

127133
if [ $? -eq 0 ]; then
128134
echo "Tests passed"

0 commit comments

Comments
 (0)