- /* If you don't pass the compulsory tests, you get a score of 0. */
- while ((i = get_next_test(&compulsory_tests)) != NULL) {
- if (!run_test(i, summary, &score, &total_score, m)) {
- printf("%sTotal score: 0/%u\n", prefix, total_score);
- errx(1, "%s%s failed", prefix, i->name);
+ for (i = 1; i < argc; i++) {
+ unsigned int score, total_score;
+
+ dir = argv[i];
+
+ if (dir[0] != '/')
+ dir = talloc_asprintf_append(NULL, "%s/%s",
+ base_dir, dir);
+ while (strends(dir, "/"))
+ dir[strlen(dir)-1] = '\0';
+
+ got_dir:
+ if (dir != base_dir)
+ prefix = talloc_append_string(talloc_basename(NULL,dir),
+ ": ");
+
+ init_tests();
+
+ m = get_manifest(talloc_autofree_context(), dir);
+
+ /* FIXME: This has to come after we've got manifest. */
+ if (i == 1)
+ read_config_header();
+
+ /* Create a symlink from temp dir back to src dir's
+ * test directory. */
+ unlink(testlink);
+ if (symlink(talloc_asprintf(m, "%s/test", dir), testlink) != 0)
+ err(1, "Creating test symlink in %s", temp_dir(NULL));
+
+ score = total_score = 0;
+ while ((t = get_next_test()) != NULL) {
+ if (!run_test(t, summary, &score, &total_score, m,
+ prefix)) {
+ pass = false;
+ if (t->compulsory) {
+ warnx("%s%s failed", prefix, t->name);
+ printf("%sTotal score: 0/%u\n",
+ prefix, total_score);
+ goto next;
+ }
+ }