Remove main() from most tests.

This gives some flexibility to embedders.

Currently, embedders have to build a binary for each test file.

After this CL, embedders can still choose to have a binary for each test
file, by linking each test file with a googletest target that includes
main() (usually "gtest_main"). Embedders can also choose to build a
single binary for almost all test files, and link with a googletest
target that includes main(). The latter is more convenient for projects
that have very few test binaries, like Chromium.

PiperOrigin-RevId: 419470798
This commit is contained in:
Victor Costan
2022-01-03 20:57:56 +00:00
committed by Victor Costan
parent b2801ee1a0
commit 8f464e7f68
29 changed files with 54 additions and 174 deletions

View File

@@ -130,8 +130,3 @@ TEST(WriteBatchTest, ApproximateSize) {
}
} // namespace leveldb
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}