8000 cmake: support the use of launchers in ctest -S scripts by purpleKarrot · Pull Request #1687 · bitcoin-core/secp256k1 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cmake: support the use of launchers in ctest -S scripts #1687

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

purpleKarrot
Copy link
Contributor

When CTEST_USE_LAUNCHERS is set to ON in a ctest -S script, the configure step fails with the error message:

CMake Error:
  CTEST_USE_LAUNCHERS is enabled, but the RULE_LAUNCH_COMPILE global property
  is not defined.

  Did you forget to include(CTest) in the toplevel CMakeLists.txt ?

However, include(CTest) produces unwanted clutter. include(CTestUseLaunchers) is a more lightweight alternative.

To reproduce the issue, run the following script with and without the PR applied.

#!/usr/bin/env -S ctest -VV -S

set(CTEST_SOURCE_DIRECTORY "/path/to/secp256k1")
set(CTEST_BINARY_DIRECTORY "/path/to/secp256k1-build")

set(CTEST_CMAKE_GENERATOR "Ninja")
set(CTEST_USE_LAUNCHERS ON)

ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
ctest_start("Experimental")
ctest_configure()
ctest_build()

@@ -13,6 +13,7 @@ project(libsecp256k1
LANGUAGES C
)
enable_testing()
include(CTestUseLaunchers)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this deserves a comment. Otherwise, it looks like an unused import.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find it hard to come up with a comment that is not stating the obvious. The CTestUseLaunchers module has a single purpose, explained in its documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I find it hard to come up with a comment that is not stating the obvious. The CTestUseLaunchers module has a single purpose, explained in its documentation.

Okay, I tend to think what is obvious or not is in the eye of the beholder. I assume it's not obvious for the typical reader.

What about?

Suggested change
include(CTestUseLaunchers)
include(CTestUseLaunchers) # for "ctest -S" of the user

The crucial part here is "of the user". This line is not needed for anything we currently have in our repo.

@real-or-random
Copy link
Contributor

cc @hebasto

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

Successfully merging this pull request may close these issues.

2 participants
0