diff --git a/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected b/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected index 8d72392ed5..07d19e7cf3 100644 --- a/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected +++ b/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected @@ -2,3 +2,4 @@ | headers/test4.h:0:0:0:0 | headers/test4.h | Header file test4.h is missing expected include guard. | headers/test4.h:0:0:0:0 | headers/test4.h | | | headers/test5.h:0:0:0:0 | headers/test5.h | Header file test5.h is missing expected include guard. | headers/test5.h:0:0:0:0 | headers/test5.h | | | headers/test7.h:0:0:0:0 | headers/test7.h | Header file test7.h is never included by reusing the include guard used by $@. | headers/test6.h:0:0:0:0 | headers/test6.h | include guard | +| headers/test8.h:0:0:0:0 | headers/test8.h | Header file test8.h is missing expected include guard. | headers/test8.h:0:0:0:0 | headers/test8.h | | diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml new file mode 100644 index 0000000000..adf7df0ce6 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml @@ -0,0 +1,10 @@ + + + + + + cpp-test-dummy + This header is deliberately excluded to test the exclusion mechanism. + + + diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml new file mode 100644 index 0000000000..d4ea695e26 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml @@ -0,0 +1,3 @@ +deviations: + - rule-id: cpp-test-dummy + justification: This header is deliberately excluded to test the exclusion mechanism. diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h b/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h new file mode 100644 index 0000000000..9d07b4b188 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h @@ -0,0 +1,2 @@ +// COMPLIANT - excluded via deviation +int g7; diff --git a/c/common/test/rules/includeguardsnotused/headers/test8.h b/c/common/test/rules/includeguardsnotused/headers/test8.h new file mode 100644 index 0000000000..fc82ac2a01 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/test8.h @@ -0,0 +1,2 @@ +// NON_COMPLIANT +int g6; diff --git a/c/common/test/rules/includeguardsnotused/test.c b/c/common/test/rules/includeguardsnotused/test.c index 8c63904fc4..15b066be14 100644 --- a/c/common/test/rules/includeguardsnotused/test.c +++ b/c/common/test/rules/includeguardsnotused/test.c @@ -11,4 +11,8 @@ #include "headers/test6.h" //NON_COMPLIANT - non unique and reported in alert for the next -#include "headers/test7.h" //NON_COMPLIANT - non unique \ No newline at end of file +#include "headers/test7.h" //NON_COMPLIANT - non unique + +#include "headers/test8.h" //NON_COMPLIANT - missing include guard, not excluded + +#include "headers/excluded/test8.h" //COMPLIANT - missing include guard, but excluded via deviation \ No newline at end of file diff --git a/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected b/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected index f915e37ec1..dda204cd18 100644 --- a/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected +++ b/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected @@ -2,3 +2,4 @@ | headers/test4.hpp:0:0:0:0 | headers/test4.hpp | Header file test4.hpp is missing expected include guard. | headers/test4.hpp:0:0:0:0 | headers/test4.hpp | | | headers/test5.hpp:0:0:0:0 | headers/test5.hpp | Header file test5.hpp is missing expected include guard. | headers/test5.hpp:0:0:0:0 | headers/test5.hpp | | | headers/test6.hpp:0:0:0:0 | headers/test6.hpp | Header file test6.hpp is missing expected include guard. | headers/test6.hpp:0:0:0:0 | headers/test6.hpp | | +| headers/test7.hpp:0:0:0:0 | headers/test7.hpp | Header file test7.hpp is missing expected include guard. | headers/test7.hpp:0:0:0:0 | headers/test7.hpp | | diff --git a/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml new file mode 100644 index 0000000000..adf7df0ce6 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml @@ -0,0 +1,10 @@ + + + + + + cpp-test-dummy + This header is deliberately excluded to test the exclusion mechanism. + + + diff --git a/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml new file mode 100644 index 0000000000..d4ea695e26 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml @@ -0,0 +1,3 @@ +deviations: + - rule-id: cpp-test-dummy + justification: This header is deliberately excluded to test the exclusion mechanism. diff --git a/cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp b/cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp new file mode 100644 index 0000000000..9d07b4b188 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp @@ -0,0 +1,2 @@ +// COMPLIANT - excluded via deviation +int g7; diff --git a/cpp/common/test/rules/includeguardsnotused/headers/test7.hpp b/cpp/common/test/rules/includeguardsnotused/headers/test7.hpp new file mode 100644 index 0000000000..fc82ac2a01 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/test7.hpp @@ -0,0 +1,2 @@ +// NON_COMPLIANT +int g6; diff --git a/cpp/common/test/rules/includeguardsnotused/test.cpp b/cpp/common/test/rules/includeguardsnotused/test.cpp index 356710eb5f..82170197f2 100644 --- a/cpp/common/test/rules/includeguardsnotused/test.cpp +++ b/cpp/common/test/rules/includeguardsnotused/test.cpp @@ -9,4 +9,8 @@ #include "headers/test5.hpp" //COMPLIANT - non unique precedes malformed -#include "headers/test6.hpp" //COMPLIANT - non unique \ No newline at end of file +#include "headers/test6.hpp" //COMPLIANT - non unique + +#include "headers/test7.hpp" //NON_COMPLIANT - missing include guard, not excluded + +#include "headers/excluded/test7.hpp" // COMPLIANT - excluded via deviation \ No newline at end of file