Bug #76824 Add unit test binaries as optional targets when MERGE_UNITTESTS=1
Submitted: 24 Apr 2015 11:22 Modified: 28 Apr 2015 12:46
Reporter: Dyre Tjeldvoll Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S4 (Feature request)
Version:8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[24 Apr 2015 11:22] Dyre Tjeldvoll
Description:
If a dev wants to run an individual unit test, either because a new test is being developed, a new testcase is being added, or to reproduce a problem, she has to reconfigure her build directory with MERGE_UNITTESTS=0. This increases the build time significantly, and makes the build directory much larger.

How to repeat:
cmake -DMERGE_UNITTESTS=0

Suggested fix:
Modify unittest/gunit/CMakeLists.txt so that it always adds the targets for the individual unittest binaries.
When MERGE_UNITTESTS=1 the EXCLUDE_FROM_ALL property is set on the target, and the binary is not added to ctest with ADD_TEST().
When MERGE_UNITTESTS=0 the EXLUDE_FROM_ALL property is NOT set, and the binary is added with ADD_TEST() as before.
Then a plain 'make' will only build merge_large_tests-t and merge_small_tests-t, but is still possible to do 'make x-t' even in a default (MERGE_UNITTESTS=1) configuration.
[28 Apr 2015 12:46] Paul DuBois
Fixed in 5.6.25, 5.7.8, 5.8.0. Changes for test suite. No changelog entry needed.
[18 Jun 2016 21:26] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0