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

Checking version doesn't work #54

Open
1aam2am1 opened this issue Jul 10, 2023 · 0 comments
Open

Checking version doesn't work #54

1aam2am1 opened this issue Jul 10, 2023 · 0 comments

Comments

@1aam2am1
Copy link

add_test(NAME cli.version_matches COMMAND intro --version)
set_tests_properties(cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION}")

Doesn't work as PROJECT_VERSION is version from

project(CmakeConfigPackageTests LANGUAGES CXX)

and not from root project.

We can use CMAKE_PROJECT_VERSION, but this will break tests when our project isn't top one.

But this should work as we return if

# Don't even look at tests if we're not top level
if(NOT PROJECT_IS_TOP_LEVEL)
  return()
endif()
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

No branches or pull requests

1 participant