[clangd] Improve output of semantic highlighting tests in case of failures
authorIlya Biryukov <ibiryukov@google.com>
Mon, 9 Sep 2019 08:47:05 +0000 (08:47 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Mon, 9 Sep 2019 08:47:05 +0000 (08:47 +0000)
commitad3841fcae6392cb315e2ab39e6d49887d5ef449
tree90750681aa24f75150af73804db186ccc3bd6c0f
parentc363deb575019c6cb28a6d1c92826e36ea8bb07c
[clangd] Improve output of semantic highlighting tests in case of failures

Summary:
Instead of matching lists of highlightings, we annotate input code with
resulting highlightings and diff it against the expected annotated input.

In case of failures, this produces much nicer output in form of text-based
diffs.

Reviewers: hokein

Reviewed By: hokein

Subscribers: nridge, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 371373
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/SemanticHighlighting.h
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp