diff options
Diffstat (limited to 'tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/call_before_main/main.cpp')
-rw-r--r-- | tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/call_before_main/main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/call_before_main/main.cpp b/tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/call_before_main/main.cpp new file mode 100644 index 0000000000..7b3bac203f --- /dev/null +++ b/tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/call_before_main/main.cpp @@ -0,0 +1,21 @@ +#include "test_env.h" + +namespace { + bool mbed_main_called = false; +} + +extern "C" void mbed_main() { + printf("MBED: mbed_main() call before main()\r\n"); + mbed_main_called = true; +} + +int main() { + MBED_HOSTTEST_TIMEOUT(20); + MBED_HOSTTEST_SELECT(default_auto); + MBED_HOSTTEST_DESCRIPTION(Call function mbed_main before main); + MBED_HOSTTEST_START("MBED_A21"); + + printf("MBED: main() starts now!\r\n"); + + MBED_HOSTTEST_RESULT(mbed_main_called); +} |