Skip to main content

Configuration

The macros that enable and configure the framework. More...

Macro Definitions Index​

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED

Enables the deprecated definitions of the µTest++ Testing Framework. More...

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED

Enables the µTest++ Testing Framework. More...

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED

Enables the trace messages of the µTest++ constructors and destructors. More...

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED

Enables the trace messages of the µTest++ member functions. More...

Description​

The macros that enable and configure the framework.

The framework is configured with preprocessor macros. They have no value; only their definition matters:

Where to define them

The application defines the macros; neither the library nor its CMake, meson, and xPack build files define them (the defaultDefine entries in xcdl-package.jsonc are informative only).

The application and the library sources must be compiled with the same MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED macro, otherwise the link fails; the same holds for MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED, for the applications that use the non-inline deprecated members (see the pages of the macros below). The trace macros only add trace calls to the function bodies, and need the micro-os-plus/diag/trace.h header (see the pages of the macros). The simplest way is a header named micro-os-plus/micro-test-plus-defines.h (or micro-os-plus/project-config.h) in the include path of the build: every µTest++ header includes it, if present, before its own definitions.

Guard each definition, so that the macro can also be given on the compiler command line:

 #if !defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
 #define MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED
 #endif // !defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)

A macro given only on the compiler command line (for example -DMICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED) must be given for the whole build, for both the application and the library sources.

The definitions shown on the pages of the macros, with a line number in micro-test-plus.h, exist only for this documentation; the header does not define these macros, and neither does the library.

Macro Definitions​

MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED​

#define MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED

Enables the deprecated definitions of the µTest++ Testing Framework.

This option has no value, only its definition matters.

Without it, the deprecated definitions (the old names of the functions, the classes, and the members, the overloaded operators, the user-defined literals, the value wrappers, and the deprecated overloads and constructors) are neither declared nor defined, so the applications that still use them fail to compile.

With it, they are available, but marked [[deprecated]], so the compiler reports their use; the applications that build with -Werror fail until the deprecated definitions are replaced.

The macro must be defined for the library sources too, otherwise the link of an application that uses the non-inline deprecated members fails with undefined references.

Definition at line 75 of file micro-test-plus.h.

75#define MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED

MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED​

#define MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED

Enables the µTest++ Testing Framework.

This is the main configuration option of this library; it has no value, only its definition matters.

Without it, micro-os-plus/micro-test-plus.h declares nothing and the library sources compile to nothing. If it is defined on the compiler command line for the application, but not for the library sources, the link fails with undefined references.

Definition at line 72 of file micro-test-plus.h.

72#define MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED

MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED​

#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED

Enables the trace messages of the µTest++ constructors and destructors.

Displays trace messages in the constructors and destructors of the µTest++ Testing Framework, through trace::printf(), which writes them only when MICRO_OS_PLUS_DIAG_TRACE_ENABLED is also defined.

The code compiled with this macro includes micro-os-plus/diag/trace.h, of the µOS++ diag-trace package, which must be in the include path of the build; without it, the compilation fails.

Definition at line 74 of file micro-test-plus.h.

74#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED

MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED​

#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED

Enables the trace messages of the µTest++ member functions.

Displays trace messages in the member functions of the µTest++ Testing Framework, through trace::printf(), which writes them only when MICRO_OS_PLUS_DIAG_TRACE_ENABLED is also defined.

The code compiled with this macro includes micro-os-plus/diag/trace.h, of the µOS++ diag-trace package, which must be in the include path of the build; without it, the compilation fails.

Definition at line 73 of file micro-test-plus.h.

73#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED

Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.