Skip to content

Commit

Permalink
Added test script
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Jul 25, 2024
1 parent b16d1bf commit 45e69f4
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
; src_dir = examples/BHI260AP_aux_BMM150_BME280
; src_dir = examples/BMM150_GetDataExample

src_dir = test/BHI260AP_aux_BMM150_BME280
src_dir = examples/BHI260AP_aux_BMM150_BME280

; Touch devices support list
; src_dir = examples/TouchDrv_FT3267_LilyGo_T_RGB
Expand Down
39 changes: 39 additions & 0 deletions tools/test_build/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Set-Location ..

$currentDir = Get-Location

Write-Host "Current path : $currentDir !"


$examples = Get-ChildItem -Path "examples" -Directory -Name

$envs = @(
"esp32s3",
"esp32c3",
"esp32dev",
"rp2040",
"nrf52840"
)

platformio run -t clean

foreach ($env in $envs) {
foreach ($example in $examples) {
$skipFile = "examples/$example/.skip.$env"
if (Test-Path $skipFile) {
Write-Host "Skip $example for $env"
continue
}

$env:PLATFORMIO_SRC_DIR = "examples/$example"
Write-Host "PLATFORMIO_SRC_DIR=$env:PLATFORMIO_SRC_DIR , ENV: $env"

platformio run -e $env
if ($LASTEXITCODE -ne 0) {
Write-Host "Build env: $env $env:PLATFORMIO_SRC_DIR Failed!"
exit 1
} else {
Write-Host "Build env: $env $env:PLATFORMIO_SRC_DIR Successed!"
}
}
}
47 changes: 47 additions & 0 deletions tools/test_build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

cd ../../

pwd

examples=($(find examples/* -maxdepth 1 -type d -printf "%f\n"))

envs=(
"esp32s3"
"esp32c3"
"esp32dev"
"rp2040"
"nrf52840"
)

pio run -t clean

for env in ${envs[@]}
do
for value in ${examples[@]}
do
if [ -f "$value/.skip."$env ];then
echo "Skip" $value
continue
fi

export PLATFORMIO_SRC_DIR="examples/$value"
echo "PLATFORMIO_SRC_DIR=$PLATFORMIO_SRC_DIR , ENV: $env"
pio run -e $env
if [ $? -ne 0 ]; then
echo "Build env: $env $PLATFORMIO_SRC_DIR Failed!"
exit -1
else
echo "Build env: $env $PLATFORMIO_SRC_DIR Successed!"
fi
done
done










0 comments on commit 45e69f4

Please sign in to comment.