summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-07 23:55:45 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-07-08 01:06:10 -0400
commit27b5766a37a2f58daec85b913f342793f332d09f (patch)
tree2f60304bfa2101a83a2e8517d254751f6bb9c82b
parent6f47b2a5790523f82ff5ecc846e97492f17e2f4e (diff)
fixup! get-test-job: Query for subtests, and write per-subtest lockfiles
-rw-r--r--lib/get-test-job.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/get-test-job.c b/lib/get-test-job.c
index b29ff65..f45b947 100644
--- a/lib/get-test-job.c
+++ b/lib/get-test-job.c
@@ -99,8 +99,8 @@ static void test_job_print(test_job job)
char **subtest;
darray_foreach(subtest, job.subtests)
- printf(" %s", *subtest);
- printf("\n");
+ fprintf(stderr, " %s", *subtest);
+ fprintf(stderr, "\n");
}
static strings get_subtests(char *test_path)
@@ -148,16 +148,26 @@ static strings get_subtests(char *test_path)
return ret;
}
+static char *slashes_to_dots(const char *str)
+{
+ char *p, *ret = strdup(str);
+
+ while ((p = strchr(ret, '/')))
+ *p = '.';
+
+ return ret;
+}
+
static bool lockfile_exists(const char *commit,
const char *test_path,
const char *subtest,
bool create)
{
char *test_name = test_basename(test_path);
+ char *subtest_mangled = slashes_to_dots(subtest);
char *commitdir = mprintf("%s/%s", outdir, commit);
- char *testdir = mprintf("%s/%s.%s", commitdir, test_name, subtest);
- char *lockfile = mprintf("%s/status",
- testdir, subtest);
+ char *testdir = mprintf("%s/%s.%s", commitdir, test_name, subtest_mangled);
+ char *lockfile = mprintf("%s/status", testdir);
bool exists;
if (!create) {
@@ -178,6 +188,7 @@ static bool lockfile_exists(const char *commit,
free(lockfile);
free(testdir);
free(commitdir);
+ free(subtest_mangled);
free(test_name);
return exists;