diff mbox

[4/5] validation: creating own dir and lib for scheduler

Message ID 1435680896-11924-5-git-send-email-christophe.milard@linaro.org
State Accepted
Commit 915975d3f27386fc5c83ed542c5390b276e95e12
Headers show

Commit Message

Christophe Milard June 30, 2015, 4:14 p.m. UTC
Module scheduler 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/scheduler/.gitignore                       |  2 ++
 test/validation/scheduler/Makefile.am                      |  8 ++++++++
 test/validation/{odp_scheduler.c => scheduler/scheduler.c} |  9 ++-------
 test/validation/scheduler/scheduler.h                      |  7 +++++++
 test/validation/scheduler/scheduler_main.c                 | 12 ++++++++++++
 8 files changed, 35 insertions(+), 14 deletions(-)
 create mode 100644 test/validation/scheduler/.gitignore
 create mode 100644 test/validation/scheduler/Makefile.am
 rename test/validation/{odp_scheduler.c => scheduler/scheduler.c} (99%)
 create mode 100644 test/validation/scheduler/scheduler.h
 create mode 100644 test/validation/scheduler/scheduler_main.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 6c29c0e..bfe5964 100644
--- a/configure.ac
+++ b/configure.ac
@@ -313,6 +313,7 @@  AC_CONFIG_FILES([Makefile
 		 test/validation/pool/Makefile
 		 test/validation/queue/Makefile
 		 test/validation/random/Makefile
+		 test/validation/scheduler/Makefile
 		 test/validation/system/Makefile
 		 test/miscellaneous/Makefile
 		 ])
diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index e1fb4f1..cf48485 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -2,7 +2,6 @@ 
 *.trs
 odp_ver_abt_log_dbg
 odp_cpumask
-odp_scheduler
 odp_shared_memory
 odp_synchronizers
 odp_timer
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 872064a..53a31e4 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -5,7 +5,6 @@  AM_CFLAGS += -I$(srcdir)/common
 AM_LDFLAGS += -static
 
 EXECUTABLES = odp_cpumask$(EXEEXT) \
-	      odp_scheduler$(EXEEXT) \
 	      odp_shared_memory$(EXEEXT) \
 	      odp_synchronizers$(EXEEXT) \
 	      odp_timer$(EXEEXT) \
@@ -13,7 +12,8 @@  EXECUTABLES = odp_cpumask$(EXEEXT) \
 	      odp_ver_abt_log_dbg$(EXEEXT)
 
 if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+	scheduler/scheduler_main
 endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -21,10 +21,6 @@  bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
 ODP_CU_COMMON=common/odp_cunit_common.c
 
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
-odp_scheduler_LDADD = \
-	$(top_builddir)/test/validation/common/libcunit_common.a \
-	$(LIB)/libodp.la
-dist_odp_scheduler_SOURCES = odp_scheduler.c
 dist_odp_shared_memory_SOURCES	= odp_shared_memory.c
 dist_odp_synchronizers_SOURCES = odp_synchronizers.c
 dist_odp_timer_SOURCES  = odp_timer.c
@@ -44,6 +40,7 @@  ODP_MODULES = buffer \
 	      pktio \
 	      pool \
 	      random \
+	      scheduler \
 	      system
 
 SUBDIRS = common $(ODP_MODULES)
diff --git a/test/validation/scheduler/.gitignore b/test/validation/scheduler/.gitignore
new file mode 100644
index 0000000..03a6f39
--- /dev/null
+++ b/test/validation/scheduler/.gitignore
@@ -0,0 +1,2 @@ 
+libscheduler.a
+scheduler_main
diff --git a/test/validation/scheduler/Makefile.am b/test/validation/scheduler/Makefile.am
new file mode 100644
index 0000000..8224a66
--- /dev/null
+++ b/test/validation/scheduler/Makefile.am
@@ -0,0 +1,8 @@ 
+include ../Makefile.inc
+
+noinst_LIBRARIES = libscheduler.a
+libscheduler_a_SOURCES = scheduler.c
+
+bin_PROGRAMS = scheduler_main$(EXEEXT)
+dist_scheduler_main_SOURCES = scheduler_main.c
+scheduler_main_LDADD = libscheduler.a $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/validation/odp_scheduler.c b/test/validation/scheduler/scheduler.c
similarity index 99%
rename from test/validation/odp_scheduler.c
rename to test/validation/scheduler/scheduler.c
index 2f2e627..e03af13 100644
--- a/test/validation/odp_scheduler.c
+++ b/test/validation/scheduler/scheduler.c
@@ -6,6 +6,7 @@ 
 
 #include <odp.h>
 #include "odp_cunit_common.h"
+#include "scheduler.h"
 
 #define MAX_WORKERS_THREADS	32
 #define MSG_POOL_SIZE		(4 * 1024 * 1024)
@@ -816,13 +817,7 @@  static CU_SuiteInfo scheduler_suites[] = {
 	CU_SUITE_INFO_NULL,
 };
 
-static int scheduler_main(void)
+int scheduler_main(void)
 {
 	return odp_cunit_run(scheduler_suites);
 }
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
-	return scheduler_main();
-}
diff --git a/test/validation/scheduler/scheduler.h b/test/validation/scheduler/scheduler.h
new file mode 100644
index 0000000..f2d5795
--- /dev/null
+++ b/test/validation/scheduler/scheduler.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+int scheduler_main(void);
diff --git a/test/validation/scheduler/scheduler_main.c b/test/validation/scheduler/scheduler_main.c
new file mode 100644
index 0000000..1f6f32f
--- /dev/null
+++ b/test/validation/scheduler/scheduler_main.c
@@ -0,0 +1,12 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include "scheduler.h"
+
+int main(void)
+{
+	return scheduler_main();
+}