- /* --target overrides known FAIL from _info */
- if (!added_info_options && m->info_file) {
- add_info_options(m->info_file, !target);
- added_info_options = true;
- }
+ if (argc == 1)
+ dir = cwd;
+ else
+ dir = path_simplify(NULL, take(path_join(NULL, cwd, argv[1])));
+
+ ccan_dir = find_ccan_dir(dir);
+ if (!ccan_dir)
+ errx(1, "Cannot find ccan/ base directory in %s", dir);
+ config_header = read_config_header(ccan_dir, verbose > 1);
+
+ /* We do this after read_config_header has set compiler & cflags */
+ if (override_cflags)
+ cflags = override_cflags;
+ if (override_compiler)
+ compiler = override_compiler;
+
+ if (argc == 1)
+ pass = test_module(&top.node, cwd, "",
+ summary, deps_fail_ignore);
+ else {
+ for (i = 1; i < argc; i++) {
+ dir = path_canon(NULL,
+ take(path_join(NULL, cwd, argv[i])));
+ if (!dir)
+ err(1, "Cannot get canonical name of '%s'",
+ argv[i]);
+
+ prefix = path_join(NULL, ccan_dir, "ccan");
+ prefix = path_rel(NULL, take(prefix), dir);
+ prefix = tal_strcat(NULL, take(prefix), ": ");
+
+ pass &= test_module(&top.node, dir, prefix, summary,
+ deps_fail_ignore);
+ reset_tests(&top.node);