8000 search_paths in configuration file · Issue #1040 · gcovr/gcovr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

search_paths in configuration file #1040

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 term 8000 s of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sanath-vishwanath opened this issue Dec 17, 2024 · 15 comments
Closed

search_paths in configuration file #1040

sanath-vishwanath opened this issue Dec 17, 2024 · 15 comments

Comments

@sanath-vishwanath
Copy link

I want to use ../ (parent directory) as search_paths. If I pass the command gcovr ../ in cli, it works fine (checked in verbose as well, it scans the ../ directory). However, if I use a configuration file and put search-path = ../ it doesn't work and instead scans the . directory. What should I put as the value for search-path?

@Spacetown
Copy link
Member

Can you explain your directory layout?
The search path in the configuration file is treated as relative to the directory of the configuration file. If your file is in a sub directory it results in..

@sanath-vishwanath
Copy link
Author

I have the Makefile, config file and other files needed for running unit tests in 'child' folder. The source files are one level above, aka 'parent' folder. I run make, executables and also gcovr cli from child folder, hence the command gcovr ../ works.

@Spacetown
Copy link
Member

And the config file with the search paths is in the working directory?

@sanath-vishwanath
Copy link
Author

Yes, the config file is in the working directory.

@Spacetown
Copy link
Member

Can you post the start of the verbose outputs where the configuration is printed?

@sanath-vishwanath
Copy link
Author
sanath-vishwanath commented Dec 17, 2024
Filters for --root: (1)
- re.compile('^/home/user/src_files/unit_testing')
Filters for --filter: (1)
- RelativeFilter(.* root=)
Filters for --exclude: (1)
- RelativeFilter(mock root=/home/user/src_files/unit_testing)
Filters for --gcov-filter: (1)
- AlwaysMatchFilter()
Filters for --gcov-exclude: (0)
Filters for --exclude-directories: (0)
Scanning directory . for gcda/gcno files...
Found 0 files (and will process 0)
Scanning directory . for gcda/gcno files...
Found 0 files (and will process 0)
Scanning directory / for gcda/gcno files...

This is the gcovr.cfg file:

txt-branch = yes
filter = .*
exclude = mock
verbose = yes
search-path = ../

@sanath-vishwanath
Copy link
Author

Github is turning my console output into bullet points please ignore that

@Spacetown
Copy link
Member

Github is turning my console output into bullet points please ignore that

Not Github, this is Markdown syntax. Use always verbatim text blocks.

@Spacetown
Copy link
Member

Can you add the command line and the working directory?

@sanath-vishwanath
Copy link
Author
REDACTED:~/home/user/src_files/unit_testing$ gcovr
Filters for --root: (1)
- re.compile('^/home/user/src_files/unit_testing/')
Filters for --filter: (1)
- RelativeFilter(.* root=)
Filters for --exclude: (1)
- RelativeFilter(mock root=/home/user/src_files/unit_testing)
Filters for --gcov-filter: (1)
- AlwaysMatchFilter()
Filters for --gcov-exclude: (0)
Filters for --exclude-directories: (0)
Scanning directory . for gcda/gcno files...
Found 0 files (and will process 0)
Scanning directory . for gcda/gcno files...
Found 0 files (and will process 0)
Scanning directory / for gcda/gcno files...

Pls note: I have changed directory names to safeguard some sensitive data just in case

@sanath-vishwanath
Copy link
Author
sanath-vishwanath commented Dec 17, 2024
REDACTED:~/home/user/src_files/unit_testing$ gcovr ../
Filters for --root: (1)
- re.compile('^/home/user/src_files/unit_testing/')
Filters for --filter: (1)
- RelativeFilter(.* root=)
Filters for --exclude: (1)
- RelativeFilter(mock root=/home/user/src_files/unit_testing)
Filters for --gcov-filter: (1)
- AlwaysMatchFilter()
Filters for --gcov-exclude: (0)
Filters for --exclude-directories: (0)
Scanning directory ../ for gcda/gcno files...
Found 2 files (and will process 1)
Pool started with 1 threads

This is when override the config file's search paths with cli. I guess the question is, how do I specify the parent directory as a relative path in the config file for the search-path?

@Spacetown
Copy link
Member

Now I get the problem. The path ../ is split into ., . and /.
Which version are you using? In Version 5.2 there was a fix for this (#612)

@sanath-vishwanath
Copy link
Author
sanath-vishwanath commented Dec 17, 2024

I am using gcovr version 5.0

Edit: So the only solution is to upgrade to 5.2?

@Spacetown
Copy link
Member

I am using gcovr version 5.0

Edit: So the only solution is to upgrade to 5.2?

Or the newest one.

@sanath-vishwanath
Copy link
Author

Got it...Thank you! Will mark this as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0