From 9affc023a2751228b16fb9baf6b939fec58a5e7a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 19 Jul 2023 15:46:10 +0300 Subject: [PATCH] Restore env.GetBuildType, community projects and dev-platforms depend on it --- Makefile | 2 +- platformio/builder/tools/piobuild.py | 5 +++++ tests/commands/test_check.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a0f78f40..09c0b838 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ format: black ./tests test: - py.test --verbose -n 6 --dist=loadscope tests --ignore tests/test_examples.py + py.test --verbose --exitfirst -n 6 --dist=loadscope tests --ignore tests/test_examples.py before-commit: isort format lint diff --git a/platformio/builder/tools/piobuild.py b/platformio/builder/tools/piobuild.py index 46ac5a1d..4f7473cb 100644 --- a/platformio/builder/tools/piobuild.py +++ b/platformio/builder/tools/piobuild.py @@ -44,6 +44,10 @@ def scons_patched_match_splitext(path, suffixes=None): return tokens +def GetBuildType(env): + return env["BUILD_TYPE"] + + def BuildProgram(env): env.ProcessProgramDeps() env.ProcessProjectDeps() @@ -363,6 +367,7 @@ def exists(_): def generate(env): + env.AddMethod(GetBuildType) env.AddMethod(BuildProgram) env.AddMethod(ProcessProgramDeps) env.AddMethod(ProcessProjectDeps) diff --git a/tests/commands/test_check.py b/tests/commands/test_check.py index 91679d03..5403ee0f 100644 --- a/tests/commands/test_check.py +++ b/tests/commands/test_check.py @@ -511,6 +511,7 @@ TEST-TEST-TEST-TEST assert verbose_result.exit_code != 0 assert "license information is incorrect" in verbose_result.output.lower() + @pytest.mark.parametrize("framework", ["arduino", "stm32cube", "zephyr"]) @pytest.mark.parametrize("check_tool", ["cppcheck", "clangtidy", "pvs-studio"]) def test_check_embedded_platform_all_tools( @@ -539,7 +540,6 @@ int main() { """ ) - tmpdir.join("platformio.ini").write(config) result = clirunner.invoke(cmd_check, ["--project-dir", str(tmpdir)]) validate_cliresult(result)