add Unity unit tests

This commit is contained in:
proddy
2024-08-03 13:22:24 +02:00
parent 8f91394c75
commit 5050d11555
6 changed files with 688 additions and 200 deletions

View File

@@ -261,12 +261,15 @@ lib_ignore = Module EMS-ESP-Modules
; unit tests
; pio run -e native-test -t exec
; works on Linux, Windows, and MacOS
; to auto generate the API exepected test results, compile with -DUNITY_CREATE and capture the output, and paste into the test_api.cpp file
[env:native-test]
platform = native
test_build_src = true
build_flags =
-DARDUINOJSON_ENABLE_ARDUINO_STRING=1
-DEMSESP_STANDALONE -DEMSESP_TEST -DUNITY_INCLUDE_CONFIG_H
-DEMSESP_STANDALONE -DEMSESP_TEST
-DUNITY_INCLUDE_CONFIG_H
; -DUNITY_CREATE
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.0-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
-std=gnu++14 -Os -ggdb -Wall -Wextra -Werror
-lgcov --coverage -fprofile-arcs -ftest-coverage