Include Unity framework for IDE data only if there are tests in project

This commit is contained in:
Ivan Kravets
2021-01-27 22:40:19 +02:00
parent 493a33e754
commit 61d70fa688

View File

@ -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)