diff mbox

[3/3] validation: creating own dir and lib for random

Message ID 1431341307-9933-4-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard May 11, 2015, 10:48 a.m. UTC
Module random now gets its own directory and create its own lib
(currentely only containing its executable)

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 configure.ac                                      |  1 +
 test/validation/.gitignore                        |  1 -
 test/validation/Makefile.am                       |  9 +++++----
 test/validation/random/.gitignore                 |  4 ++++
 test/validation/random/Makefile.am                | 12 ++++++++++++
 test/validation/{odp_random.c => random/random.c} |  9 ++-------
 test/validation/random/random.h                   |  7 +++++++
 test/validation/random/random_main.c              | 12 ++++++++++++
 8 files changed, 43 insertions(+), 12 deletions(-)
 create mode 100644 test/validation/random/.gitignore
 create mode 100644 test/validation/random/Makefile.am
 rename test/validation/{odp_random.c => random/random.c} (82%)
 create mode 100644 test/validation/random/random.h
 create mode 100644 test/validation/random/random_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index d20bad2..60b6ec7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -284,6 +284,7 @@  AC_CONFIG_FILES([Makefile
 		 test/api_test/Makefile
 		 test/performance/Makefile
 		 test/validation/Makefile
+		 test/validation/random/Makefile
 		 test/miscellaneous/Makefile
 		 ])
 
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 34ea143..881790c 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -12,7 +12,6 @@  odp_packet
 odp_pktio
 odp_pool
 odp_queue
-odp_random
 odp_scheduler
 odp_shared_memory
 odp_synchronizers
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 6ddda79..70e4706 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -15,7 +15,6 @@  EXECUTABLES = odp_buffer \
 	      odp_packet \
 	      odp_pool \
 	      odp_queue \
-	      odp_random \
 	      odp_scheduler \
 	      odp_shared_memory \
 	      odp_synchronizers \
@@ -29,7 +28,8 @@  COMPILE_ONLY = odp_pktio
 TESTSCRIPTS = odp_pktio_run
 
 if test_vald
-TESTS = $(EXECUTABLES) $(TESTSCRIPTS)
+TESTS = random/random_main \
+	$(EXECUTABLES) $(TESTSCRIPTS)
 endif
 
 dist_bin_SCRIPTS = odp_pktio_run
@@ -51,8 +51,6 @@  dist_odp_init_SOURCES	= odp_init.c
 dist_odp_init_abort_SOURCES = odp_init_abort.c
 dist_odp_init_log_SOURCES = odp_init_log.c
 dist_odp_queue_SOURCES	= odp_queue.c $(ODP_CU_COMMON)
-odp_random_CFLAGS = $(AM_CFLAGS) -DMODULE_HAS_OWN_MAIN
-dist_odp_random_SOURCES = odp_random.c $(ODP_CU_COMMON)
 dist_odp_scheduler_SOURCES = odp_scheduler.c $(ODP_CU_COMMON)
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c $(ODP_CU_COMMON)
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c $(ODP_CU_COMMON)
@@ -67,3 +65,6 @@  odp_ver_abt_log_dbg_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/ver_abt_log_dbg
 dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
 				    ver_abt_log_dbg/odp_errno.c \
                                     ver_abt_log_dbg/odp_ver_abt_log_dbg.c $(ODP_CU_COMMON)
+
+ODP_MODULES = random
+SUBDIRS = $(ODP_MODULES)
diff --git a/test/validation/random/.gitignore b/test/validation/random/.gitignore
new file mode 100644
index 0000000..085c44a
--- /dev/null
+++ b/test/validation/random/.gitignore
@@ -0,0 +1,4 @@ 
+*.log
+*.trs
+librandom.a
+random_main
diff --git a/test/validation/random/Makefile.am b/test/validation/random/Makefile.am
new file mode 100644
index 0000000..37895d8
--- /dev/null
+++ b/test/validation/random/Makefile.am
@@ -0,0 +1,12 @@ 
+include $(top_srcdir)/test/Makefile.inc
+
+AM_CFLAGS += -I$(top_srcdir)/test/validation/common
+AM_LDFLAGS += -static
+
+noinst_LIBRARIES = librandom.a
+librandom_a_CFLAGS = $(AM_CFLAGS) -DMODULE_HAS_OWN_MAIN
+librandom_a_SOURCES = random.c ../common/odp_cunit_common.c
+
+check_PROGRAMS = random_main
+dist_random_main_SOURCES = random_main.c
+random_main_LDADD = librandom.a $(LIB)/libodp.la
diff --git a/test/validation/odp_random.c b/test/validation/random/random.c
similarity index 82%
rename from test/validation/odp_random.c
rename to test/validation/random/random.c
index cefc52d..a42523f 100644
--- a/test/validation/odp_random.c
+++ b/test/validation/random/random.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include <odp_cunit_common.h>
+#include "random.h"
 
 /* Helper macro for CU_TestInfo initialization */
 #define _CU_TEST_INFO(test_func) {#test_func, test_func}
@@ -29,13 +30,7 @@  static CU_SuiteInfo random_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int random_main(void)
+int random_main(void)
 {
 	return odp_cunit_run(random_suites);
 }
-
-/* the following main function will be seperated when lib is created */
-int main(void)
-{
-	return random_main();
-}
diff --git a/test/validation/random/random.h b/test/validation/random/random.h
new file mode 100644
index 0000000..c40ee1f
--- /dev/null
+++ b/test/validation/random/random.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int random_main(void);
diff --git a/test/validation/random/random_main.c b/test/validation/random/random_main.c
new file mode 100644
index 0000000..36b32f7
--- /dev/null
+++ b/test/validation/random/random_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include "random.h"
+
+int main(void)
+{
+	return random_main();
+}