aboutsummaryrefslogtreecommitdiff
path: root/test/common/odp_cunit_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/common/odp_cunit_common.c')
-rw-r--r--test/common/odp_cunit_common.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c
index 62418c356..f5c437344 100644
--- a/test/common/odp_cunit_common.c
+++ b/test/common/odp_cunit_common.c
@@ -259,7 +259,8 @@ int odp_cunit_print_inactive(void)
continue;
if (first) {
- printf("\n\n Inactive tests:\n");
+ printf("\n\nSuite: %s\n", sinfo->name);
+ printf(" Inactive tests:\n");
first = 0;
}
@@ -269,6 +270,34 @@ int odp_cunit_print_inactive(void)
return 0;
}
+int odp_cunit_set_inactive(void)
+{
+ CU_pSuite cur_suite;
+ CU_pTest ptest;
+ odp_suiteinfo_t *sinfo;
+ odp_testinfo_t *tinfo;
+
+ cur_suite = CU_get_current_suite();
+ if (cur_suite == NULL)
+ return -1;
+
+ sinfo = cunit_get_suite_info(cur_suite->pName);
+ if (sinfo == NULL)
+ return -1;
+
+ for (tinfo = sinfo->testinfo_tbl; tinfo->name; tinfo++) {
+ ptest = CU_get_test_by_name(tinfo->name, cur_suite);
+ if (ptest == NULL) {
+ fprintf(stderr, "%s: test not found: %s\n",
+ __func__, tinfo->name);
+ return -1;
+ }
+ CU_set_test_active(ptest, false);
+ }
+
+ return 0;
+}
+
static int default_term_func(void)
{
return odp_cunit_print_inactive();
@@ -526,3 +555,17 @@ int odp_cunit_ret(int val)
{
return allow_skip_result ? 0 : val;
}
+
+int odp_cunit_ci_skip(const char *test_name)
+{
+ const char *ci_skip;
+ const char *found;
+
+ ci_skip = getenv("CI_SKIP");
+ if (ci_skip == NULL)
+ return 0;
+
+ found = strstr(ci_skip, test_name);
+
+ return found != NULL;
+}