Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate catch2 v2 to v3 #683

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

AndreRicardo-Zoetis
Copy link
Contributor

@AndreRicardo-Zoetis AndreRicardo-Zoetis commented Jan 9, 2025

Hello, would you consider upgrading Catch to version 3?

We would like to use newer functionality in Catch2 such as SKIP.
https://catch2-temp.readthedocs.io/en/latest/skipping-passing-failing.html

Also noticed that in Catch2 version 3 there is no need to define all those empty main.cpp.

Changes

Followed the guidelines from:
https://catch2-temp.readthedocs.io/en/latest/migrate-v2-to-v3.html

  1. Change Catch2 to Catch2WithMain where main.cpp was used

  2. [!hide] tag has been removed
    https://github.com/catchorg/Catch2/blob/914aeecfe23b1e16af6ea675a4fb5dbd5a5b8d0a/docs/release-notes.md?plain=1#L505

  3. "The Contains string matcher was renamed to ContainsSubstring."
    https://github.com/catchorg/Catch2/blob/devel/docs/migrate-v2-to-v3.md#things-that-can-break-during-porting

I can tidy up the PR further and remove all the no longer needed main.cpp files, but before doing so would like to have your guidance.

PS: I do have other changes to be able to run the tests as GitHub Action but was able to run the tests successfully in
https://github.com/AndreRicardo-Zoetis/iot-hub-device-update/actions/runs/12689720900/job/35369056358

@AndreRicardo-Zoetis
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Zoetis"

@jw-msft
Copy link
Contributor

jw-msft commented Jan 15, 2025

@AndreRicardo-Zoetis Yes. That's something on the backlog for too long, so thank you for doing this. It would be nice of you to remove the rest of the main.cpp in the tests (except where there are multiple CU).

I built and ran the tests from your fork's branch and they all pass on my end (after running ./scripts/install-deps.sh --install-catch2) and it looks good so far.

For github actions changes, could you open a discussion and at-mention me on it? Then, after discussion we can possibly move towards a PR (let us not include it in this PR).

Copy link
Contributor

@jw-msft jw-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good so far.

scripts/install-deps.sh Outdated Show resolved Hide resolved
src/utils/config_utils/tests/main.cpp Outdated Show resolved Hide resolved
src/utils/root_key_utils/tests/main.cpp Outdated Show resolved Hide resolved
@AndreRicardo-Zoetis
Copy link
Contributor Author

@jw-msft could you please re-review? I'm not pointing at the latest develop branch commit as I'm having an error building mentioned in #685 (comment)

Once that is solved, I can rebase my branch to the latest develop commit.

@AndreRicardo-Zoetis
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants