mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-12-27 09:59:52 -07:00
🧑💻 Fix, improve test scripts (#28136)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
5bd28cd840
commit
14b5d5ba84
3 changed files with 27 additions and 22 deletions
2
Makefile
2
Makefile
|
|
@ -67,7 +67,7 @@ marlin:
|
|||
.PHONY: marlin
|
||||
|
||||
clean:
|
||||
rm -r .pio/build
|
||||
rm -rf .pio/build*
|
||||
|
||||
tests-single-ci:
|
||||
export GIT_RESET_HARD=true
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue