Skip to content

Commit 9c8b0d4

Browse files
committed
Use FileCheck in new clang-tidy/infrastructure/config-files.cpp tests
The test was failing spuriously on some machines [1]. Converting from grep to FileCheck makes it easier to see what's happening, and also grep is discouraged in tests [2]. Also drop the negative test: checking for the expected output is better. 1. https://crbug.com/338535754 2. https://llvm.org/docs/TestingGuide.html#:~:text=.%20%5BThe-,usage%20of%20grep,-in%20RUN%20lines
1 parent 327bfc9 commit 9c8b0d4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,5 @@
6666
// RUN: clang-tidy --checks="-*,readability-identifier-naming" --dump-config %S/Inputs/config-files/- -- | grep "readability-identifier-naming\." | sort --check
6767

6868
// Dumped config does not overflow for unsigned options
69-
// RUN: clang-tidy --dump-config \
70-
// RUN: --checks="-*,misc-throw-by-value-catch-by-reference" \
71-
// RUN: -- | grep -v -q "misc-throw-by-value-catch-by-reference.MaxSize: '-1'"
72-
73-
// RUN: clang-tidy --dump-config %S/Inputs/config-files/5/- \
74-
// RUN: -- | grep -q "misc-throw-by-value-catch-by-reference.MaxSize: '1152921504606846976'"
69+
// RUN: clang-tidy --dump-config %S/Inputs/config-files/5/- -- | FileCheck %s -check-prefix=CHECK-OVERFLOW
70+
// CHECK-OVERFLOW: misc-throw-by-value-catch-by-reference.MaxSize: '1152921504606846976'

0 commit comments

Comments
 (0)