mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Fix PIO Unit Testing issue when `UNIT_TEST
` macro was not set in a build environment
This commit is contained in:
@@ -4,6 +4,13 @@ Release Notes
|
|||||||
PlatformIO 3.0
|
PlatformIO 3.0
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
3.5.5 (2018-??-??)
|
||||||
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Fixed `PIO Unit Testing <http://docs.platformio.org/page/plus/unit-testing.html>`__
|
||||||
|
issue with a shared code between main and test programs when ``UNIT_TEST``
|
||||||
|
macro was not set in a build environment
|
||||||
|
|
||||||
3.5.4 (2018-07-03)
|
3.5.4 (2018-07-03)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
2
docs
2
docs
Submodule docs updated: 9d8e84d527...a77ecd1295
2
examples
2
examples
Submodule examples updated: ebff9ae73f...8e11abaafc
@@ -54,21 +54,20 @@ def _build_project_deps(env):
|
|||||||
if project_lib_builder.env.get(key)
|
if project_lib_builder.env.get(key)
|
||||||
})
|
})
|
||||||
|
|
||||||
if "__test" in COMMAND_LINE_TARGETS:
|
|
||||||
env.ProcessTest()
|
|
||||||
projenv = env.Clone()
|
projenv = env.Clone()
|
||||||
projenv.BuildSources("$BUILDTEST_DIR", "$PROJECTTEST_DIR",
|
|
||||||
"$PIOTEST_SRC_FILTER")
|
|
||||||
else:
|
|
||||||
projenv = env.Clone()
|
|
||||||
projenv.BuildSources("$BUILDSRC_DIR", "$PROJECTSRC_DIR",
|
|
||||||
env.get("SRC_FILTER"))
|
|
||||||
|
|
||||||
# CPPPATH from dependencies
|
# CPPPATH from dependencies
|
||||||
projenv.PrependUnique(CPPPATH=project_lib_builder.env.get("CPPPATH"))
|
projenv.PrependUnique(CPPPATH=project_lib_builder.env.get("CPPPATH"))
|
||||||
# extra build flags from `platformio.ini`
|
# extra build flags from `platformio.ini`
|
||||||
projenv.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
|
projenv.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
|
||||||
|
|
||||||
|
if "__test" in COMMAND_LINE_TARGETS:
|
||||||
|
projenv.BuildSources("$BUILDTEST_DIR", "$PROJECTTEST_DIR",
|
||||||
|
"$PIOTEST_SRC_FILTER")
|
||||||
|
else:
|
||||||
|
projenv.BuildSources("$BUILDSRC_DIR", "$PROJECTSRC_DIR",
|
||||||
|
env.get("SRC_FILTER"))
|
||||||
|
|
||||||
if not env.get("PIOBUILDFILES") and not COMMAND_LINE_TARGETS:
|
if not env.get("PIOBUILDFILES") and not COMMAND_LINE_TARGETS:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Error: Nothing to build. Please put your source code files "
|
"Error: Nothing to build. Please put your source code files "
|
||||||
@@ -95,6 +94,8 @@ def BuildProgram(env):
|
|||||||
|
|
||||||
if "__debug" in COMMAND_LINE_TARGETS:
|
if "__debug" in COMMAND_LINE_TARGETS:
|
||||||
env.ProcessDebug()
|
env.ProcessDebug()
|
||||||
|
if "__test" in COMMAND_LINE_TARGETS:
|
||||||
|
env.ProcessTest()
|
||||||
|
|
||||||
# process extra flags from board
|
# process extra flags from board
|
||||||
if "BOARD" in env and "build.extra_flags" in env.BoardConfig():
|
if "BOARD" in env and "build.extra_flags" in env.BoardConfig():
|
||||||
|
Reference in New Issue
Block a user