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

Automatically handle CONAN_RUN_TESTS environment variable #8687

Merged

Conversation

klimkin
Copy link
Contributor

@klimkin klimkin commented Mar 22, 2021

Helps to avoid boilerplate in conanfiles:

if tools.get_env("CONAN_RUN_TESTS", True):
    self._cmake.test()

Implements #7965

Changelog: Feature: Automatically handle CONAN_RUN_TESTS to avoid extra boilerplate.
Docs: conan-io/docs#2056

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

Helps to avoid boilerplate in conanfiles:

    if tools.get_env("CONAN_RUN_TESTS", True):
        self._cmake.test()
@klimkin klimkin force-pushed the feature/handle-conan-run-tests-env-var branch from 349f2e0 to a148ce2 Compare March 22, 2021 23:23
conan/tools/cmake/cmake.py Outdated Show resolved Hide resolved
@memsharded memsharded self-assigned this Mar 26, 2021
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Besides the detail of the new helper, this looks good and could be merged for next release.

conan/tools/cmake/cmake.py Outdated Show resolved Hide resolved
Co-authored-by: James <james@conan.io>
@memsharded memsharded added this to the 1.35 milestone Mar 26, 2021
@memsharded memsharded merged commit d03a705 into conan-io:develop Mar 29, 2021
@memsharded
Copy link
Member

Merged for 1.35. If you could contribute the docs as well, that would be great (I think a couple of lines in the build helpers docs and in the CONAN_RUN_TEST reference would be enough)

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

Successfully merging this pull request may close these issues.

None yet

2 participants