aboutsummaryrefslogtreecommitdiff
path: root/test/validation/cpumask
diff options
context:
space:
mode:
authorStuart Haslam <stuart.haslam@linaro.org>2015-10-14 10:28:16 +0100
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-10-15 12:50:55 +0300
commit13559ac79511cfb0544e49852f3ae874ebec6816 (patch)
tree1bb8ad11b83b14996951db3d50b0dbd7488a1569 /test/validation/cpumask
parent064af297d4614368769c204acf610ea185588c7a (diff)
validation: add ability to mark tests inactive
Add the ability for individual test cases to be marked as inactive, either unconditionally or based on the result of a check function which is called at test init time. Inactive tests are registered with CUnit and are reported as inactive in test reports without being executed. All uses of CU_TestInfo have been replaced with odp_testinfo_t in order to carry the conditional function pointer in addition to the CU_TestInfo struct, and some new macros added to make things a bit easier; _CU_TEST_INFO() is renamed to ODP_TEST_INFO() but remains functionally the same, these tests will be run unconditionally. ODP_TEST_INFO_INACTIVE() can be used to define an inactive test case. There's no good reason to do this in any of the modules under test/validation/ but the intention is to allow this to be done on a per-platform basis from within the platform/<platform>/test/ tree. ODP_TEST_INFO_CONDITIONAL() takes an additional parameter which is a pointer to a function to call at test suite initialisation time to determine whether that test should be marked as inactive. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test/validation/cpumask')
-rw-r--r--test/validation/cpumask/cpumask.c46
-rw-r--r--test/validation/cpumask/cpumask.h6
2 files changed, 26 insertions, 26 deletions
diff --git a/test/validation/cpumask/cpumask.c b/test/validation/cpumask/cpumask.c
index 6d57028..37dee6a 100644
--- a/test/validation/cpumask/cpumask.c
+++ b/test/validation/cpumask/cpumask.c
@@ -72,31 +72,31 @@ void cpumask_test_odp_cpumask_def(void)
CU_ASSERT(num_worker > 0);
}
-CU_TestInfo cpumask_suite[] = {
- _CU_TEST_INFO(cpumask_test_odp_cpumask_to_from_str),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_equal),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_zero),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_set),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_clr),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_isset),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_count),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_and),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_or),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_xor),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_copy),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_first),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_last),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_next),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_setall),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_def_control),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_def_worker),
- _CU_TEST_INFO(cpumask_test_odp_cpumask_def),
- CU_TEST_INFO_NULL,
+odp_testinfo_t cpumask_suite[] = {
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_to_from_str),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_equal),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_zero),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_set),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_clr),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_isset),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_count),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_and),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_or),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_xor),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_copy),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_first),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_last),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_next),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_setall),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_def_control),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_def_worker),
+ ODP_TEST_INFO(cpumask_test_odp_cpumask_def),
+ ODP_TEST_INFO_NULL,
};
-CU_SuiteInfo cpumask_suites[] = {
- {"Cpumask", NULL, NULL, NULL, NULL, cpumask_suite},
- CU_SUITE_INFO_NULL,
+odp_suiteinfo_t cpumask_suites[] = {
+ {"Cpumask", NULL, NULL, cpumask_suite},
+ ODP_SUITE_INFO_NULL,
};
int cpumask_main(void)
diff --git a/test/validation/cpumask/cpumask.h b/test/validation/cpumask/cpumask.h
index 7a58b5d..c6f9cde 100644
--- a/test/validation/cpumask/cpumask.h
+++ b/test/validation/cpumask/cpumask.h
@@ -8,7 +8,7 @@
#define _ODP_TEST_CPUMASK_H_
#include <odp.h>
-#include <CUnit/Basic.h>
+#include <odp_cunit_common.h>
/* test functions: */
#include "mask_common.h"
@@ -17,10 +17,10 @@ void cpumask_test_odp_cpumask_def_worker(void);
void cpumask_test_odp_cpumask_def(void);
/* test arrays: */
-extern CU_TestInfo cpumask_suite[];
+extern odp_testinfo_t cpumask_suite[];
/* test registry: */
-extern CU_SuiteInfo cpumask_suites[];
+extern odp_suiteinfo_t cpumask_suites[];
/* main test program: */
int cpumask_main(void);