From: Rusty Russell Date: Wed, 3 Feb 2016 02:27:33 +0000 (+1030) Subject: ccanlint: add "_info ported" (for ccan/altstack). X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=e5e620e2dba2868f2d84a1f19a07c5e7a9cd3986 ccanlint: add "_info ported" (for ccan/altstack). If _info handles the arg "ported" it should print out 1 or 0; 0 means it can't be compiled/run/tested on this platform. This lets ccanlint easily skip such modules. Signed-off-by: Rusty Russell --- diff --git a/ccan/altstack/_info b/ccan/altstack/_info index b411c296..92bd6289 100644 --- a/ccan/altstack/_info +++ b/ccan/altstack/_info @@ -122,5 +122,13 @@ int main(int argc, char *argv[]) if (strcmp(argv[1], "depends") == 0) return 0; + if (strcmp(argv[1], "ported") == 0) { +#if __x86_64__ + printf("1\n"); +#else + printf("0\n"); +#endif + } + return 1; } diff --git a/tools/ccanlint/tests/depends_build.c b/tools/ccanlint/tests/depends_build.c index 69510a29..d4ebcb1d 100644 --- a/tools/ccanlint/tests/depends_build.c +++ b/tools/ccanlint/tests/depends_build.c @@ -108,7 +108,7 @@ struct ccanlint depends_build = { .name = "Module's CCAN dependencies can be found or built", .check = check_depends_built, .can_run = can_build, - .needs = "depends_exist test_depends_exist" + .needs = "depends_exist test_depends_exist info_ported" }; REGISTER_TEST(depends_build); diff --git a/tools/ccanlint/tests/main_header_compiles.c b/tools/ccanlint/tests/main_header_compiles.c index 5ad2dd41..f54c6173 100644 --- a/tools/ccanlint/tests/main_header_compiles.c +++ b/tools/ccanlint/tests/main_header_compiles.c @@ -70,7 +70,7 @@ struct ccanlint main_header_compiles = { .name = "Modules main header compiles", .check = check_includes_build, .can_run = can_build, - .needs = "depends_exist main_header_exists" + .needs = "depends_exist main_header_exists info_ported" }; REGISTER_TEST(main_header_compiles); diff --git a/tools/ccanlint/tests/objects_build.c b/tools/ccanlint/tests/objects_build.c index 5e6daf78..d0bd7365 100644 --- a/tools/ccanlint/tests/objects_build.c +++ b/tools/ccanlint/tests/objects_build.c @@ -88,7 +88,7 @@ struct ccanlint objects_build = { .compulsory = true, .check = check_objs_build, .can_run = can_build, - .needs = "depends_exist" + .needs = "depends_exist info_ported" }; REGISTER_TEST(objects_build);