diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ccb3d65..a9ee0e9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,10 +16,10 @@ jobs: SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.7 - name: Build and Check Package - uses: hynek/build-and-inspect-python-package@v1.5 + uses: hynek/build-and-inspect-python-package@v2.9.0 deploy: needs: package @@ -30,10 +30,10 @@ jobs: contents: write # For tag and release notes. steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.7 - name: Download Package - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.8 with: name: Packages path: dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54ef390..5cd3df9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,9 +25,9 @@ jobs: gtest_ver: [ "1.11.0" ] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4.1.7 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5.2.0 with: python-version: "3.8" - name: Install GoogleTest @@ -49,7 +49,7 @@ jobs: pip install scons scons -j4 -C tests - name: Upload compilation results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4.4.0 with: name: tests if-no-files-found: error @@ -64,9 +64,9 @@ jobs: package: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.7 - name: Build and Check Package - uses: hynek/build-and-inspect-python-package@v1.5 + uses: hynek/build-and-inspect-python-package@v2.9.0 test: needs: [compile, package] @@ -78,20 +78,20 @@ jobs: python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.1.7 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5.2.0 with: python-version: ${{ matrix.python }} - name: Download compiled tests - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.8 with: name: tests path: tests - name: Download Package - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.8 with: name: Packages path: dist diff --git a/CHANGELOG.md b/CHANGELOG.md index 636c8f3..df064fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# UNRELEASED + +- Catch2: recognize `FAIL()` calls ([#147](https://github.com/pytest-dev/pytest-cpp/pull/147)). + # 2.5.0 (2023-11-01) - Catch2: add support for catch version 3 ([#115](https://github.com/pytest-dev/pytest-cpp/pull/115)). diff --git a/src/pytest_cpp/catch2.py b/src/pytest_cpp/catch2.py index 264d015..2c237a2 100644 --- a/src/pytest_cpp/catch2.py +++ b/src/pytest_cpp/catch2.py @@ -198,8 +198,10 @@ def _parse_xml( fail_msg, ) ) + # These two tags contain the same attributes and can be treated the same test_exception = test_case.findall(".//Exception") - for exception in test_exception: + test_failure = test_case.findall(".//Failure") + for exception in test_exception + test_failure: file_name = exception.attrib["filename"] line_num = int(exception.attrib["line"]) diff --git a/tests/catch2_failure.cpp b/tests/catch2_failure.cpp index 46b345d..769e613 100644 --- a/tests/catch2_failure.cpp +++ b/tests/catch2_failure.cpp @@ -13,6 +13,10 @@ TEST_CASE( "Factorials are computed", "[factorial]" ) { REQUIRE( Factorial(10) == 3628800 ); } +TEST_CASE( "Test fail macro" ) { + FAIL("This is a fail"); +} + TEST_CASE( "Failed Sections" ) { SECTION( "failed 1" ) { REQUIRE(false);