ESP-IDF CI / Host Tests (Unity) (push) Successful in 1m8s
CI / firmware-native (push) Successful in 2m57s
Rust Protection Tests / Cargo test (host) (push) Failing after 3m21s
ESP-IDF CI / ESP-IDF Build (v5.4) (push) Failing after 6m55s
ESP-IDF CI / Memory Budget Gate (push) Has been skipped
qa-cicd-environments / qa-kxkm-s3-build (push) Successful in 8m53s
qa-cicd-environments / qa-sim-host (push) Successful in 2m2s
qa-cicd-environments / qa-kxkm-s3-memory-budget (push) Successful in 11m17s
Context: the project archive (KXKM_Batterie_Parallelator-main) had no git history locally; a fresh repository is needed to host it on git.saillant.cc (electron/KXKM_Batterie_Parallelator). Approach: initialize a new repo on branch main, stage the archive content, and harden .gitignore before the first commit. Changes: - Import the full project tree: firmware/, firmware-idf/, firmware-rs/, iosApp/, kxkm-bmu-app/, kxkm-api/, hardware/, docs/, specs/, scripts/, models/, tests/ - Keep project dotfiles tracked despite the trailing '.*' ignore rule: .github/, .claude/, .superpowers/, .gitattributes, .markdownlint.json - Extend .gitignore: firmware/src/credentials.h (local secrets, template kept), kxkm-bmu-app/**/build/ (66 MB compiled iOS framework), .remember/ (session data) Impact: the project can now be maintained on the self-hosted Gitea forge with a clean, secret-free initial history.
56 lines
2.2 KiB
Makefile
56 lines
2.2 KiB
Makefile
# Host-compiled Unity tests for ESP-IDF firmware
|
|
# Usage: make all
|
|
|
|
CXX ?= g++
|
|
CXXFLAGS = -Wall -Wextra -DNATIVE_TEST -std=c++17
|
|
UNITY_DIR = unity
|
|
UNITY_SRC = $(UNITY_DIR)/unity.c
|
|
UNITY_INC = -I$(UNITY_DIR)
|
|
BUILD = build
|
|
|
|
# Includes composants partagés (bmu_types.h nécessaire pour certaines suites)
|
|
COMP_INC = -I../components/bmu_types/include
|
|
|
|
TESTS = test_protection test_vrm_topics test_ble_victron test_config_labels test_vedirect_parser test_i2c_bitbang \
|
|
test_balancer_logic test_ble_soh test_health_score test_rint test_snapshot test_victron_gatt test_victron_scan
|
|
BINS = $(addprefix $(BUILD)/,$(TESTS))
|
|
|
|
.PHONY: all clean download_unity run
|
|
|
|
all: download_unity $(BINS) run
|
|
|
|
download_unity:
|
|
@if [ ! -f $(UNITY_DIR)/unity.h ]; then \
|
|
echo "Downloading Unity..."; \
|
|
mkdir -p $(UNITY_DIR); \
|
|
curl -sL https://raw.githubusercontent.com/ThrowTheSwitch/Unity/v2.6.1/src/unity.h -o $(UNITY_DIR)/unity.h; \
|
|
curl -sL https://raw.githubusercontent.com/ThrowTheSwitch/Unity/v2.6.1/src/unity.c -o $(UNITY_DIR)/unity.c; \
|
|
curl -sL https://raw.githubusercontent.com/ThrowTheSwitch/Unity/v2.6.1/src/unity_internals.h -o $(UNITY_DIR)/unity_internals.h; \
|
|
fi
|
|
|
|
# Règle générique : toutes les suites sauf test_ble_soh
|
|
$(BUILD)/%: %/main/*.cpp download_unity
|
|
@mkdir -p $(BUILD)
|
|
$(CXX) $(CXXFLAGS) $(UNITY_INC) $(COMP_INC) -o $@ $< $(UNITY_SRC)
|
|
|
|
# test_ble_soh : entry point app_main() (style ESP-IDF), setUp/tearDown absents
|
|
# On génère un wrapper qui fournit setUp(), tearDown() et main()
|
|
$(BUILD)/test_ble_soh: test_ble_soh/main/test_ble_soh.cpp download_unity
|
|
@mkdir -p $(BUILD)
|
|
@printf 'extern "C" void app_main(void);\nextern "C" void setUp(void) {}\nextern "C" void tearDown(void) {}\nint main(void) { app_main(); return 0; }\n' > $(BUILD)/test_ble_soh_main.cpp
|
|
$(CXX) $(CXXFLAGS) $(UNITY_INC) -o $@ test_ble_soh/main/test_ble_soh.cpp $(BUILD)/test_ble_soh_main.cpp $(UNITY_SRC)
|
|
|
|
run: $(BINS)
|
|
@echo "=== Running all host tests ==="
|
|
@failed=0; \
|
|
for t in $(BINS); do \
|
|
echo "--- $$t ---"; \
|
|
./$$t || failed=1; \
|
|
done; \
|
|
if [ $$failed -ne 0 ]; then echo "SOME TESTS FAILED"; exit 1; fi
|
|
@echo "=== All tests passed ==="
|
|
|
|
clean:
|
|
rm -rf $(BUILD)
|
|
rm -rf $(UNITY_DIR)
|