result = i->check(m);
if (!result) {
- if (verbose)
- printf(" %s: OK\n", i->name);
+ if (verbose) {
+ printf(" %s: OK", i->name);
+ if (i->total_score)
+ printf(" (+%u/%u)",
+ i->total_score, i->total_score);
+ printf("\n");
+ }
if (i->total_score) {
*score += i->total_score;
*total_score += i->total_score;
*total_score += i->total_score;
*score += this_score;
+ if (verbose) {
+ printf(" %s: FAIL (+%u/%u)\n",
+ i->name, this_score, i->total_score);
+ }
if (!quiet) {
printf("%s\n", i->describe(m, result));
unsigned int score = 0, total_score = 0;
struct manifest *m;
struct ccanlint *i;
- const char *prefix = "";
+ const char *prefix = "", *dir = ".";
/* I'd love to use long options, but that's not standard. */
/* FIXME: getopt_long ccan package? */
while ((c = getopt(argc, argv, "sd:vn")) != -1) {
switch (c) {
case 'd':
+ dir = optarg;
prefix = talloc_append_string(talloc_basename(NULL,
optarg),
": ");
- if (chdir(optarg) != 0)
- err(1, "Changing into directory '%s'", optarg);
break;
case 's':
summary = true;
if (optind < argc)
usage(argv[0]);
- m = get_manifest(talloc_autofree_context());
+ m = get_manifest(talloc_autofree_context(), dir);
init_tests();