aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>2018-02-15 03:04:03 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-02-20 22:19:55 +0300
commitdfa1ee94dae761166126445739be0dd6843f6792 (patch)
tree12b29dbe437f4221eadc9b2421e8a9ceeb2bad8b /test
parent01014bb374153d7bc879b3e1d26e79a6dfe5c329 (diff)
validation: thread: simplify test infrastructure
Merge separate file with just main() function into main test file. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test')
-rw-r--r--test/validation/api/thread/Makefile.am2
-rw-r--r--test/validation/api/thread/thread.c13
-rw-r--r--test/validation/api/thread/thread.h33
-rw-r--r--test/validation/api/thread/thread_main.c14
4 files changed, 7 insertions, 55 deletions
diff --git a/test/validation/api/thread/Makefile.am b/test/validation/api/thread/Makefile.am
index 2282169b9..cbd8b2a7b 100644
--- a/test/validation/api/thread/Makefile.am
+++ b/test/validation/api/thread/Makefile.am
@@ -2,5 +2,5 @@ include ../Makefile.inc
test_PROGRAMS = thread_main
thread_main_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_THRMASK
-thread_main_SOURCES = thread_main.c thread.c thread.h
+thread_main_SOURCES = thread.c
LDADD += $(LIBTHRMASK_COMMON)
diff --git a/test/validation/api/thread/thread.c b/test/validation/api/thread/thread.c
index ada4affcb..fe504e888 100644
--- a/test/validation/api/thread/thread.c
+++ b/test/validation/api/thread/thread.c
@@ -10,25 +10,24 @@
#include <odp_cunit_common.h>
#include <mask_common.h>
#include <test_debug.h>
-#include "thread.h"
/* Test thread entry and exit synchronization barriers */
odp_barrier_t bar_entry;
odp_barrier_t bar_exit;
-void thread_test_odp_cpu_id(void)
+static void thread_test_odp_cpu_id(void)
{
(void)odp_cpu_id();
CU_PASS();
}
-void thread_test_odp_thread_id(void)
+static void thread_test_odp_thread_id(void)
{
(void)odp_thread_id();
CU_PASS();
}
-void thread_test_odp_thread_count(void)
+static void thread_test_odp_thread_count(void)
{
(void)odp_thread_count();
CU_PASS();
@@ -47,7 +46,7 @@ static int thread_func(void *arg TEST_UNUSED)
return CU_get_number_of_failures();
}
-void thread_test_odp_thrmask_worker(void)
+static void thread_test_odp_thrmask_worker(void)
{
odp_thrmask_t mask;
int ret;
@@ -84,7 +83,7 @@ void thread_test_odp_thrmask_worker(void)
odp_cunit_thread_exit(&args);
}
-void thread_test_odp_thrmask_control(void)
+static void thread_test_odp_thrmask_control(void)
{
odp_thrmask_t mask;
int ret;
@@ -125,7 +124,7 @@ odp_suiteinfo_t thread_suites[] = {
ODP_SUITE_INFO_NULL,
};
-int thread_main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
int ret;
diff --git a/test/validation/api/thread/thread.h b/test/validation/api/thread/thread.h
deleted file mode 100644
index d511c9259..000000000
--- a/test/validation/api/thread/thread.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef _ODP_TEST_THREAD_H_
-#define _ODP_TEST_THREAD_H_
-
-#include <odp_api.h>
-#include <odp_cunit_common.h>
-
-/* test functions: */
-#ifndef TEST_THRMASK
-#define TEST_THRMASK
-#endif
-#include "mask_common.h"
-void thread_test_odp_cpu_id(void);
-void thread_test_odp_thread_id(void);
-void thread_test_odp_thread_count(void);
-void thread_test_odp_thrmask_control(void);
-void thread_test_odp_thrmask_worker(void);
-
-/* test arrays: */
-extern odp_testinfo_t thread_suite[];
-
-/* test registry: */
-extern odp_suiteinfo_t thread_suites[];
-
-/* main test program: */
-int thread_main(int argc, char *argv[]);
-
-#endif
diff --git a/test/validation/api/thread/thread_main.c b/test/validation/api/thread/thread_main.c
deleted file mode 100644
index 2e8328364..000000000
--- a/test/validation/api/thread/thread_main.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "config.h"
-
-#include "thread.h"
-
-int main(int argc, char *argv[])
-{
- return thread_main(argc, argv);
-}