ccanlint: add "_info ported" (for ccan/altstack).
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Feb 2016 02:27:33 +0000 (12:57 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Feb 2016 02:27:33 +0000 (12:57 +1030)
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 <rusty@rustcorp.com.au>
ccan/altstack/_info
tools/ccanlint/tests/depends_build.c
tools/ccanlint/tests/main_header_compiles.c
tools/ccanlint/tests/objects_build.c

index b411c2967c26ee57f72f4c093a84fd2fde0a2bc8..92bd628988d3be5a916baf8f3fba93df832fbbb1 100644 (file)
@@ -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;
 }
index 69510a2969b69c6c6468d0085a89850b0428c3e2..d4ebcb1da9af945ddf5652afdcda76d185eb8b0c 100644 (file)
@@ -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);
index 5ad2dd415a424961a8a966c5db9cab24d5064d91..f54c6173a53578e76c6e805cf281ef7319a6c19a 100644 (file)
@@ -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);
index 5e6daf7827a1c5104d5e9dd81c49f671e834ea5f..d0bd7365dc7c52024975626c0e950a2a6e1d8e87 100644 (file)
@@ -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);