From 03d17b0b09935d9720e6c2e9e50efdb802421a17 Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Sat, 14 Oct 2023 16:13:25 -0700 Subject: [PATCH] ut-v2.0. Output junit tests --- .github/workflows/main.yml | 24 ++++++++++++++++++++++-- README.md | 2 +- dregarnuhr.spec | 2 +- subprojects/boostut.wrap | 4 ++-- test/meson.build | 11 ++++++++--- test/utils.cpp | 2 -- test/volumes.cpp | 2 -- 7 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3c9f3f..6faf9d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,6 +69,7 @@ jobs: actions: read contents: read security-events: write + checks: write env: CC: ${{ matrix.CC }} CXX: ${{ matrix.CXX }} @@ -193,6 +194,25 @@ jobs: id: unittests run: meson test -C build --print-errorlogs + - name: Collect test logs + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: unit-test-junit-log-${{ matrix.os }}-${{ matrix.compiler }} + path: 'build/*junit.xml' + if-no-files-found: ignore + retention-days: 5 + + - name: Test Reporter + uses: dorny/test-reporter@v1.6.0 + if: ${{ always() }} + continue-on-error: true + with: + name: Unit tests ${{ matrix.os }} ${{ matrix.compiler }} + path: 'build/*junit.xml' + reporter: java-junit + fail-on-error: false + - if: ${{ steps.unittests.conclusion == 'failure' && failure() }} name: Test backtrace run: | @@ -257,7 +277,7 @@ jobs: name: dregarnuhr-${{ matrix.os }}-${{ matrix.compiler }} path: | build/src/dregarnuhr - build/src/*_test + 'build/src/*_test' - if: ${{ matrix.flavor == 'windows' && (success() || failure()) }} name: Binary Windows @@ -266,7 +286,7 @@ jobs: name: dregarnuhr-${{ matrix.os }} path: | build/src/dregarnuhr.exe - build/src/*_test.exe + 'build/src/*_test.exe' check-run-linux: needs: build diff --git a/README.md b/README.md index c16f3de..e44b6ac 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Rearrange Ascendence of a Bookworm epubs into Chronological Order ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/talisein/dregarnuhr) -[![CI](https://github.com/talisein/dregarnuhr/actions/workflows/main.yml/badge.svg)](https://github.com/talisein/dregarnuhr/actions/workflows/main.yml) +[![CI](https://github.com/talisein/dregarnuhr/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/talisein/dregarnuhr/actions/workflows/main.yml) [![Copr build status](https://copr.fedorainfracloud.org/coprs/talisein/dregarnuhr/package/dregarnuhr/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/talisein/dregarnuhr/package/dregarnuhr/) [![PPA](https://img.shields.io/badge/Ubuntu%20PPA-available-%23e9500e)](https://launchpad.net/~talisein/+archive/ubuntu/dregarnuhr) diff --git a/dregarnuhr.spec b/dregarnuhr.spec index 8a293ec..5a35cdf 100644 --- a/dregarnuhr.spec +++ b/dregarnuhr.spec @@ -1,5 +1,5 @@ Name: dregarnuhr -Version: 1.0.16 +Version: 1.0.18 Release: 1 Summary: Rearrange Ascendence of a Bookworm epubs into Chronological Order diff --git a/subprojects/boostut.wrap b/subprojects/boostut.wrap index f0ac573..a963d9d 100644 --- a/subprojects/boostut.wrap +++ b/subprojects/boostut.wrap @@ -1,4 +1,4 @@ [wrap-git] url = https://github.com/boost-ext/ut.git -revision = e53a47d37bc594e80bd5f1b8dc1ade8dce4429d3 -directory = ut-e53a47d \ No newline at end of file +revision = v2.0.0 +directory = ut-v2.0.0 \ No newline at end of file diff --git a/test/meson.build b/test/meson.build index bf2efc5..626b1a1 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,14 +1,19 @@ + test('Simple', exe, args: ['--check']) +ut_args = ['-r', 'junit', '-o'] volumes_test = executable('volumes_test', 'volumes.cpp', dependencies: [boostut_dep, dep]) -test('volumes', volumes_test) +test('volumes', volumes_test, + args: [ut_args, 'volumes-junit.xml']) utils_test = executable('utils_test', 'utils.cpp', dependencies: [boostut_dep, dep]) -test('utils', utils_test) +test('utils', utils_test, + args: [ut_args, 'utils-junit.xml']) args_test = executable('args_test', 'args.cpp', dependencies: [boostut_dep, dep]) -test('args', args_test) +test('args', args_test, + args: [ut_args, 'args-junit.xml']) diff --git a/test/utils.cpp b/test/utils.cpp index 88b4b42..1812748 100644 --- a/test/utils.cpp +++ b/test/utils.cpp @@ -3,8 +3,6 @@ #include -template<> auto boost::ut::cfg = boost::ut::runner>{}; - int main() { using namespace boost::ut; using namespace std::string_literals; diff --git a/test/volumes.cpp b/test/volumes.cpp index ce65726..1322ee8 100644 --- a/test/volumes.cpp +++ b/test/volumes.cpp @@ -5,8 +5,6 @@ #include #include "magic_enum.hpp" -template<> auto boost::ut::cfg = boost::ut::runner>{}; - int main() { using namespace boost::ut; using namespace std::string_literals;