summaryrefslogtreecommitdiff
path: root/utils/unittest/UnitTestMain/TestMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/unittest/UnitTestMain/TestMain.cpp')
-rw-r--r--utils/unittest/UnitTestMain/TestMain.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/unittest/UnitTestMain/TestMain.cpp b/utils/unittest/UnitTestMain/TestMain.cpp
index 36cec2d47424..5660b44f41a3 100644
--- a/utils/unittest/UnitTestMain/TestMain.cpp
+++ b/utils/unittest/UnitTestMain/TestMain.cpp
@@ -9,9 +9,9 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Signals.h"
+#include "gmock/gmock.h"
#include "gtest/gtest.h"
-
#if defined(_WIN32)
# include <windows.h>
# if defined(_MSC_VER)
@@ -24,7 +24,10 @@ const char *TestMainArgv0;
int main(int argc, char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal(argv[0],
true /* Disable crash reporting */);
- testing::InitGoogleTest(&argc, argv);
+
+ // Initialize both gmock and gtest.
+ testing::InitGoogleMock(&argc, argv);
+
llvm::cl::ParseCommandLineOptions(argc, argv);
// Make it easy for a test to re-execute itself by saving argv[0].