Skip to content

Commit d7b077e

Browse files
committed
sketch_utils.sh: Pass the Windows parameters with the extra options.
Signed-off-by: Abdelatif Guettouche <[email protected]>
1 parent b5d1958 commit d7b077e

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

Diff for: .github/scripts/on-push.sh

+11-9
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ function build(){
2323
args+=" -i $chunk_index -m $chunks_cnt"
2424
${BUILD_SKETCHES} ${args}
2525
else
26-
if [ "$OS_IS_WINDOWS" == "1" ]; then
27-
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
28-
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
29-
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version
30-
-prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
31-
args+="-w \"${win_opts}\""
32-
fi
33-
3426
for sketch in ${sketches}; do
35-
${BUILD_SKETCH} ${args} " -s $(dirname $sketch)"
27+
echo $sketch
28+
echo $(dirname $sketch)
29+
args+=" -s $(dirname $sketch)"
30+
if [ "$OS_IS_WINDOWS" == "1" ]; then
31+
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
32+
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
33+
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version
34+
-prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
35+
args+=" \"${win_opts}\""
36+
fi
37+
${BUILD_SKETCH} ${args}
3638
done
3739
fi
3840
}

Diff for: .github/scripts/sketch_utils.sh

+7-10
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,14 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
2424
shift
2525
target=$1
2626
;;
27-
-s )
28-
shift
29-
sketchdir=$1
30-
;;
31-
-w )
32-
shift
33-
win_opts=$1
34-
;;
3527
-fqbn )
3628
shift
3729
fqbn=$1
3830
;;
31+
-s )
32+
shift
33+
sketchdir=$1
34+
;;
3935
-ff )
4036
shift
4137
ff_opt=$1
@@ -139,7 +135,8 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
139135
rm -rf "$build_dir$i"
140136
mkdir -p "$build_dir$i"
141137
currfqbn=`echo $fqbn | jq -r --argjson i $i '.[$i]'`
142-
echo "Building with FQBN=$currfqbn"
138+
sketchname=$(basename $sketchdir)
139+
echo "Building $sketchname with FQBN=$currfqbn"
143140
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
144141
-fqbn=\"$currfqbn\" \
145142
-warnings="all" \
@@ -151,7 +148,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
151148
-libraries "$user_path/libraries" \
152149
-build-cache "$ARDUINO_CACHE_DIR" \
153150
-build-path "$build_dir$i" \
154-
$win_opts $xtra_opts "${sketchdir}/$(basename ${sketchdir}).ino"
151+
$xtra_opts "${sketchdir}/${sketchname}.ino"
155152
done
156153
}
157154

Diff for: .github/scripts/tests_run.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function run_test() {
66
local options=$3
77
local erase_flash=$4
88
local sketchdir=$(dirname $sketch)
9-
local sketchdirname=$(basename $sketchdir)
9+
local sketchname=$(basename $sketchdir)
1010

1111
if [ $options -eq 0 ] && [ -f $sketchdir/cfg.json ]; then
1212
len=`jq -r --arg chip $target '.targets[] | select(.name==$chip) | .fqbn | length' $sketchdir/cfg.json`
@@ -16,12 +16,12 @@ function run_test() {
1616

1717
for i in `seq 0 $(($len - 1))`
1818
do
19-
echo "Running test: $sketchdirname -- Config: $i"
19+
echo "Running test: $sketchname -- Config: $i"
2020
if [ $erase_flash -eq 1 ]; then
2121
esptool.py -c $target erase_flash
2222
fi
2323

24-
pytest tests --build-dir tests/$sketchdirname/build$i -k test_$sketchdirname --junit-xml=tests/$sketchdirname/$sketchdirname$i.xml
24+
pytest tests --build-dir tests/$sketchname/build$i -k test_$sketchname --junit-xml=tests/$sketchname/$sketchname$i.xml
2525
result=$?
2626
if [ $result -ne 0 ]; then
2727
return $result

0 commit comments

Comments
 (0)