Просмотр исходного кода

Fix no traces when testing is enabled

Signed-off-by: Martin Melik Merkumians <martin.melik@gmail.com>
Martin Melik Merkumians 2 месяцев назад
Родитель
Сommit
997d1cdc2e

+ 7 - 4
source/src/ports/MINGW/sample_application/opener_user_conf.h

@@ -172,6 +172,13 @@ typedef unsigned short in_port_t;  // NOLINT(runtime/int)
  */
 static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 
+#ifdef OPENER_WITH_TRACES
+/* If we have tracing enabled provide LOG_TRACE macro */
+#include <stdio.h>
+
+#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
+#endif /* ifdef OPENER_WITH_TRACES */
+
 /*
  * Omit assertion definitions when building unit tests. These will
  * be defined with versions suitable for the unit test environment.
@@ -179,10 +186,6 @@ static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 #ifndef OPENER_UNIT_TEST
 
 #ifdef OPENER_WITH_TRACES
-/* If we have tracing enabled provide LOG_TRACE macro */
-#include <stdio.h>
-
-#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
 
 #ifdef IDLING_ASSERT
 /** @brief A specialized assertion command enabled by IDLING_ASSERT that

+ 7 - 4
source/src/ports/POSIX/sample_application/opener_user_conf.h

@@ -198,6 +198,13 @@
  */
 static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 
+#ifdef OPENER_WITH_TRACES
+/* If we have tracing enabled provide LOG_TRACE macro */
+#include <stdio.h>
+
+#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
+#endif /* ifdef OPENER_WITH_TRACES */
+
 /*
  * Omit assertion definitions when building unit tests. These will
  * be defined with versions suitable for the unit test environment.
@@ -205,10 +212,6 @@ static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 #ifndef OPENER_UNIT_TEST
 
 #ifdef OPENER_WITH_TRACES
-/* If we have tracing enabled provide LOG_TRACE macro */
-#include <stdio.h>
-
-#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
 
 #ifdef IDLING_ASSERT
 /** @brief A specialized assertion command enabled by IDLING_ASSERT that

+ 7 - 4
source/src/ports/STM32/sample_application/opener_user_conf.h

@@ -204,6 +204,13 @@
  */
 static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 
+#ifdef OPENER_WITH_TRACES
+/* If we have tracing enabled provide LOG_TRACE macro */
+#include <stdio.h>
+
+#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
+#endif /* ifdef OPENER_WITH_TRACES */
+
 /*
  * Omit assertion definitions when building unit tests. These will
  * be defined with versions suitable for the unit test environment.
@@ -211,10 +218,6 @@ static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 #ifndef OPENER_UNIT_TEST
 
 #ifdef OPENER_WITH_TRACES
-/* If we have tracing enabled provide LOG_TRACE macro */
-#include <stdio.h>
-
-#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
 
 #ifdef IDLING_ASSERT
 /** @brief A specialized assertion command enabled by IDLING_ASSERT that

+ 7 - 4
source/src/ports/WIN32/sample_application/opener_user_conf.h

@@ -174,6 +174,13 @@ typedef unsigned short in_port_t;  // NOLINT(runtime/int)
  */
 static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 
+#ifdef OPENER_WITH_TRACES
+/* If we have tracing enabled provide LOG_TRACE macro */
+#include <stdio.h>
+
+#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
+#endif /* ifdef OPENER_WITH_TRACES */
+
 /*
  * Omit assertion definitions when building unit tests. These will
  * be defined with versions suitable for the unit test environment.
@@ -181,10 +188,6 @@ static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
 #ifndef OPENER_UNIT_TEST
 
 #ifdef OPENER_WITH_TRACES
-/* If we have tracing enabled provide LOG_TRACE macro */
-#include <stdio.h>
-
-#define LOG_TRACE(...) fprintf(stderr, __VA_ARGS__)
 
 #ifdef IDLING_ASSERT
 /** @brief A specialized assertion command enabled by IDLING_ASSERT that