diff mbox

[PATCHv2,4/5] validation: creating own dir and lib for system

Message ID 1435054119-1216-5-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard June 23, 2015, 10:08 a.m. UTC
Module system now gets its own directory and create its own lib
(currentely only containing its executable)
Note that module system, at this time, only contains time
functionality.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 configure.ac                                    |  1 +
 test/validation/.gitignore                      |  1 -
 test/validation/Makefile.am                     | 10 ++++------
 test/validation/system/.gitignore               |  2 ++
 test/validation/system/Makefile.am              |  8 ++++++++
 test/validation/{odp_time.c => system/system.c} |  9 ++-------
 test/validation/system/system.h                 |  7 +++++++
 test/validation/system/system_main.c            | 12 ++++++++++++
 8 files changed, 36 insertions(+), 14 deletions(-)
 create mode 100644 test/validation/system/.gitignore
 create mode 100644 test/validation/system/Makefile.am
 rename test/validation/{odp_time.c => system/system.c} (92%)
 create mode 100644 test/validation/system/system.h
 create mode 100644 test/validation/system/system_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index f70bafe..d845cb0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -307,6 +307,7 @@  AC_CONFIG_FILES([Makefile
 		 test/validation/common/Makefile
 		 test/validation/crypto/Makefile
 		 test/validation/pktio/Makefile
+		 test/validation/system/Makefile
 		 test/miscellaneous/Makefile
 		 ])
 
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 563eee9..47bf0a9 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -13,6 +13,5 @@  odp_random
 odp_scheduler
 odp_shared_memory
 odp_synchronizers
-odp_time
 odp_timer
 odp_thread
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 237067f..6ac024c 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -16,13 +16,13 @@  EXECUTABLES = odp_buffer \
 	      odp_scheduler \
 	      odp_shared_memory \
 	      odp_synchronizers \
-	      odp_time \
 	      odp_timer \
 	      odp_thread \
 	      odp_ver_abt_log_dbg
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	system/system_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -40,9 +40,6 @@  dist_odp_random_SOURCES = odp_random.c
 dist_odp_scheduler_SOURCES = odp_scheduler.c
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
-odp_time_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		 $(LIB)/libodp.la
-dist_odp_time_SOURCES   = odp_time.c
 dist_odp_timer_SOURCES  = odp_timer.c
 dist_odp_packet_SOURCES = odp_packet.c
 dist_odp_pool_SOURCES = odp_pool.c
@@ -55,6 +52,7 @@  dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
 
 ODP_MODULES = classification \
 	      crypto \
-	      pktio
+	      pktio \
+	      system
 
 SUBDIRS = common $(ODP_MODULES)
diff --git a/test/validation/system/.gitignore b/test/validation/system/.gitignore
new file mode 100644
index 0000000..3646b59
--- /dev/null
+++ b/test/validation/system/.gitignore
@@ -0,0 +1,2 @@ 
+system_main
+libsystem.a
diff --git a/test/validation/system/Makefile.am b/test/validation/system/Makefile.am
new file mode 100644
index 0000000..7226cea
--- /dev/null
+++ b/test/validation/system/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libsystem.a
+libsystem_a_SOURCES = system.c
+
+bin_PROGRAMS = system_main
+dist_system_main_SOURCES = system_main.c
+system_main_LDADD = libsystem.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_time.c b/test/validation/system/system.c
similarity index 92%
rename from test/validation/odp_time.c
rename to test/validation/system/system.c
index f2debb7..5e2d050 100644
--- a/test/validation/odp_time.c
+++ b/test/validation/system/system.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include "odp_cunit_common.h"
+#include "system.h"
 
 #define TOLERANCE 1
 #define BUSY_LOOP_CNT 100
@@ -72,13 +73,7 @@  static CU_SuiteInfo system_suites[] = {
 		 CU_SUITE_INFO_NULL
 };
 
-static int system_main(void)
+int system_main(void)
 {
 	return odp_cunit_run(system_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return system_main();
-}
diff --git a/test/validation/system/system.h b/test/validation/system/system.h
new file mode 100644
index 0000000..59fd468
--- /dev/null
+++ b/test/validation/system/system.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int system_main(void);
diff --git a/test/validation/system/system_main.c b/test/validation/system/system_main.c
new file mode 100644
index 0000000..460b635
--- /dev/null
+++ b/test/validation/system/system_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include "system.h"
+
+int main(void)
+{
+	return system_main();
+}