title: Cmake and gtest in VS2019
body: <p>I'm having trouble running gtest with cmake in VS2019. It seems like VS test explorer couldn't find my tests. I'm following this <a href="https://google.github.io/googletest/quickstart-cmake.html" rel="nofollow noreferrer">instructions</a></p>
  <p>My <code>CmakeLists.txt</code> (testing part, after project config):</p>
  <pre><code>enable_testing()
  find_package(GTest CONFIG REQUIRED)
  
  add_executable(GatewayTests
    testsG/GatewayMTests.cpp
  )
  target_link_libraries(GatewayTests
    PRIVATE GTest::gmock GTest::gtest GTest::gmock_main GTest::gtest_main
  )
  include(GoogleTest)
  gtest_discover_tests(GatewayTests)
  </code></pre>
  <p>My <code>GatewayMTests.cpp</code>:</p>
  <pre><code>#include &quot;gtest/gtest.h&quot;
  #include &lt;format&gt;
  
      TEST(HelloTest, BasicAssertions) {
          // Expect two strings not to be equal.
          EXPECT_STRNE(&quot;hello&quot;, &quot;world&quot;);
          // Expect equality.
          EXPECT_EQ(7 * 6, 43);
      }
  </code></pre>
  <p>Everything builds fine, but VS test explorer can't find any tests. Is there anything I've missed?</p>
  <p>UPD:
  I also ran this version of <code>CMakelists.txt</code>:</p>
  <pre><code>enable_testing()
  find_package            (GTest CONFIG REQUIRED)
  add_executable          (GatewayTests testsG/GatewayMTests.cpp)
  target_link_libraries   (GatewayTests PRIVATE GTest::gmock GTest::gtest GTest::gmock_main GTest::gtest_main)
  add_test                (GatewayTests GatewayTests )
  </code></pre>
  <p>Now test explorer sees this test:
  <a href="https://i.stack.imgur.com/h1PxJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h1PxJ.png" alt="enter image description here" /></a></p>
  <p>And somehow it passed. I've tried run tests in debug, but it never gets past signature:
  <a href="https://i.stack.imgur.com/r3Dx6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r3Dx6.png" alt="enter image description here" /></a></p>