🧑‍💻 Fix, improve test scripts (#28136)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Andrew 2025-10-24 20:05:59 -04:00 committed by GitHub
parent 5bd28cd840
commit 14b5d5ba84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 22 deletions

View file

@ -67,7 +67,7 @@ marlin:
.PHONY: marlin
clean:
rm -r .pio/build
rm -rf .pio/build*
tests-single-ci:
export GIT_RESET_HARD=true

View file

@ -6,7 +6,9 @@ set -e
FN="platformio.ini"
if [[ $1 == "-n" ]]; then
awk '/default_src_filter/ { sub("default_src_filter", "org_src_filter"); print "default_src_filter = +<src/*>"; } 1' $FN > $FN~ && mv $FN~ $FN
if ! grep -q "org_src_filter" "$FN"; then
awk '/default_src_filter/ { sub("default_src_filter", "org_src_filter"); print "default_src_filter = +<src/*>"; } 1' $FN > $FN~ && mv $FN~ $FN
fi
else
git checkout $FN 2>/dev/null
fi

View file

@ -3,31 +3,34 @@
import os, sys, subprocess
files_to_remove = [
"Marlin/_Bootscreen.h",
"Marlin/_Statusscreen.h",
"marlin_config.json",
".pio/build/mc.zip"
"Marlin/_Bootscreen.h",
"Marlin/_Statusscreen.h",
"marlin_config.json",
".pio/build/mc.zip"
]
for file in files_to_remove:
if os.path.exists(file):
os.remove(file)
if os.path.exists(file):
os.remove(file)
def use_example_configs():
try:
subprocess.run(['use_example_configs'], check=True)
except FileNotFoundError:
print("use_example_configs not found, skipping.")
pass
try:
subprocess.run(['use_example_configs'], check=True)
except FileNotFoundError:
try:
subprocess.run(['./buildroot/bin/use_example_configs'], check=True)
except FileNotFoundError:
print("use_example_configs not found, skipping.")
pass
if len(sys.argv) > 1 and sys.argv[1] in ['-d', '--default']:
use_example_configs()
use_example_configs()
else:
files_to_checkout = [
"Marlin/Configuration.h",
"Marlin/Configuration_adv.h",
"Marlin/config.ini",
"Marlin/src/pins/*/pins_*.h"
]
for file in files_to_checkout:
subprocess.run(["git", "checkout", file], stderr=subprocess.DEVNULL)
files_to_checkout = [
"Marlin/Configuration.h",
"Marlin/Configuration_adv.h",
"Marlin/config.ini",
"Marlin/src/pins/*/pins_*.h"
]
for file in files_to_checkout:
subprocess.run(["git", "checkout", file], stderr=subprocess.DEVNULL)