Commit 11566445 authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Fix FBStringTest to work with CMake 3.9 or later (#1080)

Summary:
- CMake 3.9 or later has the `GoogleTest` module which allows for the
  ability to automatically add tests to CTest by scanning the source code
  for Google Test Macros. This is used in `CMake/FollyFunctions.cmake`.
  However, this scanning is just exact string search without full context.
  So, this flags a comment in  `FBStringTest.cpp`. As a result, it tries to
  register the comment matching the macro as a new test. Since the comment
  matches an exact test case which has already been defined, this results in
  a hard error as you cannot have two test cases of the same name in the same
  test suite. The error is as follows:

```
  add_test given test NAME "fbstring_test.FBString.testMoveCtor" which
  already exists in this directory.
Call Stack (most recent call first):
  CMake/FollyFunctions.cmake:268 (gtest_add_tests)
  CMakeLists.txt:481 (folly_define_tests)
```

- Fix the comment to keep the same intent but not get treated as a test
  registration.
Pull Request resolved: https://github.com/facebook/folly/pull/1080

Differential Revision: D14613558

Pulled By: yfeldblum

fbshipit-source-id: 74ebef0ba9a8690ff8f3dfd4cd049f72114ef9a5
parent 3886ce15
......@@ -94,7 +94,7 @@ void clause11_21_4_2_b(String& test) {
template <class String>
void clause11_21_4_2_c(String& test) {
// Test move constructor. There is a more specialized test, see
// TEST(FBString, testMoveCtor)
// testMoveCtor test
String donor(test);
String test2(std::move(donor));
EXPECT_EQ(test2, test);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment