[clangd] Add integration test for crash handling
authorSam McCall <sam.mccall@gmail.com>
Tue, 26 Oct 2021 13:27:07 +0000 (15:27 +0200)
committerSam McCall <sam.mccall@gmail.com>
Wed, 27 Oct 2021 09:52:31 +0000 (11:52 +0200)
commit9cc08cb02fdc4f8a2b717519c3bf33b4ed3070e4
treeef20fa8d8b6c1e88b7606016d38921d146aca2d3
parentc4723785c1902d6a53f3808fa1dabb2a97c1cc6e
[clangd] Add integration test for crash handling

This replaces the test removed in 51be7061d025139ba66869d5d99c7157a3ae9edd
It is more principled and tests more critical cases: a crash while parsing.

We need two pieces of plumbing:
 - a way to re-enable the crashing #pragmas via a flag, to test parse crashes
 - a bit of reshuffling around ASTWorker execution so that we set up the
   crash handler in both sync/async modes.
   Sync mode is useful for debugging, so I tested both.

Differential Revision: https://reviews.llvm.org/D112565
clang-tools-extra/clangd/Compiler.cpp
clang-tools-extra/clangd/Compiler.h
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/clangd/test/crash-parse.test [new file with mode: 0644]
clang-tools-extra/clangd/test/crash-preamble.test [new file with mode: 0644]
clang-tools-extra/clangd/tool/ClangdMain.cpp