]> git.ozlabs.org Git - ccan/commitdiff
ccanlint: give a point per compile_ok/compile_fail test
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Mar 2011 03:54:02 +0000 (14:24 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Mar 2011 03:54:02 +0000 (14:24 +1030)
We get a point for every run or api test, rather than 1 point for all of them,
so be consistent.

tools/ccanlint/tests/tests_compile.c

index 9e6d5dc7c52ea78055484424da9757a83e6fe8da..48b8c0cfa32aaeff5bf3d0f2df4adbaeb9d5f452 100644 (file)
@@ -131,11 +131,11 @@ static void compile_tests(struct manifest *m, bool keep,
                                         "Compiled successfully with -DFAIL?");
                        return;
                }
                                         "Compiled successfully with -DFAIL?");
                        return;
                }
+               score->total++;
        }
 
        score->pass = true;
        }
 
        score->pass = true;
-       score->total = 2;
-       score->score = 1 + !warnings;
+       score->score = score->total - warnings;
 }
 
 static void do_compile_tests(struct manifest *m,
 }
 
 static void do_compile_tests(struct manifest *m,
@@ -167,7 +167,7 @@ static void do_compile_tests_without_features(struct manifest *m,
                                              unsigned int *timeleft,
                                              struct score *score)
 {
                                              unsigned int *timeleft,
                                              struct score *score)
 {
-       return compile_tests(m, keep, score, "-I. ");
+       compile_tests(m, keep, score, "-I. ");
 }
 
 struct ccanlint tests_compile_without_features = {
 }
 
 struct ccanlint tests_compile_without_features = {