On 11/20/2014 09:02 PM, Ciprian Barbu wrote:
Signed-off-by: Ciprian Barbu <ciprian.ba...@linaro.org>
---
The testcases are based almost entirely on the odp_example.
There are no alloc tests and I added a test case for odp_schedule_wait_time.
The major differencs between the odp_example and this cunit is the partition
into testcases, the odp_example calls every test case from one big function.
I had to work some magic in order to be able to pass arguments to test cases,
I hope is not too hard to follow.
configure.ac | 1 +
test/cunit/Makefile.am | 2 +
test/cunit/schedule/Makefile.am | 10 +
test/cunit/schedule/odp_schedule_test.c | 844 ++++++++++++++++++++++++++
test/cunit/schedule/odp_schedule_testsuites.c | 35 ++
test/cunit/schedule/odp_schedule_testsuites.h | 21 +
6 files changed, 913 insertions(+)
create mode 100644 test/cunit/schedule/Makefile.am
create mode 100644 test/cunit/schedule/odp_schedule_test.c
create mode 100644 test/cunit/schedule/odp_schedule_testsuites.c
create mode 100644 test/cunit/schedule/odp_schedule_testsuites.h
diff --git a/configure.ac b/configure.ac
index fcd7279..a47db72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,6 +173,7 @@ AC_CONFIG_FILES([Makefile
test/Makefile
test/api_test/Makefile
test/cunit/Makefile
+ test/cunit/schedule/Makefile
pkgconfig/libodp.pc])
AC_SEARCH_LIBS([timer_create],[rt posix4])
diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
index 439e134..b6033ee 100644
--- a/test/cunit/Makefile.am
+++ b/test/cunit/Makefile.am
@@ -3,6 +3,8 @@ include $(top_srcdir)/test/Makefile.inc
AM_CFLAGS += -I$(CUNIT_PATH)/include
AM_LDFLAGS += -L$(CUNIT_PATH)/lib -static -lcunit
+SUBDIRS = schedule
+
Don't create a separate makefile, so all test binaries will be the same
directory.
if ODP_CUNIT_ENABLED
TESTS = ${bin_PROGRAMS}
check_PROGRAMS = ${bin_PROGRAMS}
+
+struct CU_TestInfo schedule_tests[] = {
+ _CU_TEST_INFO(schedule_wait_time),
+ _CU_TEST_INFO(schedule_one_single_lo),
+ _CU_TEST_INFO(schedule_single_lo),
+ _CU_TEST_INFO(schedule_one_many_lo),
+ _CU_TEST_INFO(schedule_many_lo),
+ _CU_TEST_INFO(schedule_multi_lo),
+ _CU_TEST_INFO(schedule_one_single_hi),
+ _CU_TEST_INFO(schedule_single_hi),
+ _CU_TEST_INFO(schedule_one_many_hi),
+ _CU_TEST_INFO(schedule_many_hi),
+ _CU_TEST_INFO(schedule_multi_hi),
+ CU_TEST_INFO_NULL,
+};
schedule_one() will be dropped, so these tests also can be dropped.
I think odp_example is not a good base for scheduler tests. It was
written as benchmark, but not as a verification test.
Basic scheduler tests are missing:
- verify that priority works correctly.
- verify that atomicity works correctly for ATOMIC queues.
- verify order for ORDERED queues.
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp