Skip to content

Instantly share code, notes, and snippets.

@nstansbury
nstansbury / test_runner.cpp
Last active September 23, 2023 08:04
Multiple Unity test suites for PlatformIO
// Place actual test suites outside of primary "test_[folder]" and include them
#include "../mysuite/testsuite_mysuite.cpp"
// #include ... more test suites
int run_testsuites(void) {
testsuite_mysuite::run();
// ... more test suites
return 0;
}
@nstansbury
nstansbury / Properties.cpp
Last active September 21, 2023 09:29
C++ KeyValue pair property variant
/*
A KeyValue pair property variant in C++ for the RaspberryPi RP2040/Arduino/PlatformIO
PropertyType is the base class that describes the underlying property type
PropertyDescriptor is the variant value for that property name
PropertySet is the unique Key/Value set itself
Internally the PropertyDescriptors are stored as std:shared_ptrs so should be thread-safe
To build in PlatformIO add to platformio.ini: