add target native-test-create

This commit is contained in:
proddy
2025-11-30 15:39:36 +01:00
parent 40fc0fd2f9
commit 9c3521caf2

View File

@@ -214,23 +214,20 @@ lib_ldf_mode = off
lib_deps = lib_deps =
; unit tests ; unit tests
; The code is in ./test/test_api.* ; The test code is in ./test/test_api.cpp and the test_api.h file is created by the native-test-create environment.
; to run use `platformio run -e native-test -t exec`. All tests should PASS. ; to run use `platformio run -e native-test -t exec`. All tests should PASS.
; to update the test results, compile with -DEMSESP_UNITY_CREATE by uncommenting the line below
; then re-run and capture the output between "START - CUT HERE" and "END - CUT HERE" into the test_api.h file
; tip: use https://jsondiff.com/ to compare the expected and actual responses. ; tip: use https://jsondiff.com/ to compare the expected and actual responses.
[env:native-test] [env:native-test]
platform = native platform = native
test_build_src = true test_build_src = true
build_flags = build_flags =
; -DEMSESP_UNITY_CREATE
-DARDUINOJSON_ENABLE_ARDUINO_STRING=1
-DEMSESP_STANDALONE -DEMSESP_TEST
-DEMSESP_UNITY
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.3-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
-std=gnu++17 -Og -ggdb
build_type = debug build_type = debug
build_src_flags = build_src_flags =
-DEMSESP_STANDALONE -DEMSESP_TEST
-DEMSESP_UNITY
-DARDUINOJSON_ENABLE_ARDUINO_STRING=1
-DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.3-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\"
-std=gnu++17 -Og -ggdb
-Wall -Wextra -Wall -Wextra
-Wno-unused-parameter -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-sign-compare -Wno-missing-braces
-Wno-vla-cxx-extension -Wno-tautological-constant-out-of-range-compare -Wno-vla-cxx-extension -Wno-tautological-constant-out-of-range-compare
@@ -260,6 +257,12 @@ lib_deps = Unity
test_testing_command = test_testing_command =
${platformio.build_dir}/${this.__env__}/program ${platformio.build_dir}/${this.__env__}/program
; builds the test cases and creates the test_api.h file
; run with `pio run -e native-test-create -t exec` and capture the output between "START - CUT HERE" and "END - CUT HERE" and paste it into the test_api.h file
[env:native-test-create]
extends = env:native-test
build_flags =
-DEMSESP_UNITY_CREATE
; ;
; Building and testing locally on OS, which we call "standalone" without an ESP32. ; Building and testing locally on OS, which we call "standalone" without an ESP32.
; See https://docs.platformio.org/en/latest/platforms/native.html ; See https://docs.platformio.org/en/latest/platforms/native.html