struct run_tests_result *res;
struct ccan_file *i;
char *cmdout;
+ char *olddir;
+
+ /* We run tests in the module directory, so any paths
+ * referenced can all be module-local. */
+ olddir = talloc_getcwd(m);
+ if (!olddir)
+ err(1, "Could not save cwd");
+ if (chdir(m->dir) != 0)
+ err(1, "Could not chdir to %s", m->dir);
list_head_init(list);
list = NULL;
}
+ if (chdir(olddir) != 0)
+ err(1, "Could not chdir to %s", olddir);
+
return list;
}
return descrip;
}
+/* Gcc's warn_unused_result is fascist bullshit. */
+#define doesnt_matter()
+
static void run_under_debugger(struct manifest *m, void *check_result)
{
char *command;
first = list_top(list, struct run_tests_result, list);
command = talloc_asprintf(m, "gdb -ex 'break tap.c:136' -ex 'run' %s",
first->file->compiled);
- system(command);
+ if (system(command))
+ doesnt_matter();
}
struct ccanlint run_tests = {