@@ -111,15 +111,23 @@ function run_test {
111111
112112 rm " $sketchdir " /diagram.json 2> /dev/null || true
113113
114+ local wifi_args=" "
115+ if [ -n " $wifi_ssid " ]; then
116+ wifi_args=" --wifi-ssid \" $wifi_ssid \" "
117+ fi
118+ if [ -n " $wifi_password " ]; then
119+ wifi_args=" $wifi_args --wifi-password \" $wifi_password \" "
120+ fi
121+
114122 result=0
115- printf " \033[95mpytest -s \" %s/test_%s.py\" --build-dir \" %s\" --junit-xml=\" %s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" " $sketchdir " " $sketchname " " $build_dir " " $report_file " " $test_type " " $platform " " $target " " $sketchname " " $i " " ${extra_args[*]@ Q} "
116- bash -c " set +e; pytest -s \" $sketchdir /test_$sketchname .py\" --build-dir \" $build_dir \" --junit-xml=\" $report_file \" -o junit_suite_name=${test_type} _${platform} _${target} _${sketchname}${i} ${extra_args[*]@ Q} ; exit \$ ?" || result=$?
123+ printf " \033[95mpytest -s \" %s/test_%s.py\" --build-dir \" %s\" --junit-xml=\" %s\" -o junit_suite_name=%s_%s_%s_%s%s %s %s \033[0m\n" " $sketchdir " " $sketchname " " $build_dir " " $report_file " " $test_type " " $platform " " $target " " $sketchname " " $i " " ${extra_args[*]@ Q} " " $wifi_args "
124+ bash -c " set +e; pytest -s \" $sketchdir /test_$sketchname .py\" --build-dir \" $build_dir \" --junit-xml=\" $report_file \" -o junit_suite_name=${test_type} _${platform} _${target} _${sketchname}${i} ${extra_args[*]@ Q} $wifi_args ; exit \$ ?" || result=$?
117125 printf " \n"
118126 if [ $result -ne 0 ]; then
119127 result=0
120128 printf " \033[95mRetrying test: %s -- Config: %s\033[0m\n" " $sketchname " " $i "
121- printf " \033[95mpytest -s \" %s/test_%s.py\" --build-dir \" %s\" --junit-xml=\" %s\" -o junit_suite_name=%s_%s_%s_%s%s %s\033[0m\n" " $sketchdir " " $sketchname " " $build_dir " " $report_file " " $test_type " " $platform " " $target " " $sketchname " " $i " " ${extra_args[*]@ Q} "
122- bash -c " set +e; pytest -s \" $sketchdir /test_$sketchname .py\" --build-dir \" $build_dir \" --junit-xml=\" $report_file \" -o junit_suite_name=${test_type} _${platform} _${target} _${sketchname}${i} ${extra_args[*]@ Q} ; exit \$ ?" || result=$?
129+ printf " \033[95mpytest -s \" %s/test_%s.py\" --build-dir \" %s\" --junit-xml=\" %s\" -o junit_suite_name=%s_%s_%s_%s%s %s %s \033[0m\n" " $sketchdir " " $sketchname " " $build_dir " " $report_file " " $test_type " " $platform " " $target " " $sketchname " " $i " " ${extra_args[*]@ Q} " " $wifi_args "
130+ bash -c " set +e; pytest -s \" $sketchdir /test_$sketchname .py\" --build-dir \" $build_dir \" --junit-xml=\" $report_file \" -o junit_suite_name=${test_type} _${platform} _${target} _${sketchname}${i} ${extra_args[*]@ Q} $wifi_args ; exit \$ ?" || result=$?
123131 printf " \n"
124132 if [ $result -ne 0 ]; then
125133 printf " \033[91mFailed test: %s -- Config: %s\033[0m\n\n" " $sketchname " " $i "
@@ -137,6 +145,8 @@ platform="hardware"
137145chunk_run=0
138146options=0
139147erase=0
148+ wifi_ssid=" "
149+ wifi_password=" "
140150
141151while [ -n " $1 " ]; do
142152 case $1 in
@@ -188,6 +198,14 @@ while [ -n "$1" ]; do
188198 shift
189199 test_type=$1
190200 ;;
201+ -wifi-ssid )
202+ shift
203+ wifi_ssid=$1
204+ ;;
205+ -wifi-password )
206+ shift
207+ wifi_password=$1
208+ ;;
191209 * )
192210 break
193211 ;;
0 commit comments