[clangd] Add new helpers to make tweak tests scale better. Convert most tests. NFC
authorSam McCall <sam.mccall@gmail.com>
Fri, 2 Aug 2019 09:12:39 +0000 (09:12 +0000)
committerSam McCall <sam.mccall@gmail.com>
Fri, 2 Aug 2019 09:12:39 +0000 (09:12 +0000)
commitac7864ec019c784b6039eda6a77c678f7b417591
treeb7029be8ace17c3a60e64274f318a348d069a0b4
parentb874b3d3faac98b7fe807ffec0050d452a6a44b6
[clangd] Add new helpers to make tweak tests scale better. Convert most tests. NFC

Summary:
TweakTests.cpp has some pretty good helpers added for the first few
tweaks, but they have some limitations:
 - many assertion failures point at the wrong line
 - need lots of input/output tests, setup code is duplicated across both
 - local helpers make it hard to split the file as it grows

The new helpers in TweakTests.h are based on old ones (same operations)
but try to address these issues and generally make tests more terse
while improving error messages.

This patch converts everything except ExtractVariable (which is complex
and has changes in flight, so will be converted later).
It's LOC-neutral, despite not being able to get rid of the old helpers
until ExtractVariable is done.

Reviewers: ilya-biryukov

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

Tags: #clang

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

llvm-svn: 367667
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/TweakTesting.cpp [new file with mode: 0644]
clang-tools-extra/clangd/unittests/TweakTesting.h [new file with mode: 0644]
clang-tools-extra/clangd/unittests/TweakTests.cpp