Skip to content

Commit 6cb636c

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

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Diff for: .github/scripts/tests_run.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ function run_test() {
2626
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build0.tmp/sdkconfig"
2727
fi
2828

29+
if [ ! -f $sdkconfig_path ]; then
30+
printf "\033[93mSketch $sketchname not built\nMight be due to missing target requirements or build failure\033[0m\n"
31+
printf "\n\n\n"
32+
return 0
33+
fi
34+
2935
if [ -f $sketchdir/ci.json ]; then
3036
# If the target or platform is listed as false, skip the sketch. Otherwise, include it.
3137
is_target=$(jq -r --arg target $target '.targets[$target]' $sketchdir/ci.json)
@@ -37,11 +43,11 @@ function run_test() {
3743
return 0
3844
fi
3945

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"
46+
local right_target=$(grep -E "^CONFIG_IDF_TARGET=\"$target\"$" "$sdkconfig_path")
47+
if [ -z "$right_target" ]; then
48+
printf "\033[91mError: Sketch $sketchname compiled for different target\n\033[0m\n"
4349
printf "\n\n\n"
44-
return 0
50+
return 1
4551
fi
4652
fi
4753

0 commit comments

Comments
 (0)