1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/unittests/Support
Pavel Labath ed1f03baaf [Error/unittests] Add a FailedWithMessage gtest matcher
Summary:
We already have a "Failed" matcher, which can be used to check any
property of the Error object. However, most frequently one just wants to
check the error message, and while this is possible with the "Failed"
matcher, it is also very convoluted
(Failed<ErrorInfoBase>(testing::Property(&ErrorInfoBase::message, "the
message"))).

Now, one can just write: FailedWithMessage("the message"). I expect that
most of the usages will remain this simple, but the argument of the
matcher is not limited to simple strings -- the argument of the matcher
can be any other matcher, so one can write more complicated assertions
if needed (FailedWithMessage(ContainsRegex("foo|bar"))). If one wants to
match multiple error messages, he can pass multiple arguments to the
matcher.

If one wants to match the message list as a whole (perhaps to check the
message count), I've also included a FailedWithMessageArray matcher,
which takes a single matcher receiving a vector of error message
strings.

Reviewers: sammccall, dblaikie, jhenderson

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74898
2020-02-21 15:29:48 +01:00
..
DynamicLibrary Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
AlignmentTest.cpp [Alignment][NFC] Deprecate Align::None() 2020-01-24 12:53:58 +01:00
AlignOfTest.cpp
AllocatorTest.cpp Reland "[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases slab sizes"" 2020-02-03 12:06:15 +01:00
AnnotationsTest.cpp
ARMAttributeParser.cpp
ArrayRecyclerTest.cpp
BinaryStreamTest.cpp [Support] Split MallocAllocator out of Allocator.h 2020-01-24 17:29:32 -08:00
BlockFrequencyTest.cpp
BranchProbabilityTest.cpp
CachePruningTest.cpp
Casting.cpp
CheckedArithmeticTest.cpp
Chrono.cpp
CMakeLists.txt Revert "Disable exit-on-SIGPIPE in lldb" 2019-10-24 13:19:49 -07:00
CommandLineTest.cpp [CommandLine] Add missing Callbacks 2019-12-09 11:37:34 +00:00
CompressionTest.cpp build: reduce CMake handling for zlib 2020-01-02 11:19:12 -08:00
ConvertUTFTest.cpp
CrashRecoveryTest.cpp [Support] Optionally call signal handlers when a function wrapped by the the CrashRecoveryContext fails 2020-01-11 15:27:07 -05:00
CRCTest.cpp Make llvm::crc32() work also for input sizes larger than 32 bits. 2020-02-05 21:32:11 +01:00
DataExtractorTest.cpp [DebugInfo][Support] Replace DWARFDataExtractor size function 2020-01-13 10:53:00 +00:00
DebugCounterTest.cpp
DebugTest.cpp
DJBTest.cpp
EndianStreamTest.cpp
EndianTest.cpp
ErrnoTest.cpp
ErrorOrTest.cpp
ErrorTest.cpp [Error/unittests] Add a FailedWithMessage gtest matcher 2020-02-21 15:29:48 +01:00
FileCheckTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
FileCollectorTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
FileOutputBufferTest.cpp [LLD][ELF] Support --[no-]mmap-output-file with F_no_mmap 2019-10-29 15:49:08 -07:00
FileUtilitiesTest.cpp [llvm] Replace SmallStr.str().str() with std::string conversion operator. 2020-01-29 21:16:46 -08:00
formatted_raw_ostream_test.cpp
FormatVariadicTest.cpp Use C++14-style return type deduction in LLVM. 2020-02-11 07:38:42 -08:00
GlobPatternTest.cpp Reapply r375051: [support] GlobPattern: add support for \ and [!...], and allow ] in more places 2019-10-17 18:09:05 +00:00
Host.cpp Fix 01b02a73de78 to use correct macro spelling and fix unit tests. 2020-02-14 15:58:36 -08:00
ItaniumManglingCanonicalizerTest.cpp llvm-cxxmap: fix support for remapping non-mangled names. 2019-12-18 10:47:02 -08:00
JSONTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
KnownBitsTest.cpp [NFC][KnownBits] Add getMinValue() / getMaxValue() methods 2019-12-03 20:04:51 +03:00
LEB128Test.cpp
LineIteratorTest.cpp
LockFileManagerTest.cpp
ManagedStatic.cpp
MatchersTest.cpp
MathExtrasTest.cpp [Alignment][NFC] Support compile time constants 2019-10-14 09:04:15 +00:00
MD5Test.cpp
MemoryBufferTest.cpp
MemoryTest.cpp
NativeFormatTests.cpp
ParallelTest.cpp
Path.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ProcessTest.cpp [Support][NFC] Add an explicit unit test for Process::getPageSize() 2020-01-09 18:14:05 +00:00
ProgramTest.cpp
raw_ostream_test.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
raw_pwrite_stream_test.cpp
raw_sha1_ostream_test.cpp [Support] Optimize SHA1 implementation 2019-11-11 22:14:28 -08:00
RegexTest.cpp
ReplaceFileTest.cpp
ReverseIterationTest.cpp [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-07 00:51:41 +01:00
ScaledNumberTest.cpp
SourceMgrTest.cpp
SpecialCaseListTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
StringPool.cpp
SwapByteOrderTest.cpp
SymbolRemappingReaderTest.cpp
TargetParserTest.cpp [AArch64] Add Cortex-A34 Support for clang and llvm 2020-02-18 14:56:16 +00:00
TarWriterTest.cpp
TaskQueueTest.cpp [Support] On Windows, ensure hardware_concurrency() extends to all CPU sockets and all NUMA groups 2020-02-14 10:24:22 -05:00
Threading.cpp [Support] On Windows, ensure hardware_concurrency() extends to all CPU sockets and all NUMA groups 2020-02-14 10:24:22 -05:00
ThreadLocalTest.cpp
ThreadPool.cpp [Support] In tests, fix warning: variable ‘Threads’ set but not used 2020-02-15 09:05:01 -05:00
TimerTest.cpp
TrailingObjectsTest.cpp [Alignment][NFC] Move and type functions from MathExtras to Alignment 2019-10-14 13:14:34 +00:00
TrigramIndexTest.cpp
TypeNameTest.cpp
TypeTraitsTest.cpp
UnicodeTest.cpp
VersionTupleTest.cpp
VirtualFileSystemTest.cpp [VFS] More consistent support for Windows 2020-02-05 11:38:20 -08:00
xxhashTest.cpp
YAMLIOTest.cpp YAML parser robustness improvements 2019-11-05 21:51:04 -08:00
YAMLParserTest.cpp Fix null dereference in yaml::Document::skip 2019-11-11 20:48:28 -08:00