catchorg / catchorg/Catch2

ParseAndAddCatchTests is deprecated without replacement for OptionalCatchTestLauncher

Open
#2,412 3 comments 6 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Describe the bug**

When I use `ParseAndAddCatchTests` I get a warning:

`**ParseAndAddCatchTest: function deprecated because of possibility of missed test cases. Consider using 'catch_discover_tests' from 'Catch.cmake'`

But `catch_discover_tests` doesn't support all the features of `ParseAndAddCatchTests`.

For example, there's no way to specify a custom test launcher. Setting `OptionalCatchTestLauncher` has no effect.

So I'm stuck with `ParseAndAddCatchTests` and the deprecation warning!!

**Expected behavior**

`catch_discover_tests` should have an optional parameter `TEST_EXECUTOR` or something like that.

I saw internally it uses `TEST_EXECUTOR` already, set from the property `CROSSCOMPILING_EMULATOR`, so should be an easy fix.

Contributor guide

Open the contributing guide

Research direction

Start by reading the Catch.cmake implementation of catch_discover_tests and compare it with ParseAndAddCatchTests, especially how OptionalCatchTestLauncher and the existing TEST_EXECUTOR from CROSSCOMPILING_EMULATOR are handled. Add support for specifying a custom test launcher through catch_discover_tests, then verify that the launcher is used without the deprecation warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.