mirror of
https://github.com/ratspeak/microReticulum
synced 2026-11-27 13:52:14 +00:00
WIP: Integrated Unity test framework.
This commit is contained in:
1 parent
b28962aaa9
commit
bac53b9e6d
7 files changed
+507
-132
No files matched your search
@@ -0,0 +1,43 @@
|
||||
#include <unity.h>
|
||||
|
||||
void setUp(void) {
|
||||
// set stuff up here before each test
|
||||
}
|
||||
|
||||
void tearDown(void) {
|
||||
// clean stuff up here after each test
|
||||
}
|
||||
|
||||
void testExample() {
|
||||
bool success = true;
|
||||
TEST_ASSERT_EQUAL(true, success);
|
||||
}
|
||||
|
||||
|
||||
int runUnityTests(void) {
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(testExample);
|
||||
return UNITY_END();
|
||||
}
|
||||
|
||||
// For native dev-platform or for some embedded frameworks
|
||||
int main(void) {
|
||||
return runUnityTests();
|
||||
}
|
||||
|
||||
#ifdef ARDUINO
|
||||
// For Arduino framework
|
||||
void setup() {
|
||||
// Wait ~2 seconds before the Unity test runner
|
||||
// establishes connection with a board Serial interface
|
||||
delay(2000);
|
||||
|
||||
runUnityTests();
|
||||
}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
||||
// For ESP-IDF framework
|
||||
void app_main() {
|
||||
runUnityTests();
|
||||
}
|
||||
Reference in new issue
Block a user