Browse Source

Ensure tests are compiled with assertions enabled.

Davin McCall 8 months ago
parent
commit
493f3dcb8c
4 changed files with 15 additions and 0 deletions
  1. 3 0
      src/tests/cptests/cptests.cc
  2. 4 0
      src/tests/envtests.cc
  3. 4 0
      src/tests/proctests.cc
  4. 4 0
      src/tests/tests.cc

+ 3 - 0
src/tests/cptests/cptests.cc

@@ -14,6 +14,9 @@
 #include "../test_procservice.h"
 
 // Control protocol tests.
+#ifdef NDEBUG
+#error "This file must be built with assertions ENABLED!"
+#endif
 
 class control_conn_t_test
 {

+ 4 - 0
src/tests/envtests.cc

@@ -7,6 +7,10 @@
 
 #include "dinit-env.h"
 
+#ifdef NDEBUG
+#error "This file must be built with assertions ENABLED!"
+#endif
+
 void test_env_1()
 {
     using namespace bp_sys;

+ 4 - 0
src/tests/proctests.cc

@@ -15,6 +15,10 @@
 // These tests work mostly by completely mocking out the base_process_service class. The mock
 // implementations can be found in test-baseproc.cc.
 
+#ifdef NDEBUG
+#error "This file must be built with assertions ENABLED!"
+#endif
+
 extern eventloop_t event_loop;
 
 constexpr static auto REG = dependency_type::REGULAR;

+ 4 - 0
src/tests/tests.cc

@@ -7,6 +7,10 @@
 #include "test_service.h"
 #include "baseproc-sys.h"
 
+#ifdef NDEBUG
+#error "This file must be built with assertions ENABLED!"
+#endif
+
 constexpr static auto REG = dependency_type::REGULAR;
 constexpr static auto WAITS = dependency_type::WAITS_FOR;
 constexpr static auto MS = dependency_type::MILESTONE;