]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/build.c
ccanlint: compile and run tests.
[ccan] / tools / ccanlint / tests / build.c
index c3b570e421271ae5917a037356323dfb5528873d..0a5e11e66fbca66281c138c9de084a6ea592525b 100644 (file)
@@ -16,8 +16,6 @@
 
 static const char *can_build(struct manifest *m)
 {
 
 static const char *can_build(struct manifest *m)
 {
-       if (list_empty(&m->c_files))
-               return "No C files in module";
        if (safe_mode)
                return "Safe mode enabled";
        return NULL;
        if (safe_mode)
                return "Safe mode enabled";
        return NULL;
@@ -39,6 +37,11 @@ static char *obj_list(const struct manifest *m)
 /* We leave this object file around after ccanlint runs, all built. */
 static void *do_build(struct manifest *m)
 {
 /* We leave this object file around after ccanlint runs, all built. */
 static void *do_build(struct manifest *m)
 {
+       if (list_empty(&m->c_files)) {
+               /* No files?  No score, but we "pass". */
+               build.total_score = 0;
+               return NULL;
+       }
        return run_command(m, "ld -r -o ../%s.o %s", m->basename, obj_list(m));
 }
 
        return run_command(m, "ld -r -o ../%s.o %s", m->basename, obj_list(m));
 }