Consolidate test routine declarations in test.h.
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
builtin-bat.c | 4 +---
builtin-test.c | 5 +----
lib/blk_namespaces.c | 2 +-
lib/pmem_namespaces.c | 2 +-
lib/test-core.c | 2 +-
lib/test-core.h | 10 ----------
lib/test-dpa-alloc.c | 3 +--
lib/test-libndctl.c | 3 +--
lib/test-parent-uuid.c | 3 +--
lib/test-pcommit.c | 2 +-
test-blk-namespaces.h | 4 ----
test-dpa-alloc.h | 5 -----
test-libndctl.h | 5 -----
test-parent-uuid.h | 5 -----
test-pcommit.h | 4 ----
test-pmem-namespaces.h | 4 ----
test.h | 22 ++++++++++++++++++++++
17 files changed, 31 insertions(+), 54 deletions(-)
delete mode 100644 lib/test-core.h
delete mode 100644 test-blk-namespaces.h
delete mode 100644 test-dpa-alloc.h
delete mode 100644 test-libndctl.h
delete mode 100644 test-parent-uuid.h
delete mode 100644 test-pcommit.h
delete mode 100644 test-pmem-namespaces.h
create mode 100644 test.h
diff --git a/builtin-bat.c b/builtin-bat.c
index e79a55d21fb1..14ef08b756b1 100644
--- a/builtin-bat.c
+++ b/builtin-bat.c
@@ -1,8 +1,6 @@
#include <stdio.h>
#include <syslog.h>
-#include <test-pcommit.h>
-#include <test-blk-namespaces.h>
-#include <test-pmem-namespaces.h>
+#include <test.h>
#include <util/parse-options.h>
int cmd_bat(int argc, const char **argv)
diff --git a/builtin-test.c b/builtin-test.c
index edb6e072174e..9c3b7a827128 100644
--- a/builtin-test.c
+++ b/builtin-test.c
@@ -1,10 +1,7 @@
#include <stdio.h>
#include <limits.h>
#include <syslog.h>
-#include <test-core.h>
-#include <test-libndctl.h>
-#include <test-dpa-alloc.h>
-#include <test-parent-uuid.h>
+#include <test.h>
#include <util/parse-options.h>
static char *result(int rc)
diff --git a/lib/blk_namespaces.c b/lib/blk_namespaces.c
index 1bea7bdb07b0..968af2797feb 100644
--- a/lib/blk_namespaces.c
+++ b/lib/blk_namespaces.c
@@ -25,7 +25,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <uuid/uuid.h>
-#include <test-blk-namespaces.h>
+#include <test.h>
/* The purpose of this test is to verify that we can successfully do I/O to
* multiple nd_blk namespaces that have discontiguous segments. It first
diff --git a/lib/pmem_namespaces.c b/lib/pmem_namespaces.c
index 28b582026677..17c301947fa4 100644
--- a/lib/pmem_namespaces.c
+++ b/lib/pmem_namespaces.c
@@ -25,7 +25,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <uuid/uuid.h>
-#include <test-pmem-namespaces.h>
+#include <test.h>
#define err(msg)\
fprintf(stderr, "%s:%d: %s (%s)\n", __func__, __LINE__, msg, strerror(errno))
diff --git a/lib/test-core.c b/lib/test-core.c
index 4733e0fb424e..93d02d899622 100644
--- a/lib/test-core.c
+++ b/lib/test-core.c
@@ -1,7 +1,7 @@
#include <linux/version.h>
-#include <test-core.h>
#include <stdlib.h>
#include <stdio.h>
+#include <test.h>
#define KVER_STRLEN 20
diff --git a/lib/test-core.h b/lib/test-core.h
deleted file mode 100644
index 9129871be43e..000000000000
--- a/lib/test-core.h
+++ /dev/null
@@ -1,10 +0,0 @@
-struct ndctl_test;
-struct ndctl_test *ndctl_test_new(unsigned int kver);
-int ndctl_test_result(struct ndctl_test *test, int rc);
-int ndctl_test_get_skipped(struct ndctl_test *test);
-int ndctl_test_get_attempted(struct ndctl_test *test);
-int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver,
- const char *caller, int line);
-#define ndctl_test_attempt(t, v) __ndctl_test_attempt(t, v, __func__, __LINE__)
-void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line);
-#define ndctl_test_skip(t) __ndctl_test_skip(t, __func__, __LINE__)
diff --git a/lib/test-dpa-alloc.c b/lib/test-dpa-alloc.c
index dab3b882757e..6fa88cc095ea 100644
--- a/lib/test-dpa-alloc.c
+++ b/lib/test-dpa-alloc.c
@@ -23,10 +23,9 @@
#include <libkmod.h>
#include <uuid/uuid.h>
-#include <test-core.h>
+#include <test.h>
#include <linux/version.h>
#include <ndctl/libndctl.h>
-#include <test-dpa-alloc.h>
#include <ccan/array_size/array_size.h>
#ifdef HAVE_NDCTL_H
diff --git a/lib/test-libndctl.c b/lib/test-libndctl.c
index b7c85371ee07..616b0beec878 100644
--- a/lib/test-libndctl.c
+++ b/lib/test-libndctl.c
@@ -32,8 +32,7 @@
#else
#include <ndctl.h>
#endif
-#include <test-libndctl.h>
-#include <test-core.h>
+#include <test.h>
#define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
#define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
diff --git a/lib/test-parent-uuid.c b/lib/test-parent-uuid.c
index 4f48717ca0f7..042ea6ba5a6d 100644
--- a/lib/test-parent-uuid.c
+++ b/lib/test-parent-uuid.c
@@ -25,8 +25,7 @@
#include <libkmod.h>
#include <uuid/uuid.h>
#include <linux/version.h>
-#include <test-core.h>
-#include <test-parent-uuid.h>
+#include <test.h>
#include <ndctl/libndctl.h>
diff --git a/lib/test-pcommit.c b/lib/test-pcommit.c
index f40052f169b6..afe4fde44d22 100644
--- a/lib/test-pcommit.c
+++ b/lib/test-pcommit.c
@@ -15,7 +15,7 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#include <test-pcommit.h>
+#include <test.h>
#define err(msg)\
fprintf(stderr, "%s:%d: %s (%s)\n", __func__, __LINE__, msg, strerror(errno))
diff --git a/test-blk-namespaces.h b/test-blk-namespaces.h
deleted file mode 100644
index 85e62e433e33..000000000000
--- a/test-blk-namespaces.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __TEST_BLK_NAMESPACES__
-#define __TEST_BLK_NAMESPACES__
-int test_blk_namespaces(int loglevel);
-#endif
diff --git a/test-dpa-alloc.h b/test-dpa-alloc.h
deleted file mode 100644
index f1145f4d278d..000000000000
--- a/test-dpa-alloc.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef __TEST_DPA_ALLOC__
-#define __TEST_DPA_ALLOC__
-struct ndctl_test;
-int test_dpa_alloc(int loglevel, struct ndctl_test *test);
-#endif
diff --git a/test-libndctl.h b/test-libndctl.h
deleted file mode 100644
index 20c5db816a29..000000000000
--- a/test-libndctl.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef __TEST_LIBNDCTL__
-#define __TEST_LIBNDCTL__
-struct ndctl_test;
-int test_libndctl(int loglevel, struct ndctl_test *test);
-#endif
diff --git a/test-parent-uuid.h b/test-parent-uuid.h
deleted file mode 100644
index 585f1825ee27..000000000000
--- a/test-parent-uuid.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef __TEST_PARENT_UUID__
-#define __TEST_PARENT_UUID__
-struct ndctl_test;
-int test_parent_uuid(int loglevel, struct ndctl_test *test);
-#endif
diff --git a/test-pcommit.h b/test-pcommit.h
deleted file mode 100644
index 27e788d3adf6..000000000000
--- a/test-pcommit.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __TEST_PCOMMIT__
-#define __TEST_PCOMMIT__
-int test_pcommit(void);
-#endif
diff --git a/test-pmem-namespaces.h b/test-pmem-namespaces.h
deleted file mode 100644
index 68eb30be3a36..000000000000
--- a/test-pmem-namespaces.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __TEST_PMEM_NAMESPACES__
-#define __TEST_PMEM_NAMESPACES__
-int test_pmem_namespaces(int loglevel);
-#endif
diff --git a/test.h b/test.h
new file mode 100644
index 000000000000..d58dc8874dda
--- /dev/null
+++ b/test.h
@@ -0,0 +1,22 @@
+#ifndef __TEST_H__
+#define __TEST_H__
+struct ndctl_test;
+struct ndctl_test;
+struct ndctl_test *ndctl_test_new(unsigned int kver);
+int ndctl_test_result(struct ndctl_test *test, int rc);
+int ndctl_test_get_skipped(struct ndctl_test *test);
+int ndctl_test_get_attempted(struct ndctl_test *test);
+int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver,
+ const char *caller, int line);
+#define ndctl_test_attempt(t, v) __ndctl_test_attempt(t, v, __func__, __LINE__)
+void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line);
+#define ndctl_test_skip(t) __ndctl_test_skip(t, __func__, __LINE__)
+
+int test_parent_uuid(int loglevel, struct ndctl_test *test);
+int test_direct_io(int loglevel, struct ndctl_test *test);
+int test_dpa_alloc(int loglevel, struct ndctl_test *test);
+int test_libndctl(int loglevel, struct ndctl_test *test);
+int test_blk_namespaces(int loglevel);
+int test_pmem_namespaces(int loglevel);
+int test_pcommit(void);
+#endif /* __TEST_H__ */