From 0d712535273f2ff2430ee68120e6237cf2ee3869 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 3 Feb 2016 16:34:05 +1030 Subject: [PATCH] ccanlint: add missing file for "info_ported" test. Signed-off-by: Rusty Russell --- tools/ccanlint/tests/info_ported.c | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tools/ccanlint/tests/info_ported.c diff --git a/tools/ccanlint/tests/info_ported.c b/tools/ccanlint/tests/info_ported.c new file mode 100644 index 00000000..f58f2f34 --- /dev/null +++ b/tools/ccanlint/tests/info_ported.c @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const char *can_build(struct manifest *m) +{ + /* FIXME: In safe mode, we'd need complex guesstiparsing. */ + if (safe_mode) + return NULL; + + if (get_ported(m, m->dir, true, get_or_compile_info)) + return NULL; + return "'_info ported' says not supported"; +} + +static void check_info_ported(struct manifest *m, + unsigned int *timeleft, struct score *score) +{ + score->pass = true; + score->score = 1; +} + +struct ccanlint info_ported = { + .key = "info_ported", + .can_run = can_build, + .name = "_info indicates support for this platform", + .check = check_info_ported, + .needs = "info_exists" +}; + +REGISTER_TEST(info_ported); -- 2.39.2