[Libguestfs] [PATCH libnbd 1/3] tests: Don't use <config.h> in simple compile tests.

Richard W.M. Jones rjones at redhat.com
Thu Mar 12 22:46:55 UTC 2020


For these simple compile tests where we want to ensure that a basic
external program could be compiled using libnbd, we shouldn't include
<config.h>.  This is because we want to test here that <libnbd.h> can
stand alone, without needing anything defined by the GNU autotools
infrastructure.

Of course we can use <config.h> in other test programs where we aren't
evaluating if <libnbd.h> works standalone.
---
 tests/compile-ansi-c.c | 2 --
 tests/compile-cxx.cpp  | 2 --
 tests/compile.c        | 2 --
 3 files changed, 6 deletions(-)

diff --git a/tests/compile-ansi-c.c b/tests/compile-ansi-c.c
index 0d48618..82e1976 100644
--- a/tests/compile-ansi-c.c
+++ b/tests/compile-ansi-c.c
@@ -20,8 +20,6 @@
  * compiler.
  */
 
-#include <config.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 
diff --git a/tests/compile-cxx.cpp b/tests/compile-cxx.cpp
index 4c8447c..f24d409 100644
--- a/tests/compile-cxx.cpp
+++ b/tests/compile-cxx.cpp
@@ -22,8 +22,6 @@
 #error "this test should be compiled with a C++ compiler"
 #endif
 
-#include <config.h>
-
 #include <iostream>
 #include <cstdlib>
 
diff --git a/tests/compile.c b/tests/compile.c
index d7ef98c..b23cf81 100644
--- a/tests/compile.c
+++ b/tests/compile.c
@@ -18,8 +18,6 @@
 
 /* Compile, open and close a handle. */
 
-#include <config.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 
-- 
2.25.0




More information about the Libguestfs mailing list