]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: fix unit tests to build with -NTP and -CMDMON
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 27 Feb 2020 07:29:58 +0000 (08:29 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 5 Mar 2020 15:02:15 +0000 (16:02 +0100)
test/unit/clientlog.c
test/unit/keys.c

index a412b697e88a3e478757001062498a8556f1b1b4..6f0babb7a7fdee61c3bda3e342252da9960bd612 100644 (file)
  **********************************************************************
  */
 
-#include <clientlog.c>
+#include <config.h>
 #include "test.h"
 
+#if defined(FEAT_NTP) || defined(FEAT_CMDMON)
+
+#include <clientlog.c>
+
 void
 test_unit(void)
 {
@@ -82,3 +86,10 @@ test_unit(void)
   CLG_Finalise();
   CNF_Finalise();
 }
+#else
+void
+test_unit(void)
+{
+  TEST_REQUIRE(0);
+}
+#endif
index a7873388f28c20779edd99e9dfa21281a8a2039e..9c69b4a17483d92a201f98d68f59d8a0017ad38f 100644 (file)
  **********************************************************************
  */
 
-#include <keys.c>
+#include <config.h>
 #include "test.h"
 
+#if defined(FEAT_NTP) || defined(FEAT_CMDMON)
+
+#include <keys.c>
+
 #define KEYS 100
 #define KEYFILE "keys.test-keys"
 
@@ -157,3 +161,10 @@ test_unit(void)
   CNF_Finalise();
   HSH_Finalise();
 }
+#else
+void
+test_unit(void)
+{
+  TEST_REQUIRE(0);
+}
+#endif