mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Auto install too-unity for hardware unit testing
This commit is contained in:
@ -154,10 +154,10 @@ class PlatformFactory(object):
|
||||
)
|
||||
else:
|
||||
platform_cls = type(
|
||||
str(cls.get_clsname(name)), (BasePlatform,), {})
|
||||
str(cls.get_clsname(name)), (PlatformBase,), {})
|
||||
|
||||
_instance = platform_cls(join(platform_dir, "platform.json"))
|
||||
assert isinstance(_instance, BasePlatform)
|
||||
assert isinstance(_instance, PlatformBase)
|
||||
return _instance
|
||||
|
||||
|
||||
@ -313,7 +313,7 @@ class PlatformRunMixin(object):
|
||||
return 1
|
||||
|
||||
|
||||
class BasePlatform(PlatformPackagesMixin, PlatformRunMixin):
|
||||
class PlatformBase(PlatformPackagesMixin, PlatformRunMixin):
|
||||
|
||||
_BOARDS_CACHE = {}
|
||||
|
||||
@ -460,6 +460,12 @@ class BasePlatform(PlatformPackagesMixin, PlatformRunMixin):
|
||||
# skip all packages, allow only upload tools
|
||||
self.packages[_name]['optional'] = True
|
||||
|
||||
if "test" in targets and "tool-unity" not in self.packages:
|
||||
self.packages['tool-unity'] = {
|
||||
"version": "~1.20302.0",
|
||||
"optional": False
|
||||
}
|
||||
|
||||
|
||||
class PlatformBoardConfig(object):
|
||||
|
||||
|
Reference in New Issue
Block a user