tests: read test data directly from the source dir#78
tests: read test data directly from the source dir#78
Conversation
These used to be copied to the build dir, but they tended to get out of date, as they were only copied during configuration. The test data directory is baked into the test executables, so they can be ran outside of ctest easily. This adds a function to get the full path of a test data, so if we want to change this again it should be a bit easier.
96026c7 to
b78a5d9
Compare
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
=======================================
Coverage 89.51% 89.51%
=======================================
Files 115 115
Lines 5534 5534
=======================================
Hits 4954 4954
Misses 580 580 Continue to review full report at Codecov.
|
|
This looks good, but a couple of questions
|
The current implementation will sometimes write
Personally I'm happy with this, because git makes it pretty easy to tidy up, and it doesn't generally happen since in most cases people will not run tests manually. I wouldn't be opposed to changing it, though.
I hadn't considered that. Other solutions would be to have FileComparator write the accepted file to the build dir on test failure(though then if you want to edit it, you might edit the wrong one), or to print the both path names on failure (unfortunately it wraps the output of describe()...). I don't really mind writing them to the source dir though. |
These used to be copied to the build dir, but they tended to get out of
date, as they were only copied during configuration.
With this, the test data directory is baked into the test executables, so they can
be ran outside of ctest easily.
This adds a function to get the full path of a test data file, so if we want
to change this again it should be a bit easier.
Fixes #77