From f845c74c6243a10ee5df2af003dcf81bbd0b51a0 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 13 Sep 2009 21:31:21 +0000 Subject: Move unittest driver to utils/unittest/UnitTestMain. - This eliminates a race between building the unittests and linking the UnitTestMain library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81719 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/unittest/UnitTestMain/Makefile | 19 +++++++++++++++++++ utils/unittest/UnitTestMain/TestMain.cpp | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 utils/unittest/UnitTestMain/Makefile create mode 100644 utils/unittest/UnitTestMain/TestMain.cpp (limited to 'utils/unittest/UnitTestMain') diff --git a/utils/unittest/UnitTestMain/Makefile b/utils/unittest/UnitTestMain/Makefile new file mode 100644 index 0000000000..07a74e3c0d --- /dev/null +++ b/utils/unittest/UnitTestMain/Makefile @@ -0,0 +1,19 @@ +##===- utils/unittest/UnitTestMain/Makefile ----------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LEVEL = ../../.. + +include $(LEVEL)/Makefile.config + +LIBRARYNAME = UnitTestMain +BUILD_ARCHIVE = 1 +CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include +CPP.Flags += -Wno-variadic-macros + +include $(LEVEL)/Makefile.common diff --git a/utils/unittest/UnitTestMain/TestMain.cpp b/utils/unittest/UnitTestMain/TestMain.cpp new file mode 100644 index 0000000000..d97dca872a --- /dev/null +++ b/utils/unittest/UnitTestMain/TestMain.cpp @@ -0,0 +1,15 @@ +//===--- utils/unittest/UnitTestMain/TestMain.cpp - unittest driver -------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "gtest/gtest.h" + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} -- cgit v1.2.3