Skip to content

Commit 178f4cb

Browse files
committed
fix(tests): Additional checks before running tests
1 parent 339d659 commit 178f4cb

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/scripts/tests_run.sh

+12-7
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ function run_test() {
3636
printf "\n\n\n"
3737
return 0
3838
fi
39+
fi
3940

40-
local has_requirements=$(${CHECK_REQUIREMENTS} $sketchdir "$sdkconfig_path")
41-
if [ "$has_requirements" == "0" ]; then
42-
printf "\033[93mTarget $target does not meet the requirements for $sketchname. Skipping.\033[0m\n"
43-
printf "\n\n\n"
44-
return 0
45-
fi
41+
if [ ! -f $sdkconfig_path ]; then
42+
printf "\033[93mSketch $sketchname not built\nMight be due to missing target requirements or build failure\033[0m\n"
43+
printf "\n\n\n"
44+
return 0
45+
fi
46+
47+
local right_target=$(grep -E "^CONFIG_IDF_TARGET=\"$target\"$" "$sdkconfig_path")
48+
if [ -z "$right_target" ]; then
49+
printf "\033[91mError: Sketch $sketchname compiled for different target\n\033[0m\n"
50+
printf "\n\n\n"
51+
return 1
4652
fi
4753

4854
if [ $len -eq 1 ]; then
@@ -121,7 +127,6 @@ function run_test() {
121127

122128
SCRIPTS_DIR="./.github/scripts"
123129
COUNT_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh count"
124-
CHECK_REQUIREMENTS="${SCRIPTS_DIR}/sketch_utils.sh check_requirements"
125130

126131
platform="hardware"
127132
wokwi_timeout=60000

0 commit comments

Comments
 (0)