summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-04-05 14:32:10 +0000
committerPavel Labath <labath@google.com>2018-04-05 14:32:10 +0000
commit510725c2d69cb28773e9097656fdef52d7240a90 (patch)
tree8e33a56bc9e76f4d7ca3f1a707f59f7e6c1a4e58 /clang/lib/Frontend/CompilerInvocation.cpp
parentb30388bf11aa7f95c8a92585130962d5e434406c (diff)
downloadbcm5719-llvm-510725c2d69cb28773e9097656fdef52d7240a90.tar.gz
bcm5719-llvm-510725c2d69cb28773e9097656fdef52d7240a90.zip
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud