diff mbox

[5/6] validation: creating own dir and lib for system

Message ID 1435924179-30967-6-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 098b46208abf8202765d079a9b1ee4af1bcef504
Headers show

Commit Message

Christophe Milard July 3, 2015, 11:49 a.m. UTC
Module system 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          | 13 +++++--------
 test/validation/system/.gitignore    |  2 ++
 test/validation/system/Makefile.am   |  8 ++++++++
 test/validation/system/system.c      |  9 ++-------
 test/validation/system/system.h      |  7 +++++++
 test/validation/system/system_main.c | 12 ++++++++++++
 8 files changed, 37 insertions(+), 16 deletions(-)
 create mode 100644 test/validation/system/.gitignore
 create mode 100644 test/validation/system/Makefile.am
 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 dbf7d99..f1de998 100644
--- a/configure.ac
+++ b/configure.ac
@@ -319,6 +319,7 @@  AC_CONFIG_FILES([Makefile
 		 test/validation/synchronizers/Makefile
 		 test/validation/thread/Makefile
 		 test/validation/time/Makefile
+		 test/validation/system/Makefile
 		 test/miscellaneous/Makefile
 		 ])
 
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index df4e83a..50a459a 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -1,5 +1,4 @@ 
 *.log
 *.trs
-odp_system
 odp_shared_memory
 odp_timer
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index cbd7f5d..e347633 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -5,11 +5,11 @@  AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
 EXECUTABLES = odp_shared_memory$(EXEEXT) \
-	      odp_timer$(EXEEXT) \
-	      odp_system$(EXEEXT)
+	      odp_timer$(EXEEXT)
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	system/system_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -19,10 +19,6 @@  ODP_CU_COMMON=common/odp_cunit_common.c
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_timer_SOURCES  = odp_timer.c
-odp_system_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		   $(LIB)/libodp.la
-odp_system_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/system
-dist_odp_system_SOURCES  = system/system.c
 
 ODP_MODULES = buffer \
 	      classification \
@@ -38,6 +34,7 @@  ODP_MODULES = buffer \
 	      scheduler \
 	      synchronizers \
 	      thread \
-	      time
+	      time \
+	      system
 
 SUBDIRS = common $(ODP_MODULES)
diff --git a/test/validation/system/.gitignore b/test/validation/system/.gitignore
new file mode 100644
index 0000000..7bb1f81
--- /dev/null
+++ b/test/validation/system/.gitignore
@@ -0,0 +1,2 @@ 
+libsystem.a
+system_main
diff --git a/test/validation/system/Makefile.am b/test/validation/system/Makefile.am
new file mode 100644
index 0000000..f68fe77
--- /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$(EXEEXT)
+dist_system_main_SOURCES = system_main.c
+system_main_LDADD = libsystem.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/system/system.c b/test/validation/system/system.c
index 77afa97..b80fd39 100644
--- a/test/validation/system/system.c
+++ b/test/validation/system/system.c
@@ -8,6 +8,7 @@ 
 #include <odp.h>
 #include "odp_cunit_common.h"
 #include "test_debug.h"
+#include "system.h"
 
 static void system_test_odp_version_numbers(void)
 {
@@ -98,13 +99,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..92618fb
--- /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..5293dc0
--- /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();
+}