github / codeql-coding-standards

This repository contains CodeQL queries and libraries which support various Coding Standards.
MIT License
121 stars 55 forks source link

Michaelrfairhurst/fix autosar a1 1 2 detect -w flag test workaround #696

Closed MichaelRFairhurst closed 1 week ago

MichaelRFairhurst commented 2 weeks ago

Description

This draft PR is a copy of #688, demonstrating a possible workaround to pass unit tests and matrix tests with the correct behavior around the -w flag.

MichaelRFairhurst commented 2 weeks ago

Confirmed that this passes gcc and clang matrix testing.

Both of the following commands:

pwsh scripts/matrix_testing/CreateMatrixTestReport.ps1 -Configuration gcc -Rule -RuleName "A1-1-2"
# and
pwsh scripts/matrix_testing/CreateMatrixTestReport.ps1 -Configuration clang -Rule -RuleName "A1-1-2"

produce the following csv:

"PACKAGE","TEST_PASS","COMPILE_ERROR_OUTPUT","COMPILE_PASS","RULE","QUERY","SUITE","TEST_DIFFERENCE"
"Toolchain","True","","True","A1-1-2","CompilerWarningLevelNotInCompliance","AUTOSAR",""
"Toolchain","True","","True","A1-1-2","CompilerWarningLevelNotInCompliance","AUTOSAR",""
"Toolchain","True","","True","A1-1-2","CompilerWarningLevelNotInCompliance","AUTOSAR",""
"Toolchain","True","","True","A1-1-2","CompilerWarningLevelNotInCompliance","AUTOSAR",""

(note that the four rows correspond to the directories A1-1-2, A1-1-2.1, A1-1-2.2, and A1-1-2.3).

MichaelRFairhurst commented 2 weeks ago

@lcartey What do you think? This seems like technical debt, albeit a working solution.