mirror of
https://gitlab.com/Luci_/arduino-photometrics.git
synced 2026-04-03 11:35:37 +02:00
last tentative ci gitlab
This commit is contained in:
parent
88b68cb13d
commit
1500bfe07b
37
.gitlab-ci.yml
Normal file
37
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
stages:
|
||||
- build
|
||||
- test
|
||||
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
PLATFORMIO_CACHE_DIR: "$CI_PROJECT_DIR/.cache/platformio"
|
||||
ARDUINO_ENV: "megaADK"
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .cache/pip
|
||||
- .cache/platformio
|
||||
key: "$CI_COMMIT_REF_SLUG"
|
||||
|
||||
pio_build:
|
||||
image: python:latest
|
||||
stage: build
|
||||
|
||||
before_script:
|
||||
- pip install -U platformio
|
||||
# - pio lib install "ThrowTheSwitch/Unity@^2.6.0"
|
||||
|
||||
script:
|
||||
- "pio run -e $ARDUINO_ENV"
|
||||
|
||||
pio_test:
|
||||
image: python:latest
|
||||
stage: test
|
||||
|
||||
before_script:
|
||||
- pip install -U platformio
|
||||
|
||||
script:
|
||||
- pio test -e $ARDUINO_ENV --without-uploading
|
||||
# - pio ci --lib='.' --board=$ARDUINO_ENV test/EEPROM_test_struct.cpp
|
||||
# - "pio ci --lib='.' --board=$ARDUINO_ENV test"
|
||||
|
|
@ -17,9 +17,10 @@ test_framework = unity
|
|||
build_flags =
|
||||
-std=gnu++17
|
||||
-I lib/
|
||||
;-D DEBUG
|
||||
|
||||
;-D DEBUG
|
||||
lib_deps =
|
||||
northernwidget/DS3231@^1.1.2
|
||||
|
||||
lib_ldf_mode = deep+
|
||||
; arduino-libraries/Ethernet
|
||||
; robtillaart/CRC
|
||||
lib_ldf_mode = deep+
|
||||
extra_scripts = pre:test_init.py
|
||||
|
|
@ -312,32 +312,22 @@ void test_get_measure_at(){
|
|||
}
|
||||
}
|
||||
|
||||
// Définition de la fonction de préparation
|
||||
void setUp(void) {
|
||||
Serial.begin(9600);
|
||||
// mettez ici le code qui doit s'exécuter AVANT CHAQUE test
|
||||
// Par exemple : initialisation de variables, nettoyage d'états
|
||||
}
|
||||
|
||||
// Définition de la fonction de nettoyage
|
||||
void tearDown(void) {
|
||||
// mettez ici le code qui doit s'exécuter APRÈS CHAQUE test
|
||||
// Par exemple : désallocation de mémoire, réinitialisation de l'état
|
||||
}
|
||||
|
||||
void setup(void){
|
||||
void setup(void)
|
||||
{
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
//WARNING: Tests are not exhaustive and do not cover all possibilities.
|
||||
int main( int argc, char **argv) {
|
||||
UNITY_BEGIN();
|
||||
// The following commented test is here for faciltate the debug "test_get_measure_at", test_get_measure is private function for the storage_interface class
|
||||
// Maybe removed later
|
||||
// RUN_TEST(test_get_measure);
|
||||
RUN_TEST(test_get_struct);
|
||||
RUN_TEST(test_set_struct);
|
||||
RUN_TEST(test_get_measure_at);
|
||||
RUN_TEST(test_add_measure);
|
||||
RUN_TEST(test_get_struct);
|
||||
RUN_TEST(test_set_struct);
|
||||
// RUN_TEST(test_put_measure);
|
||||
|
||||
UNITY_END();
|
||||
}
|
||||
12
test_init.py
Normal file
12
test_init.py
Normal file
|
|
@ -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"
|
||||
]
|
||||
)
|
||||
Loading…
Reference in a new issue