Add TestSourcePathRoots to settings for better discovery of source locations#15
Add TestSourcePathRoots to settings for better discovery of source locations#15vvuk wants to merge 2 commits intoxkbeyer:masterfrom
Conversation
…ery of proper source path locations
|
That's interesting, could you provide a small example project which shows the relative path problem? I would like to see how it works. I agree, that it would be better to resolve it w/o having to configure anything. |
|
Hmm, I don't know if I can easily -- the project is generated from our own internal build system, but I can describe the structure. The project that contains the test structure,
Each catch runner has embedded filenames that are relative to |
|
If you run |
|
We use The test source files are built with: What's interesting is that the same file built on the same machine with the same build system, but a different compiler, ends up with an absolute filename. I'll try to isolate it. |
|
Ah. The issue is due to a relative path being specified on the command line. FILE expands out to whatever the command line argument is; I believe VS, when built using msbuild, always expands out the full absolute path on the command line it passes to cl.exe. |
|
I'm not sure how to pull out |
|
Ah Ok, I'll try to set it up that way. Will see how far I get. Regarding the SolutionDirectory: You are right. I confused it with the |
|
I can now reproduce your case. |
|
Yep, I prefer the SolutionDir solution as well :) Glad you found a way -- the attached zip file works great for me. |
|
I made a new release version 1.4.1. |
My project results in catch test containers that report relative filenames, e.g.
modules/foo/bar.cpp. They're relative to the solution root, but they seem to attempt to be resolved relative to the test executable itself (or.. who knows where the test runner resolves them against, in any case it's not the solution root). This PR adds aTestSourcePathRootsto the config where paths can be explicitly specified.I would ideally like to have those paths be relative to the solution root (right now they have to be explicit, which is less than ideal), and include the solution root in the search list, but I wasn't sure if it was possible to get that info during the discovery process.