[clang-tools-extra] [clang-tidy] Generate valid JSON for characters that require escaping (PR #187454)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 19 04:25:03 PDT 2026
================
@@ -1,9 +1,11 @@
// RUN: rm -rf %t.dir/out
// RUN: clang-tidy -enable-check-profile -checks='-*,readability-function-size' -store-check-profile=%t.dir/out %s -- 2>&1 | not FileCheck --match-full-lines -implicit-check-not='{{warning:|error:}}' -check-prefix=CHECK-CONSOLE %s
// RUN: cat %t.dir/out/*-clang-tidy-store-check-profile-one-tu.cpp.json | FileCheck --match-full-lines -implicit-check-not='{{warning:|error:}}' -check-prefix=CHECK-FILE %s
+// RUN: cat %t.dir/out/*-clang-tidy-store-check-profile-one-tu.cpp.json | %python -c "import sys, json; json.load(sys.stdin)"
----------------
zeyi2 wrote:
IMO this is the easiest way to test whether a JSON string is valid, also there is an existing example in Clang testcases: https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/ftime-trace.cpp, so maybe it is acceptable?
https://github.com/llvm/llvm-project/pull/187454
More information about the cfe-commits
mailing list