-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to find some files #11
Comments
Hi @nijel, the path of source file is found from parsing the content of |
Okay, root cause of my problems is that this build is using libtool - so coveralls in this case would have to strip .libs from file path. The file I've mentioned in original report seems to be compiled with some wrong flags and that's now fixed. Looking at other coverage processing tool (lcov) it has flag to cope with libtool based builds: |
Could you please try 3541561 to see whether it solves your problem? The changes are: |
That one seems to work fine. |
GNU libtool generates object files into `.libs/` directory instead of the source directory. This change removes `.libs/` from paths to generate suitable paths automatically. For example, there is a source file in `sample/greeter.c`: sample `-- greeter.c GNU libtool generates `greeter.o` into `sample/greeter/.libs/greeter.o`: sample |-- .libs | `-- greeter.o `-- greeter.c `.gcno` files are also generated into `.libs/` directory: sample |-- .libs | |-- greeter.gcno | `-- greeter.o `-- greeter.c `coveralls.coverage.run_gcov()` runs `gcov` in the directory that has `.gcno`. In this example, it is `sample/.libs/` directory. But `sample/.libs/` directory doesn't have source file, `greeter.c`. In this situation, `gcov` can't find source file and reports the following error: % coveralls ... Cannot open source file greeter.c File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... cpp-coveralls has `--build-root` option to change the working directory to run `gcov`. We can use it to resolve the error: % coveralls --build-root sample ... File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... But we can't use `--build-root` option when we have two or more directories. See also eddyxu#11 and 0372af0. I created a sample project to try GNU libtool and coverage combination: https://github.com/kou/libtool-coverage-sample You can find the current cpp-coveralls can't report coverage information: https://coveralls.io/builds/465842
GNU libtool generates object files into `.libs/` directory instead of the source directory. This change removes `.libs/` from paths to generate suitable paths automatically. For example, there is a source file in `sample/greeter.c`: sample `-- greeter.c GNU libtool generates `greeter.o` into `sample/greeter/.libs/greeter.o`: sample |-- .libs | `-- greeter.o `-- greeter.c `.gcno` files are also generated into `.libs/` directory: sample |-- .libs | |-- greeter.gcno | `-- greeter.o `-- greeter.c `coveralls.coverage.run_gcov()` runs `gcov` in the directory that has `.gcno`. In this example, it is `sample/.libs/` directory. But `sample/.libs/` directory doesn't have source file, `greeter.c`. In this situation, `gcov` can't find source file and reports the following error: % coveralls ... Cannot open source file greeter.c File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... cpp-coveralls has `--build-root` option to change the working directory to run `gcov`. We can use it to resolve the error: % coveralls --build-root sample ... File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... But we can't use `--build-root` option when we have two or more directories. See also eddyxu#11 and 0372af0. I created a sample project to try GNU libtool and coverage combination: https://github.com/kou/libtool-coverage-sample You can find the current cpp-coveralls can't report coverage information: https://coveralls.io/builds/465842
GNU libtool generates object files into `.libs/` directory instead of the source directory. This change removes `.libs/` from paths to generate suitable paths automatically. For example, there is a source file in `sample/greeter.c`: sample `-- greeter.c GNU libtool generates `greeter.o` into `sample/greeter/.libs/greeter.o`: sample |-- .libs | `-- greeter.o `-- greeter.c `.gcno` files are also generated into `.libs/` directory: sample |-- .libs | |-- greeter.gcno | `-- greeter.o `-- greeter.c `coveralls.coverage.run_gcov()` runs `gcov` in the directory that has `.gcno`. In this example, it is `sample/.libs/` directory. But `sample/.libs/` directory doesn't have source file, `greeter.c`. In this situation, `gcov` can't find source file and reports the following error: % coveralls ... Cannot open source file greeter.c File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... cpp-coveralls has `--build-root` option to change the working directory to run `gcov`. We can use it to resolve the error: % coveralls --build-root sample ... File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... But we can't use `--build-root` option when we have two or more directories. See also eddyxu#11 and 0372af0. I created a sample project to try GNU libtool and coverage combination: https://github.com/kou/libtool-coverage-sample You can find the current cpp-coveralls can't report coverage information: https://coveralls.io/builds/465842 With this change, cpp-coveralls can report the correct coverage information: https://coveralls.io/builds/465922
GNU libtool generates object files into `.libs/` directory instead of the source directory. This change removes `.libs/` from paths to generate suitable paths automatically. For example, there is a source file in `sample/greeter.c`: sample `-- greeter.c GNU libtool generates `greeter.o` into `sample/greeter/.libs/greeter.o`: sample |-- .libs | `-- greeter.o `-- greeter.c `.gcno` files are also generated into `.libs/` directory: sample |-- .libs | |-- greeter.gcno | `-- greeter.o `-- greeter.c `coveralls.coverage.run_gcov()` runs `gcov` in the directory that has `.gcno`. In this example, it is `sample/.libs/` directory. But `sample/.libs/` directory doesn't have source file, `greeter.c`. In this situation, `gcov` can't find source file and reports the following error: % coveralls ... Cannot open source file greeter.c File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... cpp-coveralls has `--build-root` option to change the working directory to run `gcov`. We can use it to resolve the error: % coveralls --build-root sample ... File 'greeter.c' Lines executed:100.00% of 2 Creating 'greeter.c.gcov' ... But we can't use `--build-root` option when we have two or more directories. See also #11 and 0372af0. I created a sample project to try GNU libtool and coverage combination: https://github.com/kou/libtool-coverage-sample You can find the current cpp-coveralls can't report coverage information: https://coveralls.io/builds/465842 With this change, cpp-coveralls can report the correct coverage information: https://coveralls.io/builds/465922
I've tried to add coveralls to nijel/enca repo, but cpp-coveralls fails to find some files:
https://travis-ci.org/nijel/enca/jobs/10533670#L939
Not sure if the build system is that special there, but it looks for
lib/data/chinese/zh_weight_big5.h
instead ofdata/chinese/zh_weight_big5.h
.The text was updated successfully, but these errors were encountered: