1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/cpp_ctors
Francisco Molina 416c048737 tests: add test_utils_interactive_sync when possible
- Define test_utils_interactive_sync as DEFAULT_MODULE in Makefile.tests_common
- For tests disabling autoinit, add test_utils_interactive_sync to main
- Add DISABLE_MODULE += test_utils_interactive_sync for tests requiring
  sudo,  `tests/shell`, `tests/minimal` and `tests/stdin`
- Add shell_commands to tests/periph_wdt and tests/struct_tm_utility to
  pull `r` and `s` commands
- Remove includes and usage in `tests/main.c` for tests that where
  already using test_utils_interactive_sync
2019-11-27 15:07:42 +01:00
..
tests tests/cpp_ctors: move tests-cpp_ctors out of unittests 2019-08-22 12:39:47 +02:00
main.c tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
Makefile tests/cpp_ctors: move tests-cpp_ctors out of unittests 2019-08-22 12:39:47 +02:00
Makefile.ci tests: add stm32f030f4-demo to Makefile.ci 2019-10-21 15:33:11 +02:00
README.md tests/cpp_ctors: move tests-cpp_ctors out of unittests 2019-08-22 12:39:47 +02:00
tests-cpp_ctors-class.cpp tests/cpp_ctors: move tests-cpp_ctors out of unittests 2019-08-22 12:39:47 +02:00
tests-cpp_ctors.cpp tests/cpp_ctors: move tests-cpp_ctors out of unittests 2019-08-22 12:39:47 +02:00
tests-cpp_ctors.h tests/cpp_ctors: move tests-cpp_ctors out of unittests 2019-08-22 12:39:47 +02:00

The purpose of this test is to ensure that C++ constructors are executed properly during the startup of RIOT. This requires that the port calls constructors somewhere during C-library initialization. On newlib ports this is done by __libc_init_array(), other ports may need to manually iterate through the list of initializer functions (usually .init_array), and call each one in order.

There are three tests:

  • Global constructor
  • Static constructor
  • Local constructor

The global constructor test checks to see if the constructor of a global object has been run during the boot process. The static constructor test does the same, but for static object inside a function. The local constructor test checks that a locally created object does have its constructor run. The local constructor test will only fail if there is a significant problem with the C++ tool chain, since it does not rely on any external C++ support code.