]> granicus.if.org Git - llvm/commit
[gtest] Create a shared include directory for gtest utilities.
authorZachary Turner <zturner@google.com>
Wed, 14 Jun 2017 16:41:50 +0000 (16:41 +0000)
committerZachary Turner <zturner@google.com>
Wed, 14 Jun 2017 16:41:50 +0000 (16:41 +0000)
commit83a953d909d55d1af24106f85b4f85ccbf445da7
treed9b5f7867781ace2aeb3ecb5956483733bef3c3c
parent63d2fab3cfd80f03b1530c0464a7d45249f8ce99
[gtest] Create a shared include directory for gtest utilities.

Many times unit tests for different libraries would like to use
the same helper functions for checking common types of errors.

This patch adds a common library with helpers for testing things
in Support, and introduces helpers in here for integrating the
llvm::Error and llvm::Expected<T> classes with gtest and gmock.

Normally, we would just be able to write:

   EXPECT_THAT(someFunction(), succeeded());

but due to some quirks in llvm::Error's move semantics, gmock
doesn't make this easy, so two macros EXPECT_THAT_ERROR() and
EXPECT_THAT_EXPECTED() are introduced to gloss over the difficulties.
Consider this an exception, and possibly only temporary as we
look for ways to improve this.

Differential Revision: https://reviews.llvm.org/D33059

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305395 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/Testing/Support/Error.h [new file with mode: 0644]
include/llvm/Testing/Support/SupportHelpers.h [new file with mode: 0644]
lib/CMakeLists.txt
lib/LLVMBuild.txt
lib/Testing/CMakeLists.txt [new file with mode: 0644]
lib/Testing/LLVMBuild.txt [new file with mode: 0644]
lib/Testing/Support/CMakeLists.txt [new file with mode: 0644]
lib/Testing/Support/Error.cpp [new file with mode: 0644]
lib/Testing/Support/LLVMBuild.txt [new file with mode: 0644]
unittests/DebugInfo/CodeView/CMakeLists.txt
unittests/DebugInfo/CodeView/ErrorChecking.h [deleted file]
unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp
unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp
unittests/DebugInfo/PDB/CMakeLists.txt
unittests/DebugInfo/PDB/ErrorChecking.h [deleted file]
unittests/DebugInfo/PDB/HashTableTest.cpp
unittests/DebugInfo/PDB/MSFBuilderTest.cpp
unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
unittests/DebugInfo/PDB/StringTableBuilderTest.cpp
unittests/DebugInfo/PDB/TypeServerHandlerTest.cpp
unittests/Support/BinaryStreamTest.cpp
unittests/Support/CMakeLists.txt