Commit 15290c3f authored by Rusty Russell's avatar Rusty Russell

Make ccanlint tests all positive: ie. "has _info.c file: FAILED".

parent c1daa044
OBJS := tools/ccanlint/no_info.o \ OBJS := tools/ccanlint/has_info.o \
tools/ccanlint/has_main_header.o \ tools/ccanlint/has_main_header.o \
tools/ccanlint/has_tests.o \ tools/ccanlint/has_tests.o \
tools/ccanlint/trailing_whitespace.o \ tools/ccanlint/trailing_whitespace.o \
......
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
#include <string.h> #include <string.h>
#include <ccan/noerr/noerr.h> #include <ccan/noerr/noerr.h>
static void *check_no_info(struct manifest *m) static void *check_has_info(struct manifest *m)
{ {
if (m->info_file) if (m->info_file)
return NULL; return NULL;
return m; return m;
} }
static const char *describe_no_info(struct manifest *m, void *check_result) static const char *describe_has_info(struct manifest *m, void *check_result)
{ {
return "You have no _info.c file.\n\n" return "You have no _info.c file.\n\n"
"The file _info.c contains the metadata for a ccan package: things\n" "The file _info.c contains the metadata for a ccan package: things\n"
...@@ -70,9 +70,9 @@ static void create_info_template(struct manifest *m, void *check_result) ...@@ -70,9 +70,9 @@ static void create_info_template(struct manifest *m, void *check_result)
fclose(info); fclose(info);
} }
struct ccanlint no_info = { struct ccanlint has_info = {
.name = "No _info.c file", .name = "Has _info.c file",
.check = check_no_info, .check = check_has_info,
.describe = describe_no_info, .describe = describe_has_info,
.handle = create_info_template, .handle = create_info_template,
}; };
...@@ -40,7 +40,7 @@ static const char *describe_trailing_whitespace(struct manifest *m, ...@@ -40,7 +40,7 @@ static const char *describe_trailing_whitespace(struct manifest *m,
} }
struct ccanlint trailing_whitespace = { struct ccanlint trailing_whitespace = {
.name = "Lines with unnecessary trailing whitespace", .name = "No lines with unnecessary trailing whitespace",
.total_score = 1, .total_score = 1,
.check = check_trailing_whitespace, .check = check_trailing_whitespace,
.describe = describe_trailing_whitespace, .describe = describe_trailing_whitespace,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment