From 0a5f9a149b9668ebea4f2b6a5706485ee9bcabf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Gauthier?= Date: Wed, 10 Dec 2025 13:48:30 +0100 Subject: [PATCH] add test_init.py, change for cli gitlab --- .gitlab-ci.yml | 7 ++++--- platformio.ini | 9 +++++++-- test_init.py | 12 ++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 test_init.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2ca19e..b220146 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ pio_build: before_script: - pip install -U platformio - - pio lib install "ThrowTheSwitch/Unity@^2.6.0" +# - pio lib install "ThrowTheSwitch/Unity@^2.6.0" script: - "pio run -e $ARDUINO_ENV" @@ -32,5 +32,6 @@ pio_test: - pip install -U platformio script: - - pio ci --lib='.' --board=$ARDUINO_ENV test/EEPROM_test_struct.cpp - # - "pio ci --lib='.' --board=$ARDUINO_ENV test" \ No newline at end of file + - pio test -e $ARDUINO_ENV --without-upload + # - pio ci --lib='.' --board=$ARDUINO_ENV test/EEPROM_test_struct.cpp +# - "pio ci --lib='.' --board=$ARDUINO_ENV test" \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index ec2dbdd..c93a17c 100755 --- a/platformio.ini +++ b/platformio.ini @@ -16,11 +16,16 @@ test_framework = unity ;upload_port = /dev/ttyACM0 build_flags = -std=gnu++17 - -I lib/ test/ + -I lib/ ;-D DEBUG lib_deps = northernwidget/DS3231@^1.1.2 arduino-libraries/Ethernet robtillaart/CRC -lib_ldf_mode = deep+ \ No newline at end of file +lib_ldf_mode = deep+ + +test_lib_deps = + ThrowTheSwitch/Unity@^2.6.0 + +extra_scripts = pre:test_init.py \ No newline at end of file diff --git a/test_init.py b/test_init.py new file mode 100644 index 0000000..d6788d8 --- /dev/null +++ b/test_init.py @@ -0,0 +1,12 @@ +# test_init.py + +Import("env") +test_env_name = env["PIOENV"] + +# Injecte manuellement les chemins d'inclusion nécessaires (Unity et votre config) +env.Append( + CPPPATH=[ + "test", + ".pio/libdeps/" + test_env_name + "/Unity/src" + ] +) \ No newline at end of file