1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/unittests/Support
Pavel Labath fa2992679a [Testing/Support]: Better matching of Error failure states
Summary:
The existing Failed() matcher only allowed asserting that the operation
failed, but it was not possible to verify any details of the returned
error.

This patch adds two new matchers, which make this possible:
- Failed<InfoT>() verifies that the operation failed with a single error
  of a given type.
- Failed<InfoT>(M) additionally check that the contained error info
  object is matched by the nested matcher M.

To make these work, I've changed the implementation of the ErrorHolder
class. Now, instead of just storing the string representation of the
Error, it fetches the ErrorInfo objects and stores then as a list of
shared pointers. This way, ErrorHolder remains copyable, while still
retaining the full information contained in the Error object.

In case the Error object contains two or more errors, the new matchers
will fail to match, instead of trying to match all (or any) of the
individual ErrorInfo objects. This seemed to be the most sensible
behavior for when one wants to match exact error details, but I could be
convinced otherwise...

Reviewers: zturner, lhames

Subscribers: llvm-commits

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

llvm-svn: 329288
2018-04-05 14:32:10 +00:00
..
DynamicLibrary [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
AlignOfTest.cpp
AllocatorTest.cpp Report fatal error in the case of out of memory 2018-02-20 05:41:26 +00:00
ARMAttributeParser.cpp Remove redundant includes from unittests. 2017-12-13 21:31:05 +00:00
ArrayRecyclerTest.cpp
BinaryStreamTest.cpp Remove redundant includes from unittests. 2017-12-13 21:31:05 +00:00
BlockFrequencyTest.cpp
BranchProbabilityTest.cpp
CachePruningTest.cpp Unbreak the build. Combining chrono with Optional is annoying. 2017-12-22 21:18:50 +00:00
Casting.cpp
CheckedArithmeticTest.cpp Utility functions for checked arithmetic 2018-03-02 00:30:43 +00:00
Chrono.cpp Support formatv of TimePoint with strftime-style formats. 2017-10-24 08:30:19 +00:00
CMakeLists.txt Utility functions for checked arithmetic 2018-03-02 00:30:43 +00:00
CommandLineTest.cpp On Windows we need to be able to process response files with Windows-style 2018-03-05 19:34:33 +00:00
CompressionTest.cpp
ConvertUTFTest.cpp Remove redundant includes from unittests. 2017-12-13 21:31:05 +00:00
CrashRecoveryTest.cpp
DataExtractorTest.cpp
DebugTest.cpp
DJBTest.cpp Resubmit r325107 (case folding DJB hash) 2018-02-21 22:36:31 +00:00
EndianStreamTest.cpp
EndianTest.cpp
ErrnoTest.cpp
ErrorOrTest.cpp Fix incorrect usage of std::is_assignable. 2018-02-02 22:29:54 +00:00
ErrorTest.cpp [Testing/Support]: Better matching of Error failure states 2018-04-05 14:32:10 +00:00
FileOutputBufferTest.cpp Convert FileOutputBuffer::commit to Error. 2017-11-08 01:50:29 +00:00
formatted_raw_ostream_test.cpp
FormatVariadicTest.cpp Fix FormatVariadicTest with GCC 2017-10-23 18:41:22 +00:00
GlobPatternTest.cpp [Support/GlobPattern] - Do not crash when pattern has characters with int value < 0. 2017-07-31 09:26:50 +00:00
Host.cpp [AArch64] Add Exynos to host detection 2017-12-08 21:09:59 +00:00
LEB128Test.cpp Change encodeU/SLEB128 to pad to certain number of bytes 2017-09-15 20:34:47 +00:00
LineIteratorTest.cpp
LockFileManagerTest.cpp
ManagedStatic.cpp Report fatal error in the case of out of memory 2018-02-20 05:41:26 +00:00
MathExtrasTest.cpp MathExtras UnitTest: Assert that isPowerOf2(0) is false. NFC. 2017-07-03 18:42:47 +00:00
MD5Test.cpp
MemoryBufferTest.cpp [Support] Pacify -Wsign-compare in unit test. 2018-03-08 21:54:30 +00:00
MemoryTest.cpp Untabify. 2017-10-18 13:31:28 +00:00
NativeFormatTests.cpp
ParallelTest.cpp
Path.cpp [Support] Use realpath(3) instead of trying to open a file. 2018-01-09 17:27:45 +00:00
ProcessTest.cpp [Support] env vars with empty values on windows 2017-08-18 16:55:44 +00:00
ProgramTest.cpp Convenience/safety fix for llvm::sys::Execute(And|No)Wait 2017-09-13 17:03:37 +00:00
raw_ostream_test.cpp Support: Add llvm::center_justify. 2017-07-13 16:11:08 +00:00
raw_pwrite_stream_test.cpp
raw_sha1_ostream_test.cpp
RegexTest.cpp Fix llvm-special-case-list-fuzzer regexp exception 2017-10-27 19:15:13 +00:00
ReplaceFileTest.cpp Support: Rewrite Windows implementation of sys::fs::rename to be more POSIXy. 2017-10-06 17:14:36 +00:00
ReverseIterationTest.cpp [unittest/ReverseIteration] Unbreak when compiling with GCC. 2017-09-05 21:27:23 +00:00
ScaledNumberTest.cpp
SourceMgrTest.cpp Add DK_Remark to SMDiagnostic 2017-10-12 23:56:02 +00:00
SpecialCaseListTest.cpp Extend SpecialCaseList to allow users to blame matches on entries in the file. 2017-11-07 21:16:46 +00:00
StringPool.cpp
SwapByteOrderTest.cpp
TargetParserTest.cpp Fix signed/unsigned compare warning I introduced 2018-02-08 17:11:32 +00:00
TarWriterTest.cpp Fix build bot after r319750 "[Support/TarWriter] - Don't allow TarWriter to add the same file more than once." 2017-12-05 10:35:11 +00:00
Threading.cpp
ThreadLocalTest.cpp
ThreadPool.cpp
TimerTest.cpp
TrailingObjectsTest.cpp
TrigramIndexTest.cpp
TypeNameTest.cpp
UnicodeTest.cpp
xxhashTest.cpp
YAMLIOTest.cpp [YAML] Remove unit test of multibyte non-printable escaping that uses C++11 escapes 2018-03-27 20:46:26 +00:00
YAMLParserTest.cpp [YAMLParser] Don't crash on null keys in KeyValueNodes. 2017-11-23 20:57:20 +00:00