blob: 1be819fab72e69b90eca6038cde24afc42a142c4 [file] [log] [blame]
//===--- utils/unittest/UnitTestMain/TestMain.cpp - unittest driver -------===//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#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)
# include <crtdbg.h>
# endif
const char *TestMainArgv0;
int main(int argc, char **argv) {
true /* Disable crash reporting */);
// 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].
TestMainArgv0 = argv[0];
# if defined(_WIN32)
// Disable all of the possible ways Windows conspires to make automated
// testing impossible.
# if defined(_MSC_VER)
# endif
# endif
return RUN_ALL_TESTS();