Skip to content

check_clang_tidy.py is not enforcing CHECK-MESSAGES in header files #133515

Open
@carlosgalvezp

Description

@carlosgalvezp

When trying to create a unit test for this issue, I realized that check_clang_tidy is currently not handling the CHECK-MESSAGES lines from header files.

This can be reproduced with the following change:

--- a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h
+++ b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h
@@ -6,7 +6,7 @@ extern int g;
 extern int h;
 #include "duplicate-include2.h"
 extern int i;
-// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: duplicate include
+// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: foo include

After that change, run ninja check-clang-tools again. Result: all the tests continue to pass. I expect this test to fail since now the message is different.

Is this expected? How can we fix this?

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions