diff --git a/HISTORY.rst b/HISTORY.rst index 75e667e2..b83a4034 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,6 +18,7 @@ PlatformIO Core 6 * Control |UNITTESTING| verbosity with a new multilevel `pio test -v `__ command option (`issue #4276 `_) * Follow symbolic links during searching for the unit test suites (`issue #4288 `_) +* Show a warning when testing an empty project without a test suite (`issue #4278 `_) * Fixed an issue when the `build_src_flags `__ option was applied outside the project scope (`issue #4277 `_) * Fixed an issue with debugging assembly files without preprocessor (".s") diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 6e51154d..9476f685 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -165,11 +165,17 @@ def ProcessProjectDeps(env): "$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") - ) + 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") + ) + elif "test" in env.GetBuildType(): + sys.stderr.write( + "Error: Nothing to build. Please put your test suites " + "to the '%s' folder\n" % env.subst("$PROJECT_TEST_DIR") + ) env.Exit(1) Export("projenv")