@@ -315,6 +315,7 @@ AC_CONFIG_FILES([Makefile
test/validation/random/Makefile
test/validation/scheduler/Makefile
test/validation/system/Makefile
+ test/validation/thread/Makefile
test/miscellaneous/Makefile
])
@@ -5,4 +5,3 @@ odp_cpumask
odp_shared_memory
odp_synchronizers
odp_timer
-odp_thread
@@ -8,11 +8,11 @@ EXECUTABLES = odp_cpumask$(EXEEXT) \
odp_shared_memory$(EXEEXT) \
odp_synchronizers$(EXEEXT) \
odp_timer$(EXEEXT) \
- odp_thread$(EXEEXT) \
odp_ver_abt_log_dbg$(EXEEXT)
if test_vald
-TESTS = $(EXECUTABLES)
+TESTS = $(EXECUTABLES) \
+ thread/thread_main
endif
bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -24,9 +24,6 @@ dist_odp_shared_memory_SOURCES = odp_shared_memory.c
dist_odp_synchronizers_SOURCES = odp_synchronizers.c
dist_odp_timer_SOURCES = odp_timer.c
dist_odp_cpumask_SOURCES = odp_cpumask.c
-odp_thread_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
- $(LIB)/libodp.la
-dist_odp_thread_SOURCES = odp_thread.c
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 \
@@ -42,6 +39,7 @@ ODP_MODULES = buffer \
pool \
random \
scheduler \
- system
+ system \
+ thread
SUBDIRS = common $(ODP_MODULES)
new file mode 100644
@@ -0,0 +1,2 @@
+libthread.a
+thread_main
new file mode 100644
@@ -0,0 +1,8 @@
+include ../Makefile.inc
+
+noinst_LIBRARIES = libthread.a
+libthread_a_SOURCES = thread.c
+
+bin_PROGRAMS = thread_main$(EXEEXT)
+dist_thread_main_SOURCES = thread_main.c
+thread_main_LDADD = libthread.a $(LIBCUNIT_COMMON) $(LIBODP)
similarity index 85%
rename from test/validation/odp_thread.c
rename to test/validation/thread/thread.c
@@ -6,6 +6,7 @@
#include <odp.h>
#include <odp_cunit_common.h>
+#include "thread.h"
/* Helper macro for CU_TestInfo initialization */
#define _CU_TEST_INFO(test_func) {#test_func, test_func}
@@ -40,13 +41,7 @@ static CU_SuiteInfo thread_suites[] = {
CU_SUITE_INFO_NULL,
};
-static int thread_main(void)
+int thread_main(void)
{
return odp_cunit_run(thread_suites);
}
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
- return thread_main();
-}
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+int thread_main(void);
new file mode 100644
@@ -0,0 +1,12 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "thread.h"
+
+int main(void)
+{
+ return thread_main();
+}
Module thread 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 | 10 ++++------ test/validation/thread/.gitignore | 2 ++ test/validation/thread/Makefile.am | 8 ++++++++ test/validation/{odp_thread.c => thread/thread.c} | 9 ++------- test/validation/thread/thread.h | 7 +++++++ test/validation/thread/thread_main.c | 12 ++++++++++++ 8 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 test/validation/thread/.gitignore create mode 100644 test/validation/thread/Makefile.am rename test/validation/{odp_thread.c => thread/thread.c} (85%) create mode 100644 test/validation/thread/thread.h create mode 100644 test/validation/thread/thread_main.c