summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-11-08 15:06:50 +1100
committerjacqueline <me@jacqueline.id.au>2022-11-08 15:06:50 +1100
commit5adcbe3e8107c4838c6cbb47e50be937b69a286c (patch)
tree422528bd63485037aba980db2b67a45082dff00d
parent9f572cb92738c2f6d435f47fef9bad7344bc6e09 (diff)
downloadtangara-fw-5adcbe3e8107c4838c6cbb47e50be937b69a286c.tar.gz
Add readme, fix ignore test
-rw-r--r--README.md15
-rw-r--r--src/drivers/test/test_example.cpp2
2 files changed, 16 insertions, 1 deletions
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 );
}