aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2021-05-28 11:40:25 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2021-05-31 11:06:31 +0300
commit50d602b2c9d075d214ad443be0b68ab72d88869f (patch)
treea8144269ca0ad938f703be8d5f0647a8b8a146a6
parent52a9d393b37ddadb55bf1e7993402fcc578a416e (diff)
test: common: skip tests with CI_SKIP environment variable
Added function to help checking if a test case need to be skipped in CI. Skipped test case names are listed in CI_SKIP environment variable. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r--test/common/odp_cunit_common.c14
-rw-r--r--test/common/odp_cunit_common.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c
index 790c361f6..f5c437344 100644
--- a/test/common/odp_cunit_common.c
+++ b/test/common/odp_cunit_common.c
@@ -555,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;
+}
diff --git a/test/common/odp_cunit_common.h b/test/common/odp_cunit_common.h
index 567d75592..3e06ba10c 100644
--- a/test/common/odp_cunit_common.h
+++ b/test/common/odp_cunit_common.h
@@ -107,6 +107,9 @@ int odp_cunit_ret(int val);
int odp_cunit_print_inactive(void);
int odp_cunit_set_inactive(void);
+/* Check from CI_SKIP environment variable if the test case should be skipped by CI */
+int odp_cunit_ci_skip(const char *test_name);
+
/*
* Wrapper for CU_ASSERT_FATAL implementation to show the compiler that
* the function does not return if the assertion fails. This reduces bogus