Restore env.GetBuildType, community projects and dev-platforms depend on it

This commit is contained in:
Ivan Kravets
2023-07-19 15:46:10 +03:00
parent fb2f850f1d
commit 9affc023a2
3 changed files with 7 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ format:
black ./tests black ./tests
test: 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 before-commit: isort format lint

View File

@@ -44,6 +44,10 @@ def scons_patched_match_splitext(path, suffixes=None):
return tokens return tokens
def GetBuildType(env):
return env["BUILD_TYPE"]
def BuildProgram(env): def BuildProgram(env):
env.ProcessProgramDeps() env.ProcessProgramDeps()
env.ProcessProjectDeps() env.ProcessProjectDeps()
@@ -363,6 +367,7 @@ def exists(_):
def generate(env): def generate(env):
env.AddMethod(GetBuildType)
env.AddMethod(BuildProgram) env.AddMethod(BuildProgram)
env.AddMethod(ProcessProgramDeps) env.AddMethod(ProcessProgramDeps)
env.AddMethod(ProcessProjectDeps) env.AddMethod(ProcessProjectDeps)

View File

@@ -511,6 +511,7 @@ 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"]) @pytest.mark.parametrize("framework", ["arduino", "stm32cube", "zephyr"])
@pytest.mark.parametrize("check_tool", ["cppcheck", "clangtidy", "pvs-studio"]) @pytest.mark.parametrize("check_tool", ["cppcheck", "clangtidy", "pvs-studio"])
def test_check_embedded_platform_all_tools( def test_check_embedded_platform_all_tools(
@@ -539,7 +540,6 @@ int main() {
""" """
) )
tmpdir.join("platformio.ini").write(config) tmpdir.join("platformio.ini").write(config)
result = clirunner.invoke(cmd_check, ["--project-dir", str(tmpdir)]) result = clirunner.invoke(cmd_check, ["--project-dir", str(tmpdir)])
validate_cliresult(result) validate_cliresult(result)