[CMAKE] Allow for installing test executables
Summary:
By default none is installed.
Installation via components (the usual way) is not really possible with
tests which have EXCLUDE_FROM_ALL targets. Depending on your cmake
version the support may vary, but generally speaking cmake doesn't know
how to handle it. A solution is to create a custom target to run the
installation that will take care of building the executable targets
first.
The tests can be installed via several install targets:
- install-tests builds and installs all the tests
- install-test-suite-<suite> builds and installs the tests from a
single test suite.
- install-<suite>-<test> builds an installs a single test from
Test Plan:
Note: no need to build anything prior running the commands.
ninja install-tests ninja install-test-suite-avalanche ninja install-leveldb-arena_test
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D7209