Skip to content

Automatically handle CONAN_RUN_TESTS environment variable - #8687

Merged
memsharded merged 2 commits into
conan-io:developfrom
klimkin:feature/handle-conan-run-tests-env-var
Mar 29, 2021
Merged

memsharded merged 2 commits into
conan-io:developfrom
klimkin:feature/handle-conan-run-tests-env-var

Conversation

@klimkin

@klimkin klimkin commented Mar 22, 2021

Copy link
Copy Markdown
Contributor

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
Comment thread conan/tools/cmake/cmake.py
@memsharded memsharded self-assigned this Mar 26, 2021

@memsharded memsharded left a comment

Copy link
Copy Markdown
Member

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.

Comment thread conan/tools/cmake/cmake.py Outdated
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
Copy Markdown
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.

2 participants