[clang-tools-extra] [clang-tidy] support expect no diagnosis test (PR #91293)

Danny Mösch via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 03:47:04 PDT 2024


================
@@ -226,6 +226,11 @@ def run_clang_tidy(self):
         print("------------------------------------------------------------------")
         return clang_tidy_output
 
+    def check_no_diagnosis(self, clang_tidy_output):
+        print(clang_tidy_output)
+        if clang_tidy_output != "":
+            sys.exit("expect no diagnosis")
----------------
SimplyDanny wrote:

```suggestion
        print(clang_tidy_output)
        if clang_tidy_output != "":
            sys.exit("No diagnostics were expected, but found the ones above")
```

https://github.com/llvm/llvm-project/pull/91293


More information about the cfe-commits mailing list