Skip to content

Commit 77f1f11

Browse files
committed
Rework and simplify PlatformIO build configuration.
- Merge common parts. - Do not use separate configurations for each test.
1 parent fc7e164 commit 77f1f11

1 file changed

Lines changed: 17 additions & 77 deletions

File tree

platformio.ini

Lines changed: 17 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,45 @@
1-
; PlatformIO Project Configuration File
2-
;
3-
; Please visit documentation for the other options and examples
4-
; https://docs.platformio.org/page/projectconf.html
5-
6-
;-------------------------------------------------------
7-
; global PIO parameters |
8-
;-------------------------------------------------------
91
[platformio]
10-
;default build enfironment for PIO project
112
default_envs = esp32-s3-devkitc-1
123

13-
;Path to source files relative to PIO project
14-
; see https://docs.platformio.org/en/stable/projectconf/sections/platformio/options/directory/src_dir.html
15-
src_dir = src
16-
17-
;switch "include" path to be src as well, as we decide to have headers and sources in same directories
18-
; this prevents the build environment from complaining the path not existing
19-
include_dir = src
20-
21-
;-------------------------------------------------------
22-
; common parameters for all environments [env:...] |
23-
;-------------------------------------------------------
244
[env]
25-
;filter for source file directory when building
26-
; see https://docs.platformio.org/en/stable/projectconf/sections/env/options/build/build_src_filter.html
27-
build_src_filter = +<*> -<.git/> -<.svn/>
5+
build_flags =
6+
-std=gnu++17 ; necessary for using modern STL
7+
-Werror=return-type ; consider missing return information as fatal error
8+
-Werror=overflow
9+
build_unflags = -std=gnu++11 ; necessary to be able to specify a different language standard
2810

29-
;general dependencies
30-
; for version requirements see https://docs.platformio.org/en/stable/core/userguide/pkg/cmd_install.html#cmd-pkg-install-requirements
11+
[production]
12+
extends = env
3113
lib_deps =
3214
adafruit/Adafruit SSD1306@~2.5.3
3315
lvgl@^8.3
34-
; adding local library as dependency is necessary as it does not have any include files. This is because nothing should depend from this layer.
3516
3rd_party_adapters ; this is necessary as no source code dependency shall exist to that packet
3617
lib_ldf_mode = deep ; to automatically detect nested dependencies (for external libraries)
3718
build_flags =
19+
${env.build_flags}
3820
-DLV_CONF_PATH="${PROJECT_DIR}/lib/3rd_party_adapters/LVGL/lv_conf.h" ; lvgl: use this config file
39-
-std=gnu++17 ; necessary for using modern STL
40-
-Werror=return-type ; consider missing return information as fatal error
41-
build_unflags = -std=gnu++11 ; necessary to be able to specify a different language standard
21+
-DBAUD_RATE=${this.monitor_speed}
4222
monitor_speed = 115200
43-
monitor_filters = esp32_exception_decoder
44-
build_type = debug
4523

46-
; Template section for tests to be run on native platform.
47-
[test_native]
48-
build_type = debug
24+
[env:native]
4925
platform = native
5026
lib_deps =
5127
unity
5228
ArduinoFake
53-
lib_ldf_mode = chain ; automatically detect dependencies but to not recurse into other components
29+
utilities
30+
lib_ldf_mode = chain ; to simplify mocking, do not use deep mode
5431
build_flags =
32+
${env.build_flags}
5533
-Wno-deprecated ; Workaround for https://github.com/FabioBatSilva/ArduinoFake/pull/41#issuecomment-1440550553
56-
-Werror=overflow
57-
-D unitTesting
5834
-lgcov
5935
--coverage
6036
-fprofile-abs-path
61-
-std=gnu++17 ; necessary for using modern STL
62-
-O0 -ggdb3
63-
build_unflags = -std=gnu++11
37+
-O0
38+
-ggdb3
6439

65-
;-------------------------------------------------------
66-
; ESP32 build environment |
67-
;-------------------------------------------------------
6840
[env:esp32-s3-devkitc-1]
6941
platform = espressif32
7042
board = esp32-s3-devkitc-1
7143
framework = arduino
72-
;;add dependencies to general dependencies from [env]
73-
; lib_deps =
74-
; ${env.lib_deps}
75-
76-
; We have individual test enviroments, as this allows us to define different
77-
; include paths (lib_deps) per test.
78-
; And this in turn allwos us to mock different parts of the software for each test.
79-
[env:test_native_tasks]
80-
extends = test_native
81-
test_filter = test_tasks
82-
lib_deps =
83-
${test_native.lib_deps}
84-
utilities
85-
86-
[env:test_native_cli]
87-
extends = test_native
88-
test_filter = test_cli
89-
debug_test = test_cli
90-
lib_deps =
91-
${test_native.lib_deps}
92-
93-
[env:test_native_string_helpers]
94-
extends = test_native
95-
test_filter = test_string_helpers
96-
debug_test = test_string_helpers
97-
98-
[env:test_native_hmi]
99-
extends = test_native
100-
test_filter = hmi/*
101-
lib_deps =
102-
${test_native.lib_deps}
103-
application_business_rules
104-
board_adapters
105-
utilities
44+
extends = production
45+
monitor_filters = esp32_exception_decoder

0 commit comments

Comments
 (0)