Skip to content

4 mettre a jour les exemples d'utilisation #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: PlatformIO CI
description: Build the project with PlatformIO for every environment
description: Build the project with PlatformIO

on:
push:
Expand All @@ -13,10 +13,6 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
pio-env: [ "Example1_FastStartup", "Example2_Debug", "Example3_WithWifi", "Example4_HandleCommand"]

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -36,5 +32,5 @@ jobs:
# otherwise compilation might fail to find the just-installed libraries
# - name: Install platformIO libraries
# run: pio lib install
- name: Build PlatformIO Project
run: pio run --environment ${{ matrix.pio-env }}
- name: PlatformIO Build All
run: pio run
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ Can also print array or structure
## Debugger


## Unit Testing

From [official documentation](https://piolabs.com/blog/insights/unit-testing-part-1.html)

Running local unit tests (native unit tests) is not feasible because the library is too tightly integrated with Arduino and FreeRTOS.
We need to setup a remote device to make the pipeline run on it.
File renamed without changes.
File renamed without changes.
42 changes: 22 additions & 20 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

[platformio]
name = ESP32-Helper
description = Librairy for esp32
description = Library for esp32
; Leave default_envs empty so it will build all env
default_envs =
default_envs =
; build_dir = ${PROJECT_DIR}/.pio/build

[env]
Expand All @@ -23,24 +23,26 @@ upload_protocol = esptool
build_type = debug
monitor_filters = esp32_exception_decoder
build_src_filter = +<*>
+<../examples/${PIOENV}/${PIOENV}.cpp>
+<../examples/${PIOENV}/main.cpp>
monitor_speed = 921600
check_tool = clangtidy
check_flags =
clangtidy: --enable=all --fix --format-style=google

[env:Example1_FastStartup]
build_flags =
-D NO_WIFI
;examples

[env:Example2_Debug]
build_flags =
-D NO_WIFI

[env:Example3_WithWifi]
build_flags =
-D WITH_WIFI
; -D WITH_OTA
;upload_protocol = espota
;upload_port = 192.168.137.110

[env:Example4_HandleCommand]
build_flags =
-D NO_WIFI
[env:Debug]
build_flags =
-D NO_WIFI

[env:FastStartup]
build_flags =
-D NO_WIFI

[env:HandleCommand]
build_flags =
-D NO_WIFI

[env:WiFi]
build_flags =
-D WITH_WIFI
18 changes: 18 additions & 0 deletions test/test_template.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <unity.h>

// setup and teardown are executed respectively before and after each test
void setUp(void)
{
// set stuff up here
}

void tearDown(void)
{
// clean stuff up here
}

int main(int argc, char **argv)
{
UNITY_BEGIN();
UNITY_END();
}