forked from platformio/platformio-core
Show a warning when testing an empty project without a test suite // Resolve #4278
This commit is contained in:
@ -19,6 +19,7 @@ PlatformIO Core 6
|
|||||||
* Control |UNITTESTING| verbosity with a new multilevel `pio test -v <https://docs.platformio.org/en/latest/core/userguide/cmd_test.html#cmdoption-pio-test-v>`__ command option (`issue #4276 <https://github.com/platformio/platformio-core/issues/4276>`_)
|
* Control |UNITTESTING| verbosity with a new multilevel `pio test -v <https://docs.platformio.org/en/latest/core/userguide/cmd_test.html#cmdoption-pio-test-v>`__ command option (`issue #4276 <https://github.com/platformio/platformio-core/issues/4276>`_)
|
||||||
* Follow symbolic links during searching for the unit test suites (`issue #4288 <https://github.com/platformio/platformio-core/issues/4288>`_)
|
* Follow symbolic links during searching for the unit test suites (`issue #4288 <https://github.com/platformio/platformio-core/issues/4288>`_)
|
||||||
* Show a warning when testing an empty project without a test suite (`issue #4278 <https://github.com/platformio/platformio-core/issues/4278>`_)
|
* Show a warning when testing an empty project without a test suite (`issue #4278 <https://github.com/platformio/platformio-core/issues/4278>`_)
|
||||||
|
* Improved support for `Asking for input (prompts) <https://docs.platformio.org/en/latest/scripting/examples/asking_for_input.html>`_
|
||||||
* Fixed an issue when the `build_src_flags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-src-flags>`__ option was applied outside the project scope (`issue #4277 <https://github.com/platformio/platformio-core/issues/4277>`_)
|
* Fixed an issue when the `build_src_flags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-src-flags>`__ option was applied outside the project scope (`issue #4277 <https://github.com/platformio/platformio-core/issues/4277>`_)
|
||||||
* Fixed an issue with debugging assembly files without preprocessor (".s")
|
* Fixed an issue with debugging assembly files without preprocessor (".s")
|
||||||
|
|
||||||
|
@ -157,28 +157,29 @@ def ProcessProjectDeps(env):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if "test" in env.GetBuildType():
|
if "test" in env.GetBuildType():
|
||||||
|
build_files_before_nums = len(env.get("PIOBUILDFILES", []))
|
||||||
projenv.BuildSources(
|
projenv.BuildSources(
|
||||||
"$BUILD_TEST_DIR", "$PROJECT_TEST_DIR", "$PIOTEST_SRC_FILTER"
|
"$BUILD_TEST_DIR", "$PROJECT_TEST_DIR", "$PIOTEST_SRC_FILTER"
|
||||||
)
|
)
|
||||||
if "test" not in env.GetBuildType() or env.GetProjectOption("test_build_src"):
|
if len(env.get("PIOBUILDFILES", [])) - build_files_before_nums < 1:
|
||||||
projenv.BuildSources(
|
|
||||||
"$BUILD_SRC_DIR", "$PROJECT_SRC_DIR", env.get("SRC_FILTER")
|
|
||||||
)
|
|
||||||
|
|
||||||
if not env.get("PIOBUILDFILES"):
|
|
||||||
if not COMMAND_LINE_TARGETS:
|
|
||||||
sys.stderr.write(
|
|
||||||
"Error: Nothing to build. Please put your source code files "
|
|
||||||
"to the '%s' folder\n" % env.subst("$PROJECT_SRC_DIR")
|
|
||||||
)
|
|
||||||
env.Exit(1)
|
|
||||||
if "test" in env.GetBuildType():
|
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Error: Nothing to build. Please put your test suites "
|
"Error: Nothing to build. Please put your test suites "
|
||||||
"to the '%s' folder\n" % env.subst("$PROJECT_TEST_DIR")
|
"to the '%s' folder\n" % env.subst("$PROJECT_TEST_DIR")
|
||||||
)
|
)
|
||||||
env.Exit(1)
|
env.Exit(1)
|
||||||
|
|
||||||
|
if "test" not in env.GetBuildType() or env.GetProjectOption("test_build_src"):
|
||||||
|
projenv.BuildSources(
|
||||||
|
"$BUILD_SRC_DIR", "$PROJECT_SRC_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 "
|
||||||
|
"to the '%s' folder\n" % env.subst("$PROJECT_SRC_DIR")
|
||||||
|
)
|
||||||
|
env.Exit(1)
|
||||||
|
|
||||||
Export("projenv")
|
Export("projenv")
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user