1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/unittests
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
..
ADT [APInt] byteSwap - handle any whole byte bitwidth greater than 16-bits 2020-02-15 13:27:06 +00:00
Analysis [LazyCallGraph] Fix ambiguous index value 2020-02-18 23:32:55 -05:00
AsmParser
BinaryFormat
Bitcode
Bitstream
CodeGen [GISel][KnownBits] Give up on PHI analysis as soon as we don't know anything 2020-02-20 11:34:01 -08:00
DebugInfo Add an Offset field to the SourceLocation for LookupResult objects. 2020-02-19 16:12:32 -08:00
Demangle
ExecutionEngine [ORC] Add generic initializer/deinitializer support. 2020-02-19 13:59:32 -08:00
Frontend [OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder. 2020-02-15 01:15:45 -06:00
FuzzMutate
IR [Dominators] Use Instruction::comesBefore for block-local queries, NFC 2020-02-20 16:41:51 -08:00
LineEditor
Linker
MC [X86][Disassembler] Fix a bug when disassembling an empty string 2020-01-13 10:42:21 -08:00
MI [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
Object [unittests] Fix "comparison of integers of different signs" warnings 2020-01-14 13:24:51 +01:00
ObjectYAML minidump: Add an "arm64" constant 2019-10-31 11:20:46 +01:00
Option
Passes [test] Disable the Passes/PluginsTest cases on windows with BUILD_SHARED_LIBS 2020-02-10 22:50:36 +02:00
ProfileData Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Remarks [Remarks] Fix error message check in unit test 2019-10-31 15:51:36 -07:00
Support [Error/unittests] Add a FailedWithMessage gtest matcher 2020-02-21 15:29:48 +01:00
TableGen Make unittests include path relative 2020-02-21 10:19:11 +01:00
Target Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TextAPI [llvm][TextAPI/MachO] Extract common code into unittest helper (NFC) 2020-02-13 12:53:24 -08:00
tools Recommit: "[llvm-exegesis] Improve error reporting in Assembler.cpp" 2020-02-19 14:40:28 +01:00
Transforms Add Query API for llvm.assume holding attributes 2020-02-18 19:42:07 +01:00
XRay Use std::foo_t rather than std::foo in LLVM. 2020-02-11 15:12:51 -08:00
CMakeLists.txt CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
unittest.cfg.in