-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Test framework improvements #1183
Conversation
and python tests
from python bindings
Hmm, there seems to be some sort of problem when building the It seems as this is not a new problem caused by this PR, but it is rather just showing the problem. #include "buzzer.h"
void appMain()
{
buzzerInit();
} The result is |
I think this is caused by differences in C and C++ linkage. If you want a header file to behave nicely, irrespectively of whether you include it from a C or a C++ source file, you need to put this around all declarations in the header to force C linkage for the functions:
This either has to be done for all your headers that you ever want to include from C++ files, or you need to wrap the
For instance, this patch solves the compilation of diff --git a/examples/app_hello_world-cpp/src/hello_world.cpp b/examples/app_hello_world-cpp/src/hello_world.cpp
index 53de5c7c..d3607164 100644
--- a/examples/app_hello_world-cpp/src/hello_world.cpp
+++ b/examples/app_hello_world-cpp/src/hello_world.cpp
@@ -37,12 +37,12 @@
extern "C"
{
#include "app.h"
-}
-#include "FreeRTOS.h"
-#include "task.h"
+ #include "FreeRTOS.h"
+ #include "task.h"
-#include "debug.h"
+ #include "debug.h"
+}
#define DEBUG_MODULE "HELLOWORLD" |
Thanks @ntamas ! |
This PR aims at improving testability, both in unit tests and the python tests (using python bindings). A secondary goal is also to make it possible to add the kalman estimator to the python bindings which would make it possible to use it in simulations and test.
The main changes include:
ASSERT()
in the firmware is propagated to the test frameworks and fails the test if an assert is falseDEBUG_PRINT()
in the firmware is now printed in the test console outputcf_math.h
works when called from a test@IGNORE_IF_NOT
annotation that prevented some tests from running