summaryrefslogtreecommitdiffstats
path: root/llvm/utils/unittest
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-13 21:31:21 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-13 21:31:21 +0000
commit6be903e18588fe1c4666b93605dd8fa270a5b785 (patch)
tree2e2734d67247aad32cfc33f10a14e8897cacebb1 /llvm/utils/unittest
parent51e72707b7b1258bf2a7811ee6d1557d735a58c9 (diff)
downloadbcm5719-llvm-6be903e18588fe1c4666b93605dd8fa270a5b785.tar.gz
bcm5719-llvm-6be903e18588fe1c4666b93605dd8fa270a5b785.zip
Move unittest driver to utils/unittest/UnitTestMain.
- This eliminates a race between building the unittests and linking the UnitTestMain library. llvm-svn: 81719
Diffstat (limited to 'llvm/utils/unittest')
-rw-r--r--llvm/utils/unittest/Makefile2
-rw-r--r--llvm/utils/unittest/UnitTestMain/Makefile19
-rw-r--r--llvm/utils/unittest/UnitTestMain/TestMain.cpp15
3 files changed, 35 insertions, 1 deletions
diff --git a/llvm/utils/unittest/Makefile b/llvm/utils/unittest/Makefile
index 2f3e601b41b..6a09341832b 100644
--- a/llvm/utils/unittest/Makefile
+++ b/llvm/utils/unittest/Makefile
@@ -8,6 +8,6 @@
##===----------------------------------------------------------------------===##
LEVEL = ../..
-PARALLEL_DIRS = googletest
+PARALLEL_DIRS = googletest UnitTestMain
include $(LEVEL)/Makefile.common
diff --git a/llvm/utils/unittest/UnitTestMain/Makefile b/llvm/utils/unittest/UnitTestMain/Makefile
new file mode 100644
index 00000000000..07a74e3c0db
--- /dev/null
+++ b/llvm/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/llvm/utils/unittest/UnitTestMain/TestMain.cpp b/llvm/utils/unittest/UnitTestMain/TestMain.cpp
new file mode 100644
index 00000000000..d97dca872ad
--- /dev/null
+++ b/llvm/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();
+}
OpenPOWER on IntegriCloud