summaryrefslogtreecommitdiff
path: root/test/cairo-test-runner.c
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2021-04-30 12:12:22 +0000
committerUli Schlachter <psychon@znc.in>2021-04-30 12:12:22 +0000
commit8f6cfe41773be1764a0813e6bd8f97e18d5b8cd3 (patch)
tree6936f2ea74091343a251f8aecc3d8ad23d18e56a /test/cairo-test-runner.c
parent4c4e6127f45ce8b761acfbc2b1a0548a1535aa9d (diff)
parent58b1929173d60719aedfbc3709f1b948d266d45f (diff)
downloadcairo-8f6cfe41773be1764a0813e6bd8f97e18d5b8cd3.tar.gz
Merge branch 'ci-test-x11' into 'master'
CI: Check test results for cairo-xcb and cairo-x11 See merge request cairo/cairo!165
Diffstat (limited to 'test/cairo-test-runner.c')
-rw-r--r--test/cairo-test-runner.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index ec5efb46f..e76c75f35 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -612,6 +612,7 @@ expect_fail_due_to_env_var (cairo_test_context_t *ctx,
char *env_name;
const char *env;
cairo_bool_t result = FALSE;
+ char *to_replace;
/* Construct the name of the env var */
env_name = malloc (strlen (prefix) + strlen (target->name) + 1 + strlen (content) + 1);
@@ -625,6 +626,14 @@ expect_fail_due_to_env_var (cairo_test_context_t *ctx,
strcat (env_name, "_");
strcat (env_name, content);
+ /* Deal with some invalid characters: Replace '-' and '&' with '_' */
+ while ((to_replace = strchr(env_name, '-')) != NULL) {
+ *to_replace = '_';
+ }
+ while ((to_replace = strchr(env_name, '&')) != NULL) {
+ *to_replace = '_';
+ }
+
env = getenv (env_name);
/* Look for the test name in the env var (comma separated) */