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

cmake // Added Ctest support for unittests #882

Closed
wants to merge 1 commit into from

Conversation

snikulov
Copy link
Contributor

Hi all,
I've enabled ctest verification for cmake builds and tests/unit folder.
Now it is possible after build run
on Linux
make test
on Windows
ctest -VV -C <Debug|Release>

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @billhoffman, @Sukender and @Lekensteyn to be potential reviewers

@snikulov
Copy link
Contributor Author

@bradking Brad, could you please review and comment? Thank you!

@@ -1042,6 +1042,8 @@ if(BUILD_CURL_EXE)
add_subdirectory(src)
endif()
if(BUILD_CURL_TESTS)
include(CTest)
enable_testing()
Copy link
Contributor

Choose a reason for hiding this comment

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

The CTest module calls enable_testing for us so we don't need to call it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bradking From which version? Looks I'm a bit outdated here.

Copy link
Contributor

Choose a reason for hiding this comment

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

It has always done this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that it depends on BUILD_TESTING.

@snikulov
Copy link
Contributor Author

@bradking updated and rebased into single commit.

@bradking
Copy link
Contributor

The CTest module defines a BUILD_TESTING option that controls most of its functionality, including its call to enable_testing. The intended way to use the CTest module is to include it unconditionally and then honor its BUILD_TESTING option:

include(CTest)
if(BUILD_TESTING)
  add_subdirectory(tests)
endif()

However, curl is currently defining its own BUILD_CURL_TESTS option. It also has a code path that includes the CTest module earlier in a BUILD_DASHBOARD_REPORTS condition. These should all be reconciled.

@snikulov
Copy link
Contributor Author

@bradking So what is your proposal, exactly? Should I remove BUILD_CURL_TESTS and BUILD_DASHBOARD_REPORTS anywhere in scripts?

@bradking
Copy link
Contributor

Should I remove BUILD_CURL_TESTS and BUILD_DASHBOARD_REPORTS anywhere in scripts?

That would be the simplest solution. Since the CMake files still warn that they are poorly maintained I don't think anyone expects stability in the current options.

@snikulov
Copy link
Contributor Author

@bradking updated.

@bradking
Copy link
Contributor

The change itself looks good. Please squash in the fixups and revise the commit message to explain the new logic change.

tests and enabling CTest integration.
Options BUILD_CURL_TESTS and BUILD_DASHBOARD_REPORTS was removed.
@snikulov
Copy link
Contributor Author

@bradking Done.

@bagder Daniel, Could you please merge?

@bagder bagder closed this in 12e21fa Jun 21, 2016
@bagder
Copy link
Member

bagder commented Jun 21, 2016

Done, thanks!

Small nit: please make the commit message to follow our commit styles and I'll have an easier job merging your work!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
@snikulov snikulov deleted the ctest_enable branch October 14, 2020 10:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants