diff --git a/HISTORY.rst b/HISTORY.rst index df3add2a..b0d053dc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,6 +22,13 @@ PlatformIO 3.0 install/uninstall operations (`issue #1594 `_) +3.5.5 (2018-??-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed `PIO Unit Testing `__ + 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) ~~~~~~~~~~~~~~~~~~ diff --git a/docs b/docs index 4c1af280..a77ecd12 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 4c1af2805ecc42961edcb8a3adda5fde2f4104d8 +Subproject commit a77ecd12952ff66b799357d505e9a09c24a4a5ec diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index bfbfd401..0bcfe630 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -54,21 +54,20 @@ def _build_project_deps(env): if project_lib_builder.env.get(key) }) - if "__test" in COMMAND_LINE_TARGETS: - env.ProcessTest() - 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")) + projenv = env.Clone() # CPPPATH from dependencies projenv.PrependUnique(CPPPATH=project_lib_builder.env.get("CPPPATH")) # extra build flags from `platformio.ini` 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: sys.stderr.write( "Error: Nothing to build. Please put your source code files " @@ -95,6 +94,8 @@ def BuildProgram(env): if "__debug" in COMMAND_LINE_TARGETS: env.ProcessDebug() + if "__test" in COMMAND_LINE_TARGETS: + env.ProcessTest() # process extra flags from board if "BOARD" in env and "build.extra_flags" in env.BoardConfig():