-
Notifications
You must be signed in to change notification settings - Fork 22
Allow disabling build of vendored gtest with new cmake option EXTERNAL_GTEST #47
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to allow disabling building the vendored copy of gtest, it's available on most platforms
a037c96 to
563b39b
Compare
djw8605
approved these changes
May 6, 2021
Contributor
djw8605
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume you tested all of this? Otherwise, it looks good.
Contributor
Author
|
@djw8605, here's the log of a build that uses the $ bash -ex build.sh
+ rm -rf _build
+ mkdir _build
+ cd _build
+ pwd
+ cmake .. -DCMAKE_INSTALL_PREFIX=/home/duncan/git/scitokens-cpp-fork/_build/_inst -DBUILD_UNITTESTS:BOOL=TRUE -DEXTERNAL_GTEST:BOOL=TRUE
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /home/duncan/opt/miniconda3/envs/py39/bin/x86_64-conda-linux-gnu-cc
-- Check for working C compiler: /home/duncan/opt/miniconda3/envs/py39/bin/x86_64-conda-linux-gnu-cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/duncan/opt/miniconda3/envs/py39/bin/x86_64-conda-linux-gnu-c++
-- Check for working CXX compiler: /home/duncan/opt/miniconda3/envs/py39/bin/x86_64-conda-linux-gnu-c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CURL: /home/duncan/opt/miniconda3/envs/py39/lib/libcurl.so (found version "7.76.1")
-- Looking for uuid_generate
-- Looking for uuid_generate - not found
-- Found UUID : /home/duncan/opt/miniconda3/envs/py39/lib/libuuid.so
-- Found PkgConfig: /home/duncan/opt/miniconda3/envs/py39/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libcrypto'
-- Found libcrypto, version 1.1.1k
-- Checking for module 'openssl'
-- Found openssl, version 1.1.1k
-- Checking for module 'sqlite3'
-- Found sqlite3, version 3.35.5
-- Configuring done
CMake Warning (dev) at test/CMakeLists.txt:3 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "gtest" of target "scitokens-gtest" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/duncan/git/scitokens-cpp-fork/_build
+ cmake --build .
Scanning dependencies of target SciTokens
[ 6%] Building CXX object CMakeFiles/SciTokens.dir/src/scitokens.cpp.o
[ 12%] Building CXX object CMakeFiles/SciTokens.dir/src/scitokens_internal.cpp.o
[ 18%] Building CXX object CMakeFiles/SciTokens.dir/src/scitokens_cache.cpp.o
[ 25%] Linking CXX shared library libSciTokens.so
[ 25%] Built target SciTokens
Scanning dependencies of target scitokens-test
[ 31%] Building CXX object CMakeFiles/scitokens-test.dir/src/test.cpp.o
[ 37%] Linking CXX executable scitokens-test
[ 37%] Built target scitokens-test
Scanning dependencies of target scitokens-create
[ 43%] Building CXX object CMakeFiles/scitokens-create.dir/src/create.cpp.o
[ 50%] Linking CXX executable scitokens-create
[ 50%] Built target scitokens-create
Scanning dependencies of target scitokens-list-access
[ 56%] Building CXX object CMakeFiles/scitokens-list-access.dir/src/list_access.cpp.o
[ 62%] Linking CXX executable scitokens-list-access
[ 62%] Built target scitokens-list-access
Scanning dependencies of target scitokens-verify
[ 68%] Building CXX object CMakeFiles/scitokens-verify.dir/src/verify.cpp.o
[ 75%] Linking CXX executable scitokens-verify
[ 75%] Built target scitokens-verify
Scanning dependencies of target scitokens-test-access
[ 81%] Building CXX object CMakeFiles/scitokens-test-access.dir/src/test_access.cpp.o
[ 87%] Linking CXX executable scitokens-test-access
[ 87%] Built target scitokens-test-access
Scanning dependencies of target scitokens-gtest
[ 93%] Building CXX object test/CMakeFiles/scitokens-gtest.dir/main.cpp.o
[100%] Linking CXX executable scitokens-gtest
[100%] Built target scitokens-gtest
+ ctest -V
UpdateCTestConfiguration from :/home/duncan/git/scitokens-cpp-fork/_build/DartConfiguration.tcl
UpdateCTestConfiguration from :/home/duncan/git/scitokens-cpp-fork/_build/DartConfiguration.tcl
Test project /home/duncan/git/scitokens-cpp-fork/_build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
Start 1: unit
1: Test command: /home/duncan/git/scitokens-cpp-fork/_build/test/scitokens-gtest
1: Test timeout computed to be: 10000000
1: [==========] Running 6 tests from 2 test suites.
1: [----------] Global test environment set-up.
1: [----------] 2 tests from SciTokenTest
1: [ RUN ] SciTokenTest.CreateToken
1: [ OK ] SciTokenTest.CreateToken (0 ms)
1: [ RUN ] SciTokenTest.SignToken
1: [ OK ] SciTokenTest.SignToken (1 ms)
1: [----------] 2 tests from SciTokenTest (1 ms total)
1:
1: [----------] 4 tests from SerializeTest
1: [ RUN ] SerializeTest.VerifyTest
1: [ OK ] SerializeTest.VerifyTest (17 ms)
1: [ RUN ] SerializeTest.TestStringList
1: [ OK ] SerializeTest.TestStringList (5 ms)
1: [ RUN ] SerializeTest.VerifyWLCGTest
1: [ OK ] SerializeTest.VerifyWLCGTest (5 ms)
1: [ RUN ] SerializeTest.FailVerifyToken
1: [ OK ] SerializeTest.FailVerifyToken (5 ms)
1: [----------] 4 tests from SerializeTest (32 ms total)
1:
1: [----------] Global test environment tear-down
1: [==========] 6 tests from 2 test suites ran. (33 ms total)
1: [ PASSED ] 6 tests.
1/1 Test #1: unit ............................. Passed 0.04 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 0.04 sec
+ cmake --build . --target install
[ 25%] Built target SciTokens
[ 37%] Built target scitokens-test
[ 50%] Built target scitokens-create
[ 62%] Built target scitokens-list-access
[ 75%] Built target scitokens-verify
[ 87%] Built target scitokens-test-access
[100%] Built target scitokens-gtest
Install the project...
-- Install configuration: ""
-- Installing: /home/duncan/git/scitokens-cpp-fork/_build/_inst/lib/libSciTokens.so.0.0.2
-- Installing: /home/duncan/git/scitokens-cpp-fork/_build/_inst/lib/libSciTokens.so.0
-- Installing: /home/duncan/git/scitokens-cpp-fork/_build/_inst/lib/libSciTokens.so
-- Installing: /home/duncan/git/scitokens-cpp-fork/_build/_inst/include/scitokens/scitokens.h |
Contributor
|
Neat! Sounds great! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new CMake option
EXTERNAL_GTEST(defaultOFF) which allows disabling the build of the vendoredgtestfor the test suite.I also addedEDIT: this was dropped because EPEL7's-DBUILD_UNITTESTS:BOOL=TRUE -DEXTERNAL_GTEST:BOOL=TRUEand a%checksection to the rpm build to run the tests there.gtestis too old, and adding a bunch of%ifmacros in the spec file seemed like a lot of work...Fixed #46.