Browse Source

tools/ccanlint: test_depends_accurate: catch #include of other ccan C files.

Jon sent a test patch for sha256 which "#include <ccan/str/hex/hex.c>"
without adding str/hex to testdepends.  It "worked" (it wouldn't have
linked with "hex.h"), but ccanlint didn't spot the dependency.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 9 years ago
parent
commit
682b594ddb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/ccanlint/tests/depends_accurate.c

+ 1 - 1
tools/ccanlint/tests/depends_accurate.c

@@ -47,7 +47,7 @@ static bool check_dep_includes(struct manifest *m,
 		char *mod;
 		if (!tal_strreg(f, lines[i],
 				"^[ \t]*#[ \t]*include[ \t]*[<\"]"
-				"(ccan/+.+)/+[^/]+\\.h", &mod))
+				"(ccan/+.+)/+[^/]+\\.[ch][\">]", &mod))
 			continue;
 
 		if (has_dep(m, deps, used, mod))