Browse Source

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 <rusty@rustcorp.com.au>
Rusty Russell 10 years ago
parent
commit
e5e620e2db

+ 8 - 0
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;
 }

+ 1 - 1
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);

+ 1 - 1
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);

+ 1 - 1
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);