Hello,
I’m relatively new to the platformio world, and I’m struggling to build some unit tests for my esp8266 code.
My intention is to build several sets of test cases, in order to exercise part of my code before deployment on hardware.
In order to review the tests, I need to use the json output from the test, and here is where I’m struggling to:
my platformio.ini is
[platformio]
default_envs = native, esp8266, unity
…
[env:unity]
test_framework = unity
platform = native
lib_ldf_mode = deep+
test_build_src = false
test_filter = test_unity
;test_testing_command =
; pio test
; --environment ${this.__env__}
; --json-output-path=/test/logs
; --verbose
build_flags =
-g
-O0
-v
-Itest/native
-Itest/include
-Ilib
-Iinclude
-Iinclude/interfaces
-Iinclude/templates
-std=c++17
-mconsole
-Wl,--subsystem,console
And my test code, for this test, is pretty simple, just to exercise the pio test command and make sure all parameters are correct.
[project dir]/test
├───include
│ json.hpp
│
├───logs
│
└───test_unity
│ test_main.cpp
│
└───Basic_Test
Basic_Test_010.cpp
What I’m struggling is to define a proper platformio.ini so executing
pio test --environment unity
generates a json log in /test/logs.
I tried several combinations, last of all uncommenting these lines in platformio.ini
;test_testing_command =
; pio test
; --environment ${this.__env__}
; --json-output-path=/test/logs
; --verbose
without success.
Please help. I want to avoid as much as possible to add –json-output-path to my command line.
thanks,
