Skip to content

Commit

Permalink
sketch_utils.sh: Pass the Windows parameters with the extra options.
Browse files Browse the repository at this point in the history
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
  • Loading branch information
Ouss4 committed Jun 27, 2022
1 parent b5d1958 commit 011a52c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
18 changes: 9 additions & 9 deletions .github/scripts/on-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ function build(){
args+=" -i $chunk_index -m $chunks_cnt"
${BUILD_SKETCHES} ${args}
else
if [ "$OS_IS_WINDOWS" == "1" ]; then
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version
-prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
args+="-w \"${win_opts}\""
fi

for sketch in ${sketches}; do
${BUILD_SKETCH} ${args} " -s $(dirname $sketch)"
args+=" -s $(dirname $sketch)"
if [ "$OS_IS_WINDOWS" == "1" ]; then
local ctags_version=`ls "$ARDUINO_IDE_PATH/tools-builder/ctags/"`
local preprocessor_version=`ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/"`
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version
-prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
args+=" ${win_opts}"
fi
${BUILD_SKETCH} ${args}
done
fi
}
Expand Down
17 changes: 7 additions & 10 deletions .github/scripts/sketch_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,14 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
shift
target=$1
;;
-s )
shift
sketchdir=$1
;;
-w )
shift
win_opts=$1
;;
-fqbn )
shift
fqbn=$1
;;
-s )
shift
sketchdir=$1
;;
-ff )
shift
ff_opt=$1
Expand Down Expand Up @@ -139,7 +135,8 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
rm -rf "$build_dir$i"
mkdir -p "$build_dir$i"
currfqbn=`echo $fqbn | jq -r --argjson i $i '.[$i]'`
echo "Building with FQBN=$currfqbn"
sketchname=$(basename $sketchdir)
echo "Building $sketchname with FQBN=$currfqbn"
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
-fqbn=\"$currfqbn\" \
-warnings="all" \
Expand All @@ -151,7 +148,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
-libraries "$user_path/libraries" \
-build-cache "$ARDUINO_CACHE_DIR" \
-build-path "$build_dir$i" \
$win_opts $xtra_opts "${sketchdir}/$(basename ${sketchdir}).ino"
$xtra_opts "${sketchdir}/${sketchname}.ino"
done
}

Expand Down
6 changes: 3 additions & 3 deletions .github/scripts/tests_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function run_test() {
local options=$3
local erase_flash=$4
local sketchdir=$(dirname $sketch)
local sketchdirname=$(basename $sketchdir)
local sketchname=$(basename $sketchdir)

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

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

pytest tests --build-dir tests/$sketchdirname/build$i -k test_$sketchdirname --junit-xml=tests/$sketchdirname/$sketchdirname$i.xml
pytest tests --build-dir tests/$sketchname/build$i -k test_$sketchname --junit-xml=tests/$sketchname/$sketchname$i.xml
result=$?
if [ $result -ne 0 ]; then
return $result
Expand Down

0 comments on commit 011a52c

Please sign in to comment.