forked from platformio/platformio-core
Include Unity framework for IDE data only if there are tests in project
This commit is contained in:
@ -59,10 +59,15 @@ def _dump_includes(env):
|
||||
for g in toolchain_incglobs:
|
||||
includes["toolchain"].extend([os.path.realpath(inc) for inc in glob(g)])
|
||||
|
||||
# include Unity framework if there are tests in project
|
||||
includes["unity"] = []
|
||||
auto_install_unity = False
|
||||
test_dir = env.GetProjectConfig().get_optional_dir("test")
|
||||
if os.path.isdir(test_dir) and os.listdir(test_dir) != ["README"]:
|
||||
auto_install_unity = True
|
||||
unity_dir = get_core_package_dir(
|
||||
"tool-unity",
|
||||
auto_install=os.path.isdir(env.GetProjectConfig().get_optional_dir("test")),
|
||||
auto_install=auto_install_unity,
|
||||
)
|
||||
if unity_dir:
|
||||
includes["unity"].append(unity_dir)
|
||||
|
Reference in New Issue
Block a user