@@ -92,7 +92,6 @@ function run_test {
9292 if [[ -f " $sketchdir /diagram.$target .json" ]]; then
9393 extra_args+=(" --wokwi-diagram" " $sketchdir /diagram.$target .json" )
9494 fi
95-
9695 elif [ $platform == " qemu" ]; then
9796 PATH=$HOME /qemu/bin:$PATH
9897 extra_args=(" --embedded-services" " qemu" " --qemu-image-path" " $build_dir /$sketchname .ino.merged.bin" )
@@ -111,15 +110,23 @@ function run_test {
111110
112111 rm " $sketchdir " /diagram.json 2> /dev/null || true
113112
113+ local wifi_args=" "
114+ if [ -n " $wifi_ssid " ]; then
115+ wifi_args=" --wifi-ssid \" $wifi_ssid \" "
116+ fi
117+ if [ -n " $wifi_password " ]; then
118+ wifi_args=" $wifi_args --wifi-password \" $wifi_password \" "
119+ fi
120+
114121 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=$?
122+ 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 "
123+ 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=$?
117124 printf " \n"
118125 if [ $result -ne 0 ]; then
119126 result=0
120127 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=$?
128+ 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 "
129+ 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=$?
123130 printf " \n"
124131 if [ $result -ne 0 ]; then
125132 printf " \033[91mFailed test: %s -- Config: %s\033[0m\n\n" " $sketchname " " $i "
@@ -137,6 +144,8 @@ platform="hardware"
137144chunk_run=0
138145options=0
139146erase=0
147+ wifi_ssid=" "
148+ wifi_password=" "
140149
141150while [ -n " $1 " ]; do
142151 case $1 in
@@ -151,7 +160,6 @@ while [ -n "$1" ]; do
151160 platform=" qemu"
152161 ;;
153162 -W )
154- shift
155163 if [[ -z $WOKWI_CLI_TOKEN ]]; then
156164 echo " Wokwi CLI token is not set"
157165 exit 1
@@ -188,6 +196,14 @@ while [ -n "$1" ]; do
188196 shift
189197 test_type=$1
190198 ;;
199+ -wifi-ssid )
200+ shift
201+ wifi_ssid=$1
202+ ;;
203+ -wifi-password )
204+ shift
205+ wifi_password=$1
206+ ;;
191207 * )
192208 break
193209 ;;
0 commit comments