diff options
author | Zachary Turner <zturner@google.com> | 2017-06-14 16:41:50 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-06-14 16:41:50 +0000 |
commit | 83a953d909d55d1af24106f85b4f85ccbf445da7 (patch) | |
tree | d9b5f7867781ace2aeb3ecb5956483733bef3c3c /lib/CMakeLists.txt | |
parent | 63d2fab3cfd80f03b1530c0464a7d45249f8ce99 (diff) |
[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
Diffstat (limited to 'lib/CMakeLists.txt')
-rw-r--r-- | lib/CMakeLists.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f7c09be15fb..946067e6358 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -24,3 +24,4 @@ add_subdirectory(Fuzzer) add_subdirectory(Passes) add_subdirectory(ToolDrivers) add_subdirectory(XRay) +add_subdirectory(Testing) |