Fix tests.

As we use the main library of gtest (if already installed)
we don't need to (and must not) define a main function for the tests.

Does the same (use main library) if we use the subproject.
This commit is contained in:
Matthieu Gautier 2020-01-20 17:00:18 +01:00
parent 0f99c1ad20
commit 4fe31a20e3
8 changed files with 1 additions and 40 deletions

View File

@ -10,9 +10,3 @@ TEST(KiwixServeTest, PortTest)
EXPECT_EQ(kiwixServe.setPort(0), -1);
EXPECT_EQ(kiwixServe.setPort(3456789), -1);
}
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

View File

@ -259,9 +259,3 @@ TEST_F(LibraryTest, filterCheck)
}
};
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

View File

@ -13,7 +13,7 @@ tests = [
gtest_dep = dependency('gtest',
main:true,
fallback: ['gtest', 'gtest_dep'],
fallback: ['gtest', 'gtest_main_dep'],
required:false)
if gtest_dep.found()

View File

@ -65,9 +65,3 @@ TEST(ParseUrlTest, valid)
ASSERT_EQ(title, "/title");
}
};
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

View File

@ -227,8 +227,3 @@ TEST(pathTools, WideToUtf8)
};
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

View File

@ -101,9 +101,3 @@ TEST(append, middle)
}
};
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

View File

@ -54,8 +54,3 @@ TEST(stringTools, split)
}
};
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

View File

@ -95,8 +95,3 @@ TEST(ParseTagTest, invalid)
}
};
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}