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

Add an option to disable building SelfTest with meson #2666

Closed
Ali-Amir opened this issue Mar 31, 2023 · 4 comments
Closed

Add an option to disable building SelfTest with meson #2666

Ali-Amir opened this issue Mar 31, 2023 · 4 comments
Labels
Building and Packaging Issues affecting build/packaging scripts and utilities Good First Issue Issues that can be undertaken by someone new to the project

Comments

@Ali-Amir
Copy link
Contributor

Description
Today, there is an option BUILD_TESTING to disable building SelfTest with cmake, however that is not available for meson. The proposal is to add a meson option to building tests directory in Catch2/meson.build:

if get_option('tests')
  subdir('tests')
endif

And add an options file Catch2/meson_options.txt:

option('tests', type: 'boolean', value: true, description: 'Build the unit tests')

Additional context
We're using catch2 as a wrapdb subproject in meson. This allows us to build our code on different platforms without having to install dependencies manually. Since catch2 always includes SelfTest in its meson.build, we end up running SelfTest along with our unit tests when we run meson test.

@aholster
Copy link

aholster commented May 25, 2023

@Ali-Amir You should probably propose this at the Meson repository instead, as they maintain the Wrapdb meson build definitions

@Ali-Amir
Copy link
Contributor Author

@aholster it looks like the change needs to happen in this repository, doesn't it? In order for Wrapdb to pass these options to Catch2, Catch2 build file needs to support them. Please, let me know if I'm missing something.

@horenmar horenmar added Good First Issue Issues that can be undertaken by someone new to the project Building and Packaging Issues affecting build/packaging scripts and utilities labels May 26, 2023
@horenmar
Copy link
Member

I'll merge a PR that adds this.

@Ali-Amir
Copy link
Contributor Author

Thanks @horenmar. I created a PR for this: #2693.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Building and Packaging Issues affecting build/packaging scripts and utilities Good First Issue Issues that can be undertaken by someone new to the project
Projects
None yet
Development

No branches or pull requests

3 participants