Merge branch 'develop' into feature/v7

This commit is contained in:
Ivan Kravets
2023-07-19 15:13:07 +03:00
3 changed files with 21 additions and 23 deletions

View File

@ -21,6 +21,7 @@ PlatformIO Core 6
* Resolved an issue that caused generated projects for `PlatformIO IDE for VSCode <https://docs.platformio.org/en/latest/integration/ide/vscode.html>`__ to break when the ``-iprefix`` compiler flag was used * Resolved an issue that caused generated projects for `PlatformIO IDE for VSCode <https://docs.platformio.org/en/latest/integration/ide/vscode.html>`__ to break when the ``-iprefix`` compiler flag was used
* Resolved an issue encountered while utilizing the `pio pkg exec <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_exec.html>`__ command on the Windows platform to execute Python scripts from a package * Resolved an issue encountered while utilizing the `pio pkg exec <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_exec.html>`__ command on the Windows platform to execute Python scripts from a package
* Implemented a crucial improvement to the `pio run <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html>`__ command, guaranteeing that the ``monitor`` target is not executed if any of the preceding targets, such as ``upload``, encounter failures * Implemented a crucial improvement to the `pio run <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html>`__ command, guaranteeing that the ``monitor`` target is not executed if any of the preceding targets, such as ``upload``, encounter failures
* `Cppcheck <https://docs.platformio.org/en/latest/plus/check-tools/cppcheck.html>`__ v2.11 with new checks, CLI commands and various analysis improvements
6.1.9 (2023-07-06) 6.1.9 (2023-07-06)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

View File

@ -46,7 +46,7 @@ __core_packages__ = {
"contrib-piohome": "~3.4.2", "contrib-piohome": "~3.4.2",
"contrib-pioremote": "~1.0.0", "contrib-pioremote": "~1.0.0",
"tool-scons": "~4.40502.0", "tool-scons": "~4.40502.0",
"tool-cppcheck": "~1.270.0", "tool-cppcheck": "~1.21100.0",
"tool-clangtidy": "~1.150005.0", "tool-clangtidy": "~1.150005.0",
"tool-pvs-studio": "~7.18.0", "tool-pvs-studio": "~7.18.0",
} }

View File

@ -69,7 +69,7 @@ PVS_STUDIO_FREE_LICENSE_HEADER = """
EXPECTED_ERRORS = 5 EXPECTED_ERRORS = 5
EXPECTED_WARNINGS = 1 EXPECTED_WARNINGS = 1
EXPECTED_STYLE = 2 EXPECTED_STYLE = 4
EXPECTED_DEFECTS = EXPECTED_ERRORS + EXPECTED_WARNINGS + EXPECTED_STYLE EXPECTED_DEFECTS = EXPECTED_ERRORS + EXPECTED_WARNINGS + EXPECTED_STYLE
@ -345,7 +345,10 @@ def test_check_individual_flags_passed(clirunner, validate_cliresult, tmpdir):
assert pvs_flags_found assert pvs_flags_found
def test_check_cppcheck_misra_addon(clirunner, validate_cliresult, check_dir): def test_check_cppcheck_misra_addon(clirunner, validate_cliresult, tmpdir_factory):
check_dir = tmpdir_factory.mktemp("project")
check_dir.join("platformio.ini").write(DEFAULT_CONFIG)
check_dir.mkdir("src").join("main.c").write(TEST_CODE)
check_dir.join("misra.json").write( check_dir.join("misra.json").write(
""" """
{ {
@ -508,16 +511,18 @@ TEST-TEST-TEST-TEST
assert verbose_result.exit_code != 0 assert verbose_result.exit_code != 0
assert "license information is incorrect" in verbose_result.output.lower() assert "license information is incorrect" in verbose_result.output.lower()
@pytest.mark.parametrize("framework", ["arduino", "stm32cube", "zephyr"])
def test_check_embedded_platform_all_tools(clirunner, validate_cliresult, tmpdir): @pytest.mark.parametrize("check_tool", ["cppcheck", "clangtidy", "pvs-studio"])
config = """ def test_check_embedded_platform_all_tools(
clirunner, validate_cliresult, tmpdir, framework, check_tool
):
config = f"""
[env:test] [env:test]
platform = ststm32 platform = ststm32
board = nucleo_f401re board = nucleo_f401re
framework = %s framework = {framework}
check_tool = %s check_tool = {check_tool}
""" """
# tmpdir.join("platformio.ini").write(config)
tmpdir.mkdir("src").join("main.c").write( tmpdir.mkdir("src").join("main.c").write(
PVS_STUDIO_FREE_LICENSE_HEADER PVS_STUDIO_FREE_LICENSE_HEADER
+ """ + """
@ -534,20 +539,12 @@ int main() {
""" """
) )
for framework in (
"arduino", tmpdir.join("platformio.ini").write(config)
"stm32cube", result = clirunner.invoke(cmd_check, ["--project-dir", str(tmpdir)])
"zephyr", validate_cliresult(result)
): defects = sum(count_defects(result.output))
for tool in ("cppcheck", "clangtidy", "pvs-studio"): assert defects > 0, "Not defects were found!"
tmpdir.join("platformio.ini").write(config % (framework, tool))
result = clirunner.invoke(cmd_check, ["--project-dir", str(tmpdir)])
validate_cliresult(result)
defects = sum(count_defects(result.output))
assert defects > 0, "Failed %s with %s" % (
framework,
tool,
)
def test_check_skip_includes_from_packages(clirunner, validate_cliresult, tmpdir): def test_check_skip_includes_from_packages(clirunner, validate_cliresult, tmpdir):