Added support for a Custom Unity Library // Resolve #3980

This commit is contained in:
Ivan Kravets
2022-05-03 21:47:20 +03:00
parent b12d9f62b9
commit e81d83b8c2
4 changed files with 8 additions and 7 deletions

View File

@ -48,7 +48,8 @@ Please check `Migration guide from 5.x to 6.0 <https://docs.platformio.org/en/la
- New `Test Hierarchies <https://docs.platformio.org/en/latest/advanced/unit-testing/structure.html>`_ (`issue #4135 <https://github.com/platformio/platformio-core/issues/4135>`_)
- New `Custom Testing Framework <https://docs.platformio.org/en/latest/advanced/unit-testing/frameworks/custom/index.html>`_
- New "test" `build configuration <https://docs.platformio.org/en/latest/projectconf/build_configurations.html>`__
- Added support for ``socket://`` and ``rfc2217://`` protocols using `test_port <https://docs.platformio.org/en/latest/projectconf/section_env_test.html#test-port>`__ option (`issue #4229 <https://github.com/platformio/platformio-core/issues/4229>`_)
- Added support for the ``socket://`` and ``rfc2217://`` protocols using `test_port <https://docs.platformio.org/en/latest/projectconf/section_env_test.html#test-port>`__ option (`issue #4229 <https://github.com/platformio/platformio-core/issues/4229>`_)
- Added support for a `Custom Unity Library <https://docs.platformio.org/en/latest/advanced/unit-testing/frameworks/custom/examples/custom_unity_library.html>`__ (`issue #3980 <https://github.com/platformio/platformio-core/issues/3980>`_)
- Generate reports in JUnit and JSON formats using the `pio test --output-format <https://docs.platformio.org/en/latest/core/userguide/cmd_test.html#cmdoption-pio-test-output-format>`__ option (`issue #2891 <https://github.com/platformio/platformio-core/issues/2891>`_)
- Provide more information when the native program crashed on a host (errored with a negative return code) (`issue #3429 <https://github.com/platformio/platformio-core/issues/3429>`_)
- Fixed an issue when command line parameters (``--ignore``, ``--filter``) do not override values defined in the |PIOCONF| (`issue #3845 <https://github.com/platformio/platformio-core/issues/3845>`_)

2
docs

Submodule docs updated: 39112eefaa...89babce984

View File

@ -42,14 +42,14 @@ class TestRunnerFactory(object):
runner_cls = None
if test_framework == "custom":
test_dir = project_config.get("platformio", "test_dir")
custom_runner_path = os.path.join(test_dir, "custom_test_runner.py")
custom_runner_path = os.path.join(test_dir, "test_custom_runner.py")
test_name = test_suite.test_name if test_suite.test_name != "*" else None
while test_name:
if os.path.isfile(
os.path.join(test_dir, test_name, "custom_test_runner.py")
os.path.join(test_dir, test_name, "test_custom_runner.py")
):
custom_runner_path = os.path.join(
test_dir, test_name, "custom_test_runner.py"
test_dir, test_name, "test_custom_runner.py"
)
break
test_name = os.path.dirname(test_name) # parent dir

View File

@ -45,7 +45,7 @@ def test_calculator_example(tmp_path: Path):
# test JUnit output
junit_testsuites = ET.parse(junit_output_path).getroot()
assert int(junit_testsuites.get("tests")) == 10
assert int(junit_testsuites.get("tests")) == 11
assert int(junit_testsuites.get("errors")) == 2
assert int(junit_testsuites.get("failures")) == 1
assert len(junit_testsuites.findall("testsuite")) == 6
@ -112,7 +112,7 @@ void my_extra_fun(void) {
# test group
test_group = test_dir / "group"
test_group.mkdir(parents=True)
(test_group / "custom_test_runner.py").write_text(
(test_group / "test_custom_runner.py").write_text(
"""
import click