forked from platformio/platformio-core
Automatically upgrade outdated Unity library
This commit is contained in:
@@ -19,6 +19,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from platformio.package.manager.library import LibraryPackageManager
|
||||||
from platformio.test.exception import UnitTestSuiteError
|
from platformio.test.exception import UnitTestSuiteError
|
||||||
from platformio.test.result import TestCase, TestCaseSource, TestStatus
|
from platformio.test.result import TestCase, TestCaseSource, TestStatus
|
||||||
from platformio.test.runners.base import TestRunnerBase
|
from platformio.test.runners.base import TestRunnerBase
|
||||||
@@ -184,6 +185,24 @@ void unityOutputComplete(void) { unittest_uart_end(); }
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
"""Delete when Unity > 2.5.2 is released"""
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self._tmp_pre_upgrade()
|
||||||
|
|
||||||
|
def _tmp_pre_upgrade(self):
|
||||||
|
"""Delete when Unity > 2.5.2 is released"""
|
||||||
|
lm = LibraryPackageManager(
|
||||||
|
os.path.join(
|
||||||
|
self.project_config.get("platformio", "libdeps_dir"),
|
||||||
|
self.test_suite.env_name,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
pkg = lm.get_package(self.EXTRA_LIB_DEPS[0])
|
||||||
|
if not pkg or os.path.isfile(os.path.join(pkg.path, "platformio-build.py")):
|
||||||
|
return
|
||||||
|
lm.uninstall(pkg)
|
||||||
|
|
||||||
def get_unity_framework_config(self):
|
def get_unity_framework_config(self):
|
||||||
if not self.platform.is_embedded():
|
if not self.platform.is_embedded():
|
||||||
return self.UNITY_FRAMEWORK_CONFIG["native"]
|
return self.UNITY_FRAMEWORK_CONFIG["native"]
|
||||||
|
Reference in New Issue
Block a user