aboutsummaryrefslogtreecommitdiffstats
path: root/utils/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'utils/unittest')
-rw-r--r--utils/unittest/CMakeLists.txt9
-rw-r--r--utils/unittest/googletest/Makefile3
-rw-r--r--utils/unittest/googletest/README.LLVM16
-rw-r--r--utils/unittest/googletest/include/gtest/gtest-test-part.h2
-rw-r--r--utils/unittest/googletest/include/gtest/gtest.h5
-rw-r--r--utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h4
-rw-r--r--utils/unittest/googletest/include/gtest/internal/gtest-internal.h3
-rw-r--r--utils/unittest/googletest/include/gtest/internal/gtest-param-util.h2
-rw-r--r--utils/unittest/googletest/include/gtest/internal/gtest-port.h4
-rw-r--r--utils/unittest/googletest/src/gtest-all.cc (renamed from utils/unittest/googletest/gtest-all.cc)14
-rw-r--r--utils/unittest/googletest/src/gtest-death-test.cc (renamed from utils/unittest/googletest/gtest-death-test.cc)8
-rw-r--r--utils/unittest/googletest/src/gtest-filepath.cc (renamed from utils/unittest/googletest/gtest-filepath.cc)0
-rw-r--r--utils/unittest/googletest/src/gtest-internal-inl.h (renamed from utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h)2
-rw-r--r--utils/unittest/googletest/src/gtest-port.cc (renamed from utils/unittest/googletest/gtest-port.cc)16
-rw-r--r--utils/unittest/googletest/src/gtest-printers.cc (renamed from utils/unittest/googletest/gtest-printers.cc)0
-rw-r--r--utils/unittest/googletest/src/gtest-test-part.cc (renamed from utils/unittest/googletest/gtest-test-part.cc)2
-rw-r--r--utils/unittest/googletest/src/gtest-typed-test.cc (renamed from utils/unittest/googletest/gtest-typed-test.cc)0
-rw-r--r--utils/unittest/googletest/src/gtest.cc (renamed from utils/unittest/googletest/gtest.cc)12
18 files changed, 59 insertions, 43 deletions
diff --git a/utils/unittest/CMakeLists.txt b/utils/unittest/CMakeLists.txt
index 8bdfee1..fd1a048 100644
--- a/utils/unittest/CMakeLists.txt
+++ b/utils/unittest/CMakeLists.txt
@@ -14,6 +14,7 @@
# Where gtest's .h files can be found.
include_directories(
googletest/include
+ googletest
)
if(WIN32)
@@ -38,13 +39,7 @@ if(MSVC AND MSVC_VERSION EQUAL 1700)
endif ()
add_llvm_library(gtest
- googletest/gtest.cc
- googletest/gtest-death-test.cc
- googletest/gtest-filepath.cc
- googletest/gtest-port.cc
- googletest/gtest-printers.cc
- googletest/gtest-test-part.cc
- googletest/gtest-typed-test.cc
+ googletest/src/gtest-all.cc
)
add_llvm_library(gtest_main
diff --git a/utils/unittest/googletest/Makefile b/utils/unittest/googletest/Makefile
index bf73670..3d85e7d 100644
--- a/utils/unittest/googletest/Makefile
+++ b/utils/unittest/googletest/Makefile
@@ -19,6 +19,7 @@ REQUIRES_RTTI = 1
# unittests/Makefile.unittest and ../UnitTestMain/Makefile; ensure that any
# changes are made to both.
CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include
+CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest
CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS)
CPP.Flags += -DGTEST_HAS_RTTI=0
# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not
@@ -36,6 +37,6 @@ endif
NO_INSTALL = 1
-SOURCES = $(filter-out gtest-all.cc, $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cc)))
+SOURCES = src/gtest-all.cc
include $(LEVEL)/Makefile.common
diff --git a/utils/unittest/googletest/README.LLVM b/utils/unittest/googletest/README.LLVM
index 3565a32..1a6f0f5 100644
--- a/utils/unittest/googletest/README.LLVM
+++ b/utils/unittest/googletest/README.LLVM
@@ -10,23 +10,11 @@ Cleaned up as follows:
$ rm -f aclocal* CMakeLists.txt configure* Makefile* CHANGES CONTRIBUTORS README
$ rm -rf build-aux cmake codegear fused-src m4 make msvc samples scripts test xcode
$ rm -f `find . -name \*\.pump`
+$ rm -f src/gtest_main.cc
-# Move all the source files to the current directory
-$ mv src/* .
-$ rmdir src
-
-# Move extra headers into the already-existing internal headers dir
-$ mv *.h include/gtest/internal/
-
-# Update paths to the included files
-$ perl -pi -e 's|^#include "src/|#include "|' gtest-all.cc
-$ perl -pi -e 's|^#include "src/|#include "gtest/internal/|' *.cc
-
-$ rm -f gtest_main.cc
-
+# Put the license in the consistent place for LLVM.
$ mv COPYING LICENSE.TXT
-
Modified as follows:
* To GTestStreamToHelper in include/gtest/internal/gtest-internal.h,
added the ability to stream with raw_os_ostream.
diff --git a/utils/unittest/googletest/include/gtest/gtest-test-part.h b/utils/unittest/googletest/include/gtest/gtest-test-part.h
index 8aeea14..98e8b84 100644
--- a/utils/unittest/googletest/include/gtest/gtest-test-part.h
+++ b/utils/unittest/googletest/include/gtest/gtest-test-part.h
@@ -142,7 +142,7 @@ class GTEST_API_ TestPartResultArray {
// This interface knows how to report a test part result.
class TestPartResultReporterInterface {
public:
- virtual ~TestPartResultReporterInterface() {}
+ virtual ~TestPartResultReporterInterface();
virtual void ReportTestPartResult(const TestPartResult& result) = 0;
};
diff --git a/utils/unittest/googletest/include/gtest/gtest.h b/utils/unittest/googletest/include/gtest/gtest.h
index 1734c44..07ed92b 100644
--- a/utils/unittest/googletest/include/gtest/gtest.h
+++ b/utils/unittest/googletest/include/gtest/gtest.h
@@ -910,7 +910,7 @@ class GTEST_API_ TestCase {
class Environment {
public:
// The d'tor is virtual as we need to subclass Environment.
- virtual ~Environment() {}
+ virtual ~Environment();
// Override this to define how to set up the environment.
virtual void SetUp() {}
@@ -928,7 +928,7 @@ class Environment {
// the order the corresponding events are fired.
class TestEventListener {
public:
- virtual ~TestEventListener() {}
+ virtual ~TestEventListener();
// Fired before any test activity starts.
virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
@@ -980,6 +980,7 @@ class TestEventListener {
// comments about each method please see the definition of TestEventListener
// above.
class EmptyTestEventListener : public TestEventListener {
+ virtual void anchor();
public:
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
diff --git a/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h b/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
index 7bac2bd..8d53c45 100644
--- a/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ b/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
@@ -79,7 +79,7 @@ class GTEST_API_ DeathTest {
static bool Create(const char* statement, const RE* regex,
const char* file, int line, DeathTest** test);
DeathTest();
- virtual ~DeathTest() { }
+ virtual ~DeathTest();
// A helper class that aborts a death test when it's deleted.
class ReturnSentinel {
@@ -139,7 +139,7 @@ class GTEST_API_ DeathTest {
// Factory interface for death tests. May be mocked out for testing.
class DeathTestFactory {
public:
- virtual ~DeathTestFactory() { }
+ virtual ~DeathTestFactory();
virtual bool Create(const char* statement, const RE* regex,
const char* file, int line, DeathTest** test) = 0;
};
diff --git a/utils/unittest/googletest/include/gtest/internal/gtest-internal.h b/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
index a94bf28..63f72ac 100644
--- a/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
+++ b/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
@@ -105,6 +105,7 @@
#if !GTEST_NO_LLVM_RAW_OSTREAM
namespace llvm {
class convertible_fwd_ostream : public std::ostream {
+ virtual void anchor();
raw_os_ostream ros_;
public:
@@ -536,7 +537,7 @@ GTEST_API_ TypeId GetTestTypeId();
// of a Test object.
class TestFactoryBase {
public:
- virtual ~TestFactoryBase() {}
+ virtual ~TestFactoryBase();
// Creates a test instance to run. The instance is both created and destroyed
// within TestInfoImpl::Run()
diff --git a/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h b/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
index 0ef9718..3bb2ffb 100644
--- a/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
+++ b/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
@@ -414,7 +414,7 @@ class TestMetaFactory
// and calls RegisterTests() on each of them when asked.
class ParameterizedTestCaseInfoBase {
public:
- virtual ~ParameterizedTestCaseInfoBase() {}
+ virtual ~ParameterizedTestCaseInfoBase();
// Base part of test case name for display purposes.
virtual const string& GetTestCaseName() const = 0;
diff --git a/utils/unittest/googletest/include/gtest/internal/gtest-port.h b/utils/unittest/googletest/include/gtest/internal/gtest-port.h
index 58f6caf..32fd9c6 100644
--- a/utils/unittest/googletest/include/gtest/internal/gtest-port.h
+++ b/utils/unittest/googletest/include/gtest/internal/gtest-port.h
@@ -1116,7 +1116,7 @@ class Notification {
// problem.
class ThreadWithParamBase {
public:
- virtual ~ThreadWithParamBase() {}
+ virtual ~ThreadWithParamBase();
virtual void Run() = 0;
};
@@ -1290,7 +1290,7 @@ typedef GTestMutexLock MutexLock;
// ThreadLocalValueHolderBase.
class ThreadLocalValueHolderBase {
public:
- virtual ~ThreadLocalValueHolderBase() {}
+ virtual ~ThreadLocalValueHolderBase();
};
// Called by pthread to delete thread-local data stored by
diff --git a/utils/unittest/googletest/gtest-all.cc b/utils/unittest/googletest/src/gtest-all.cc
index 97753e5..0a9cee5 100644
--- a/utils/unittest/googletest/gtest-all.cc
+++ b/utils/unittest/googletest/src/gtest-all.cc
@@ -39,10 +39,10 @@
#include "gtest/gtest.h"
// The following lines pull in the real gtest *.cc files.
-#include "gtest.cc"
-#include "gtest-death-test.cc"
-#include "gtest-filepath.cc"
-#include "gtest-port.cc"
-#include "gtest-printers.cc"
-#include "gtest-test-part.cc"
-#include "gtest-typed-test.cc"
+#include "src/gtest.cc"
+#include "src/gtest-death-test.cc"
+#include "src/gtest-filepath.cc"
+#include "src/gtest-port.cc"
+#include "src/gtest-printers.cc"
+#include "src/gtest-test-part.cc"
+#include "src/gtest-typed-test.cc"
diff --git a/utils/unittest/googletest/gtest-death-test.cc b/utils/unittest/googletest/src/gtest-death-test.cc
index bf7e32c..314dba2 100644
--- a/utils/unittest/googletest/gtest-death-test.cc
+++ b/utils/unittest/googletest/src/gtest-death-test.cc
@@ -63,7 +63,7 @@
// prevent a user from accidentally including gtest-internal-inl.h in
// his code.
#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
+#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace testing {
@@ -300,6 +300,9 @@ DeathTest::DeathTest() {
}
}
+// Pin the vtable to this file.
+DeathTest::~DeathTest() {}
+
// Creates and returns a death test by dispatching to the current
// death test factory.
bool DeathTest::Create(const char* statement, const RE* regex,
@@ -1091,6 +1094,9 @@ bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
return true;
}
+// Pin the vtable to this file.
+DeathTestFactory::~DeathTestFactory() {}
+
// Splits a given string on a given delimiter, populating a given
// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have
// ::std::string, so we can use it here.
diff --git a/utils/unittest/googletest/gtest-filepath.cc b/utils/unittest/googletest/src/gtest-filepath.cc
index ad1bab8..ad1bab8 100644
--- a/utils/unittest/googletest/gtest-filepath.cc
+++ b/utils/unittest/googletest/src/gtest-filepath.cc
diff --git a/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h b/utils/unittest/googletest/src/gtest-internal-inl.h
index 6554cfc..1bae630 100644
--- a/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
+++ b/utils/unittest/googletest/src/gtest-internal-inl.h
@@ -408,7 +408,7 @@ GTEST_API_ FilePath GetCurrentExecutableName();
class OsStackTraceGetterInterface {
public:
OsStackTraceGetterInterface() {}
- virtual ~OsStackTraceGetterInterface() {}
+ virtual ~OsStackTraceGetterInterface();
// Returns the current OS stack trace as a String. Parameters:
//
diff --git a/utils/unittest/googletest/gtest-port.cc b/utils/unittest/googletest/src/gtest-port.cc
index 3c32ff1..94fc57f 100644
--- a/utils/unittest/googletest/gtest-port.cc
+++ b/utils/unittest/googletest/src/gtest-port.cc
@@ -62,7 +62,7 @@
// prevent a user from accidentally including gtest-internal-inl.h in
// his code.
#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
+#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace testing {
@@ -746,5 +746,19 @@ const char* StringFromGTestEnv(const char* flag, const char* default_value) {
return value == NULL ? default_value : value;
}
+// Pin the vtables to this file.
+#if GTEST_HAS_PTHREAD
+ThreadWithParamBase::~ThreadWithParamBase() {}
+ThreadLocalValueHolderBase::~ThreadLocalValueHolderBase() {}
+#endif
+TestFactoryBase::~TestFactoryBase() {}
+
} // namespace internal
} // namespace testing
+
+// Pin the vtable to this file.
+#if !GTEST_NO_LLVM_RAW_OSTREAM
+namespace llvm {
+void convertible_fwd_ostream::anchor() {}
+}
+#endif
diff --git a/utils/unittest/googletest/gtest-printers.cc b/utils/unittest/googletest/src/gtest-printers.cc
index 205a394..205a394 100644
--- a/utils/unittest/googletest/gtest-printers.cc
+++ b/utils/unittest/googletest/src/gtest-printers.cc
diff --git a/utils/unittest/googletest/gtest-test-part.cc b/utils/unittest/googletest/src/gtest-test-part.cc
index 1612780..5ddc67c 100644
--- a/utils/unittest/googletest/gtest-test-part.cc
+++ b/utils/unittest/googletest/src/gtest-test-part.cc
@@ -39,7 +39,7 @@
// prevent a user from accidentally including gtest-internal-inl.h in
// his code.
#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
+#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace testing {
diff --git a/utils/unittest/googletest/gtest-typed-test.cc b/utils/unittest/googletest/src/gtest-typed-test.cc
index a5cc88f..a5cc88f 100644
--- a/utils/unittest/googletest/gtest-typed-test.cc
+++ b/utils/unittest/googletest/src/gtest-typed-test.cc
diff --git a/utils/unittest/googletest/gtest.cc b/utils/unittest/googletest/src/gtest.cc
index eb5c68c..bf850c6 100644
--- a/utils/unittest/googletest/gtest.cc
+++ b/utils/unittest/googletest/src/gtest.cc
@@ -129,7 +129,7 @@
// prevent a user from accidentally including gtest-internal-inl.h in
// his code.
#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
+#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
#if GTEST_OS_WINDOWS
@@ -4863,4 +4863,14 @@ void InitGoogleTest(int* argc, wchar_t** argv) {
internal::InitGoogleTestImpl(argc, argv);
}
+// Pin the vtables to this file.
+Environment::~Environment() {}
+TestPartResultReporterInterface::~TestPartResultReporterInterface() {}
+TestEventListener::~TestEventListener() {}
+void EmptyTestEventListener::anchor() {}
+namespace internal {
+OsStackTraceGetterInterface::~OsStackTraceGetterInterface() {}
+ParameterizedTestCaseInfoBase::~ParameterizedTestCaseInfoBase() {}
+}
+
} // namespace testing