diff mbox

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

Message ID 1436364701-27420-5-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 7f74c8931ab11bfaf0600a463b7341c82fd3c1f7
Headers show

Commit Message

Christophe Milard July 8, 2015, 2:11 p.m. UTC
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 configure.ac                                   |  1 +
 test/validation/.gitignore                     |  1 -
 test/validation/Makefile.am                    | 12 ++----------
 test/validation/timer/.gitignore               |  2 ++
 test/validation/timer/Makefile.am              |  8 ++++++++
 test/validation/{odp_timer.c => timer/timer.c} |  9 ++-------
 test/validation/timer/timer.h                  |  7 +++++++
 test/validation/timer/timer_main.c             | 12 ++++++++++++
 8 files changed, 34 insertions(+), 18 deletions(-)
 create mode 100644 test/validation/timer/.gitignore
 create mode 100644 test/validation/timer/Makefile.am
 rename test/validation/{odp_timer.c => timer/timer.c} (99%)
 create mode 100644 test/validation/timer/timer.h
 create mode 100644 test/validation/timer/timer_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 05719a2..e32a6fa 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/timer/Makefile
 		 test/validation/shmem/Makefile
 		 test/validation/system/Makefile
 		 test/miscellaneous/Makefile
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 1a5eb04..7e563b8 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -1,3 +1,2 @@ 
 *.log
 *.trs
-odp_timer
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 470350c..f79f9f1 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -1,23 +1,14 @@ 
-PRE_LDADD = $(top_builddir)/test/validation/common/libcunit_common_as_main.a
-include $(top_srcdir)/test/Makefile.inc
-
 AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
-EXECUTABLES = odp_timer$(EXEEXT)
-
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = timer/timer_main
 endif
 
-bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
 
 ODP_CU_COMMON=common/odp_cunit_common.c
 
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
-odp_timer_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
-		  $(LIB)/libodp.la
-dist_odp_timer_SOURCES  = odp_timer.c
 
 ODP_MODULES = buffer \
 	      classification \
@@ -34,6 +25,7 @@  ODP_MODULES = buffer \
 	      synchronizers \
 	      thread \
 	      time \
+	      timer \
 	      shmem \
 	      system
 
diff --git a/test/validation/timer/.gitignore b/test/validation/timer/.gitignore
new file mode 100644
index 0000000..56792c4
--- /dev/null
+++ b/test/validation/timer/.gitignore
@@ -0,0 +1,2 @@ 
+timer_main
+libtimer.a
diff --git a/test/validation/timer/Makefile.am b/test/validation/timer/Makefile.am
new file mode 100644
index 0000000..0db4986
--- /dev/null
+++ b/test/validation/timer/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libtimer.a
+libtimer_a_SOURCES = timer.c
+
+bin_PROGRAMS = timer_main$(EXEEXT)
+dist_timer_main_SOURCES = timer_main.c
+timer_main_LDADD = libtimer.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_timer.c b/test/validation/timer/timer.c
similarity index 99%
rename from test/validation/odp_timer.c
rename to test/validation/timer/timer.c
index 754bc1e..492d52f 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/timer/timer.c
@@ -14,6 +14,7 @@ 
 #include <odp.h>
 #include "odp_cunit_common.h"
 #include "test_debug.h"
+#include "timer.h"
 
 /** @private Timeout range in milliseconds (ms) */
 #define RANGE_MS 2000
@@ -541,13 +542,7 @@  static CU_SuiteInfo timer_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int timer_main(void)
+int timer_main(void)
 {
 	return odp_cunit_run(timer_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return timer_main();
-}
diff --git a/test/validation/timer/timer.h b/test/validation/timer/timer.h
new file mode 100644
index 0000000..b18af80
--- /dev/null
+++ b/test/validation/timer/timer.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int timer_main(void);
diff --git a/test/validation/timer/timer_main.c b/test/validation/timer/timer_main.c
new file mode 100644
index 0000000..24eb77b
--- /dev/null
+++ b/test/validation/timer/timer_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include "timer.h"
+
+int main(void)
+{
+	return timer_main();
+}