]> git.ozlabs.org Git - ccan/commitdiff
ccanlint: fix compilation of API tests with coverage
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 03:52:28 +0000 (14:22 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 03:52:28 +0000 (14:22 +1030)
They expect to be linked against the module objects.

tools/ccanlint/tests/tests_compile_coverage.c

index ea46e79e1bc3d8df15cac0aeb2889ca526ff4e81..4e35609913b7374d86847cf7fac01cc29bbc73f7 100644 (file)
@@ -127,7 +127,10 @@ static void do_compile_coverage_tests(struct manifest *m,
 
        foreach_ptr(h, &m->run_tests, &m->api_tests) {
                list_for_each(h, i, list) {
 
        foreach_ptr(h, &m->run_tests, &m->api_tests) {
                list_for_each(h, i, list) {
-                       cmdout = cov_compile(m, m, i, NULL, keep);
+                       cmdout = cov_compile(m, m, i,
+                                            h == &m->api_tests
+                                            ? modobjs : NULL,
+                                            keep);
                        if (cmdout) {
                                score_file_error(score, i, 0,
                                  "Failed to compile test with coverage: %s",
                        if (cmdout) {
                                score_file_error(score, i, 0,
                                  "Failed to compile test with coverage: %s",