cmake: Add UniValue tests to the ctest suit#73
Conversation
650e0b7 to
88d695f
Compare
88d695f to
b72a92c
Compare
67ceebb to
203a3ab
Compare
b72a92c to
6d0ac42
Compare
|
Rebased. |
6d0ac42 to
ccf28f0
Compare
ff2f574 to
dacc6f7
Compare
ccf28f0 to
3028e07
Compare
5461cf2 to
7ec0697
Compare
17f4870 to
6367599
Compare
7ec0697 to
6ecf7eb
Compare
|
Rebased and undrafted. |
6ecf7eb to
d554706
Compare
| add_all_test_targets() | ||
| endif() | ||
|
|
||
| if(TARGET unitester) |
There was a problem hiding this comment.
Out of curiosity, why are these defined here rather than inline with the build rules?
Specifically here, why not do the add_test in src/univalue/CMakeLists.txt ?
I don't have any objection, I just keep forgetting to ask.
There was a problem hiding this comment.
The ctest executable looks for tests in the current directory, which can be specified explicitly using the --test-dir option in CTest >=3.20. When using the add_test command in CMake, a new test is placed into the build tree with the same relative path as the location of the file, which executes the command, in the source tree. This behavior is consistent with how the add_executable and add_library commands work.
Therefore, the purpose of the cmake/tests.cmake file is to collect all add_test commands, ensuring that all tests are discoverable by ctest within a single directory.
EDIT. Please ignore this comment.
pablomartin4btc
left a comment
There was a problem hiding this comment.
post-merge tACK d554706
Verified the UniValue tests were added (before total was 125, now 127)
Start 126: univalue_test
111/127 Test #126: univalue_test ............................................................... Passed 0.02 sec
Start 127: univalue_object_test
112/127 Test #127: univalue_object_test ........................................................ Passed 0.00 sec
As it was pointed out by TheCharlatan and fanquake during the recent offline meeting, since bitcoin#25369, the Univalue unit tests must be included to the
ctestsuit.