core: client API Majestic, modèles et CLI check
- libopenpu : validation VIN, modèles JSON (getAvailableUpdate, devices), classification ecuType -> type/guide, sélection des mises à jour - couche Transport abstraite + implémentation libcurl (proxy env, redirections, streaming, timeout d'inactivité) - tolérance au EOF TLS sans close_notify de la passerelle Majestic, limitée aux corps délimités par la fermeture (ni Content-Length ni chunked) - openpu-cli : check / raw-devices / raw-updates - tests doctest (VIN, parsing, classification, client API avec faux transport), fixtures dont une capture réelle anonymisée (NAC wave 2) - qualité : presets CMake (debug, asan, tidy), .clang-tidy, tools/check.sh (tests, ASan/UBSan, valgrind, clang-tidy, cppcheck) - validé contre l'API réelle sur 3 véhicules (NAC w4, RCC, NAC w2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
This commit is contained in:
1 parent
660a420a3e
commit
95704f9882
28 files changed
+1877
-2
No files matched your search
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
# Full local quality gate: build + tests, ASan/UBSan tests, valgrind, clang-tidy, cppcheck.
|
||||
# usage: tools/check.sh [build-root] (default: ~/build/openpu-check)
|
||||
set -eu
|
||||
|
||||
SRC=$(cd "$(dirname "$0")/.." && pwd)
|
||||
OUT=${1:-"$HOME/build/openpu-check"}
|
||||
|
||||
step() { printf '\n==> %s\n' "$*"; }
|
||||
|
||||
step "debug build + tests"
|
||||
cmake -S "$SRC" -B "$OUT/debug" -G Ninja -DCMAKE_BUILD_TYPE=Debug -DOPENPU_WERROR=ON >/dev/null
|
||||
cmake --build "$OUT/debug"
|
||||
ctest --test-dir "$OUT/debug" --output-on-failure
|
||||
|
||||
step "ASan + UBSan tests"
|
||||
cmake -S "$SRC" -B "$OUT/asan" -G Ninja -DCMAKE_BUILD_TYPE=Debug -DOPENPU_SANITIZE=ON >/dev/null
|
||||
cmake --build "$OUT/asan"
|
||||
UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 ctest --test-dir "$OUT/asan" --output-on-failure
|
||||
|
||||
if command -v valgrind >/dev/null; then
|
||||
step "valgrind memcheck"
|
||||
valgrind --quiet --error-exitcode=1 --leak-check=full --errors-for-leak-kinds=definite \
|
||||
"$OUT/debug/tests/openpu_tests" >/dev/null
|
||||
fi
|
||||
|
||||
if command -v clang-tidy >/dev/null; then
|
||||
step "clang-tidy"
|
||||
# Only our sources; compile_commands.json comes from the debug build.
|
||||
find "$SRC/src" -name '*.cpp' -print0 |
|
||||
xargs -0 clang-tidy -p "$OUT/debug" --quiet --warnings-as-errors='*'
|
||||
fi
|
||||
|
||||
if command -v cppcheck >/dev/null; then
|
||||
step "cppcheck"
|
||||
cppcheck --quiet --error-exitcode=1 --std=c++17 --enable=warning,performance,portability \
|
||||
--inline-suppr --suppress=missingIncludeSystem -I "$SRC/src/core/include" "$SRC/src"
|
||||
fi
|
||||
|
||||
step "all checks passed"
|
||||
Reference in new issue
Block a user