From 5adcbe3e8107c4838c6cbb47e50be937b69a286c Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 8 Nov 2022 15:06:50 +1100 Subject: [PATCH] Add readme, fix ignore test --- README.md | 15 +++++++++++++++ src/drivers/test/test_example.cpp | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f14da8b3..a0374480 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,21 @@ idf.py -p /dev/ttyUSB0 -b 115200 flash Remember that you will need to boot your ESP32 into software download mode before you will be able to flash. +# Running tests + +Tests are implemented as a separate application build, located in the `test` +directory. We use Catch2 as our test framework. + +To run them, navigate to the test directory, then build and flash as normal. +Connect to your device via UART, and you will be presented with a terminal +prompt that you may run tests from. + +To add new tests to a components, you must: + 1. Create a `test` subcomponent within that component. See `drivers/test` for + an example of this. + 2. Include the component in the test build and list of testable components, in + `test/CMakeLists.txt`. + # clangd setup A regular build will generate `build/compile_commands.json`, which clangd will diff --git a/src/drivers/test/test_example.cpp b/src/drivers/test/test_example.cpp index 34de41ed..ef90cf8f 100644 --- a/src/drivers/test/test_example.cpp +++ b/src/drivers/test/test_example.cpp @@ -4,6 +4,6 @@ TEST_CASE("Example test case", "[cooltag]") { REQUIRE ( 1 == 1 ); } -TEST_CASE("test that doesn't run", "[cooltag][ignore]") { +TEST_CASE("test that doesn't run", "[cooltag][!mayfail]") { REQUIRE ( 0 == 1 ); }