[all-commits] [llvm/llvm-project] a316a9: [clangd] Rewrite TweakTesting helpers to avoid rep...

Sam McCall via All-commits all-commits at lists.llvm.org
Mon May 9 05:53:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a316a9815a4f4105bb96420e85e93fe5f0033ed0
      https://github.com/llvm/llvm-project/commit/a316a9815a4f4105bb96420e85e93fe5f0033ed0
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-05-09 (Mon, 09 May 2022)

  Changed paths:
    M clang-tools-extra/clangd/unittests/tweaks/AddUsingTests.cpp
    M clang-tools-extra/clangd/unittests/tweaks/TweakTesting.cpp
    M clang-tools-extra/clangd/unittests/tweaks/TweakTesting.h

  Log Message:
  -----------
  [clangd] Rewrite TweakTesting helpers to avoid reparsing the same code. NFC

Previously the EXPECT_AVAILABLE macros would rebuild the code at each marked
point, by expanding the cases textually.
There were often lots, and it's nice to have lots!

This reduces total unittest time by ~10% on my machine.
I did have to sacrifice a little apply() coverage in AddUsingTests (was calling
expandCases directly, which was otherwise unused), but we have
EXPECT_AVAILABLE tests covering that, I don't think there's real risk here.

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




More information about the All-commits mailing list