diff --git a/HISTORY.rst b/HISTORY.rst index ffa4b489..d5f4f19a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,13 @@ Release Notes PlatformIO 3.0 -------------- +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 9d8e84d5..a77ecd12 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 9d8e84d527aa83f19ce402e0c55964a1655535eb +Subproject commit a77ecd12952ff66b799357d505e9a09c24a4a5ec diff --git a/examples b/examples index ebff9ae7..8e11abaa 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit ebff9ae73fa582c5edb7b47f628891b637b29d94 +Subproject commit 8e11abaafcfac758252f1df820d694a873e09e36 diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 1c72bf3d..ab4cd9ec 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():