MB-28749: Use gtest_discover_tests to parallelise memcached_testapp
MB-28749: Use gtest_discover_tests to parallelise memcached_testapp

Now memcached testapp tests have been unified into a single binary, we
have the issue that the test wall-clock time has increased as we are
not parallelising by running each binary seperately.

We /could/ adopt the strategy we previosly had - manually invocating
add_test() with --gtest_filter=<suite pattern> for each group of test
we want to - but this was error-prone as it relied on updating these
filters as tests are added/removed.

Instead, we make use of the new gtest_discover_tests[1] function which
automatically creates add_test for each GoogleTest suite. This works
by introspecting the list of tests in a GoogleTest binary via
--gtest_list_tests, and then creating an instance of add_test for each
test *suite*. This relies on a new flag - ONE_CTEST_PER_SUITE - which
creates a CTest per discovered suite, instead of one CTest per
discovered test.

This results in the following CTests being defined for
memcached_testapp:

  Test  #83: memcached_testapp.default.SslCertTest
  Test  #84: memcached_testapp.default.HelloTest
  Test  #85: memcached_testapp.default.ShutdownTest
  Test  #86: memcached_testapp.default.ssl_decode_protocol
  Test  #87: memcached_testapp.default.WorkerConcurrencyTest
  Test  #88: memcached_testapp.default.ConnectionTimeoutTest
  Test  #89: memcached_testapp.default.TracingTest
  Test  #90: memcached_testapp.default.TransportProtocols/ArithmeticTest
  Test  #91: memcached_testapp.default.TransportProtocols/ArithmeticXattrOnTest
  Test  #92: memcached_testapp.default.TransportProtocols/AuditTest
  Test  #93: memcached_testapp.default.TransportProtocols/BucketTest
  Test  #94: memcached_testapp.default.TransportProtocols/ClusterConfigTest
  Test  #95: memcached_testapp.default.TransportProtocols/DcpTest
  Test  #96: memcached_testapp.default.TransportProtocols/ErrmapTest
  Test  #97: memcached_testapp.default.TransportProtocols/FlushTest
  Test  #98: memcached_testapp.default.TransportProtocols/GetSetTest
  Test  #99: memcached_testapp.default.TransportProtocols/GetSetSnappyOnOffTest
  Test #100: memcached_testapp.default.TransportProtocols/LegacyUsersTest
  Test #101: memcached_testapp.default.TransportProtocols/LockTest
  Test #102: memcached_testapp.default.TransportProtocols/MiscTest
  Test #103: memcached_testapp.default.TransportProtocols/NoAutoselectDefaultBucketTest
  Test #104: memcached_testapp.default.CleanOrUnclean/PersistToTest
  Test #105: memcached_testapp.default.TransportProtocols/RbacTest
  Test #106: memcached_testapp.default.TransportProtocols/RbacRoleTest
  Test #107: memcached_testapp.default.TransportProtocols/RegressionTest
  Test #108: memcached_testapp.default.TransportProtocols/RemoveTest
  Test #109: memcached_testapp.default.TransportProtocols/SaslTest
  Test #110: memcached_testapp.default.TransportProtocols/StatsTest
  Test #111: memcached_testapp.default.TransportProtocols/NoBucketStatsTest
  Test #112: memcached_testapp.default.Subdoc/SubdocTestappTest
  Test #113: memcached_testapp.default.SDPerf/SubdocPerfTest
  Test #114: memcached_testapp.default.Transport/McdTestappTest
  Test #115: memcached_testapp.default.TransportProtocols/TouchTest
  Test #116: memcached_testapp.default.TransportProtocols/TuneMcbpSla
  Test #117: memcached_testapp.default.TransportProtocols/WithMetaTest
  Test #118: memcached_testapp.default.TransportProtocols/XattrTest
  Test #119: memcached_testapp.default.TransportProtocols/XattrDisabledTest
  Test #120: memcached_testapp.default.TransportProtocols/SaslauthdTest

(Note there's also an '.ep' variant for running with ep-engine).

[1]: https://cmake.org/cmake/help/git-stage/module/GoogleTest.html#command:gtest_discover_tests

Change-Id: I6ce42deff379e1001d863acb58e9be5a9eb393ef
Reviewed-on: http://review.couchbase.org/91263
Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
Reviewed-by: Tim Bradgate <f1a26ee65f021cb7d82b83dfb09abf144d3eb64f@couchbase.com>
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine