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

BUILD_TESTING has no effect #901

Closed
ghost opened this issue Feb 16, 2021 · 0 comments
Closed

BUILD_TESTING has no effect #901

ghost opened this issue Feb 16, 2021 · 0 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Feb 16, 2021

The documentation says that in order to disable tests you should pass BUILD_TESTING=OFF. However, this has no effect because CTest is only included if ABSL_RUN_TESTS is set. I think either the documentation to reflect this or code should be fixed to use the more standardized variable.

@devjgm recommended I report this.

@ghost ghost added the bug label Feb 16, 2021
@derekmauro derekmauro self-assigned this Feb 16, 2021
matta added a commit to matta/abseil-cpp that referenced this issue Nov 10, 2021
The new logic is this: Abseil's own tests are disabled if
either BUILD_TESTING or ABSL_BUILD_TESTING is false.
Previously, only BUILD_TESTING was consulted.

Using just BUILD_TESTING, as has been the case since abseil#901
was resolved in commit a50ae36 about 9 months ago.
Previously, Abseil had a project specific flag for this.

BUILD_TESTING is a simplistic all-or-nothing policy that
suffices for simpler projects.  When Abseil is incorporated
as a subproject, the encompasing build has no convenient way
to disable just Abseil's tests yet enable its own.
Commonly, projects export an option to configure their own
tests.

Fixes 1056
matta added a commit to matta/abseil-cpp that referenced this issue Nov 10, 2021
Abseil's own tests now are disabled if either BUILD_TESTING
or a new option called ABSL_BUILD_TESTING is false.
Additionally, Abseil's CMakeLists.txt no longer re-declares
the BUILD_TESTING option with a value of false.

Abseil had been using just the BUILD_TESTING option, since
the fix for abseil#901.  Because setting BUILD_TESTING false still
works to disable Abseil's tests, this change preserves the
behavior asked for in that issue.

Previous to that, Abseil had a project specific flag for
this, as is the typical idiom used in other projects.

The issue BUILD_TESTING is that it is an all-or-nothing
policy.  When Abseil is incorporated as a subproject, the
encompasing project has no convenient way to enable its own
tests while disabling Abseil's.

Fixes 1056
matta added a commit to matta/abseil-cpp that referenced this issue Nov 10, 2021
Abseil's own tests now are disabled if either BUILD_TESTING
or a new option called ABSL_BUILD_TESTING is false.
Additionally, Abseil's CMakeLists.txt no longer re-declares
the BUILD_TESTING option with a value of false.

Abseil had been using just the BUILD_TESTING option, since
the fix for abseil#901.  Because setting BUILD_TESTING false still
works to disable Abseil's tests, this change preserves the
behavior asked for in that issue.

Previous to that, Abseil had a project specific flag for
this, as is the typical idiom used in other projects.

The issue BUILD_TESTING is that it is an all-or-nothing
policy.  When Abseil is incorporated as a subproject, the
encompasing project has no convenient way to enable its own
tests while disabling Abseil's.

Fixes abseil#1056
matta added a commit to matta/abseil-cpp that referenced this issue Nov 10, 2021
Abseil's own tests now are disabled if either BUILD_TESTING
or a new option called ABSL_BUILD_TESTING is false.
Additionally, Abseil's CMakeLists.txt no longer re-declares
the BUILD_TESTING option with a value of false.

Abseil had been using just the BUILD_TESTING option, since
the fix for abseil#901.  Because setting BUILD_TESTING false still
works to disable Abseil's tests, this change preserves the
behavior asked for in that issue.

Previous to that, Abseil had a project specific flag for
this, as is the typical idiom used in other projects.

The issue with BUILD_TESTING is that it is an all-or-nothing
policy.  When Abseil is incorporated as a subproject, the
encompasing project has no convenient way to enable its own
tests while disabling Abseil's.

Fixes abseil#1056
derekmauro pushed a commit that referenced this issue Dec 10, 2021
Abseil's own tests now are disabled if either BUILD_TESTING
or a new option called ABSL_BUILD_TESTING is false.
Additionally, Abseil's CMakeLists.txt no longer re-declares
the BUILD_TESTING option with a value of false.

Abseil had been using just the BUILD_TESTING option, since
the fix for #901.  Because setting BUILD_TESTING false still
works to disable Abseil's tests, this change preserves the
behavior asked for in that issue.

Previous to that, Abseil had a project specific flag for
this, as is the typical idiom used in other projects.

The issue with BUILD_TESTING is that it is an all-or-nothing
policy.  When Abseil is incorporated as a subproject, the
encompasing project has no convenient way to enable its own
tests while disabling Abseil's.

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

No branches or pull requests

1 participant