From 5d42cd39bdc9e04399b5c1a88bf770dbf5562d23 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 16 Sep 2024 17:34:44 +0200 Subject: [PATCH] feat(catch2): update to 3.7.0, add tests --- .build-test-rules.yml | 2 +- catch2/Catch2 | 2 +- .../catch2-console/pytest_catch2_console.py | 18 ++++++++++++++++++ catch2/examples/catch2-test/pytest_catch2.py | 13 +++++++++++++ catch2/idf_component.yml | 2 +- catch2/sbom_catch2.yml | 4 ++-- 6 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 catch2/examples/catch2-console/pytest_catch2_console.py create mode 100644 catch2/examples/catch2-test/pytest_catch2.py diff --git a/.build-test-rules.yml b/.build-test-rules.yml index b5bffba252..4567c80a02 100644 --- a/.build-test-rules.yml +++ b/.build-test-rules.yml @@ -35,7 +35,7 @@ catch2/examples/catch2-test: disable: - if: IDF_VERSION_MAJOR < 5 reason: Example relies on WHOLE_ARCHIVE component property which was introduced in IDF v5.0 - - if: IDF_VERSION_MAJOR == 5 and IDF_VERSION_MINOR < 1 and IDF_TARGET == "linux" + - if: ((IDF_VERSION_MAJOR == 5 and IDF_VERSION_MINOR < 1) and IDF_TARGET == "linux") reason: Docker container for release/v5.0 doesn't contain a C++ compiler catch2/examples/catch2-console: diff --git a/catch2/Catch2 b/catch2/Catch2 index 05e10dfccc..31588bb4f5 160000 --- a/catch2/Catch2 +++ b/catch2/Catch2 @@ -1 +1 @@ -Subproject commit 05e10dfccc28c7f973727c54f850237d07d5e10f +Subproject commit 31588bb4f56b638dd5afc28d3ebff9b9dcefb88d diff --git a/catch2/examples/catch2-console/pytest_catch2_console.py b/catch2/examples/catch2-console/pytest_catch2_console.py new file mode 100644 index 0000000000..c3c2ca6cbd --- /dev/null +++ b/catch2/examples/catch2-console/pytest_catch2_console.py @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Unlicense OR CC0-1.0 + +import pytest +from pytest_embedded import Dut + + +@pytest.mark.supported_targets +@pytest.mark.generic +def test_catch2_console_example(dut: Dut) -> None: + dut.expect_exact('Type \'help\' to get the list of commands.') + dut.write('test -?\n') + dut.expect_exact('For more detailed usage please see the project docs') + dut.write('test\n') + dut.expect_exact('All tests passed') + dut.expect_exact('1 assertion in 1 test case') + + diff --git a/catch2/examples/catch2-test/pytest_catch2.py b/catch2/examples/catch2-test/pytest_catch2.py new file mode 100644 index 0000000000..0d0241298a --- /dev/null +++ b/catch2/examples/catch2-test/pytest_catch2.py @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Unlicense OR CC0-1.0 + +import pytest +from pytest_embedded import Dut + + +@pytest.mark.supported_targets +@pytest.mark.generic +def test_catch2_example(dut: Dut) -> None: + dut.expect_exact('All tests passed') + dut.expect_exact('1 assertion in 1 test case') + diff --git a/catch2/idf_component.yml b/catch2/idf_component.yml index dada9f26e4..6294ca6dc5 100644 --- a/catch2/idf_component.yml +++ b/catch2/idf_component.yml @@ -1,4 +1,4 @@ -version: "3.5.2" +version: "3.7.0" description: A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later url: https://github.com/espressif/idf-extra-components/tree/master/catch2 repository: https://github.com/espressif/idf-extra-components.git diff --git a/catch2/sbom_catch2.yml b/catch2/sbom_catch2.yml index e9b5cbe6d4..437223f365 100644 --- a/catch2/sbom_catch2.yml +++ b/catch2/sbom_catch2.yml @@ -1,7 +1,7 @@ name: catch2 -version: 3.5.2 +version: 3.7.0 cpe: cpe:2.3:a:catchorg:catch2:{}:*:*:*:*:*:*:* supplier: 'Organization: catchorg ' description: A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later url: https://github.com/catchorg/Catch2 -hash: 05e10dfccc28c7f973727c54f850237d07d5e10f +hash: 31588bb4f56b638dd5afc28d3ebff9b9dcefb88d