Fix BUILD_TESTING=off#72
Merged
wusatosi merged 3 commits intobemanproject:mainfrom Nov 12, 2024
Merged
Conversation
d77897c to
b16093e
Compare
b16093e to
db2b30d
Compare
neatudarius
reviewed
Nov 12, 2024
Member
|
Tested with preset gcc-release and gcc-debug: dariusn@pc:~/git/Beman/exemplar$ rm -rf .build /opt/beman.exemplar/ && cmake --workflow --preset gcc-debug
Executing workflow step 1 of 3: configure preset "gcc-debug"
Preset CMake variables:
CMAKE_BUILD_TYPE="Debug"
CMAKE_CXX_COMPILER="g++"
CMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
CMAKE_CXX_STANDARD="17"
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/dariusn/git/Beman/exemplar/build/gcc-debug
Executing workflow step 2 of 3: build preset "gcc-debug"
ninja: no work to do.
Executing workflow step 3 of 3: test preset "gcc-debug"
Test project /home/dariusn/git/Beman/exemplar/build/gcc-debug
Start 1: IdentityTest.call_identity_with_int
1/4 Test #1: IdentityTest.call_identity_with_int ........... Passed 0.01 sec
Start 2: IdentityTest.call_identity_with_custom_type
2/4 Test #2: IdentityTest.call_identity_with_custom_type ... Passed 0.01 sec
Start 3: IdentityTest.compare_std_vs_beman
3/4 Test #3: IdentityTest.compare_std_vs_beman ............. Passed 0.01 sec
Start 4: IdentityTest.check_is_transparent
4/4 Test #4: IdentityTest.check_is_transparent ............. Passed 0.01 sec
100% tests passed, 0 tests failed out of 4
Total Test time (real) = 0.04 sec
dariusn@pc:~/git/Beman/exemplar$ cmake --install build/gcc-debug --prefix /opt/beman.exemplar
-- Install configuration: "Debug"
-- Installing: /opt/beman.exemplar/debug/lib/libbeman.exemplar.a
-- Installing: /opt/beman.exemplar/include/beman/exemplar/identity.hpp
dariusn@pc:~/git/Beman/exemplar$ tree /opt/beman.exemplar/
/opt/beman.exemplar/
├── debug
│ └── lib
│ └── libbeman.exemplar.a
└── include
└── beman
└── exemplar
└── identity.hpp
6 directories, 2 files
dariusn@pc:~/git/Beman/exemplar$ rm -rf .build /opt/beman.exemplar/ && cmake --workflow --preset gcc-release
Executing workflow step 1 of 3: configure preset "gcc-release"
Preset CMake variables:
CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CXX_COMPILER="g++"
CMAKE_CXX_FLAGS="-O3"
CMAKE_CXX_STANDARD="17"
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python3: /usr/bin/python3.12 (found version "3.12.3") found components: Interpreter
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done (2.7s)
-- Generating done (0.0s)
-- Build files have been written to: /home/dariusn/git/Beman/exemplar/build/gcc-release
Executing workflow step 2 of 3: build preset "gcc-release"
[10/10] Linking CXX executable tests/beman/exemplar/beman.exemplar.tests.identity
Executing workflow step 3 of 3: test preset "gcc-release"
Test project /home/dariusn/git/Beman/exemplar/build/gcc-release
Start 1: IdentityTest.call_identity_with_int
1/4 Test #1: IdentityTest.call_identity_with_int ........... Passed 0.00 sec
Start 2: IdentityTest.call_identity_with_custom_type
2/4 Test #2: IdentityTest.call_identity_with_custom_type ... Passed 0.00 sec
Start 3: IdentityTest.compare_std_vs_beman
3/4 Test #3: IdentityTest.compare_std_vs_beman ............. Passed 0.00 sec
Start 4: IdentityTest.check_is_transparent
4/4 Test #4: IdentityTest.check_is_transparent ............. Passed 0.00 sec
100% tests passed, 0 tests failed out of 4
Total Test time (real) = 0.00 sec
dariusn@pc:~/git/Beman/exemplar$ cmake --install build/gcc-release --prefix /opt/beman.exemplar
-- Install configuration: "RelWithDebInfo"
-- Installing: /opt/beman.exemplar/lib/libbeman.exemplar.a
-- Installing: /opt/beman.exemplar/include/beman/exemplar/identity.hpp
dariusn@pc:~/git/Beman/exemplar$ tree /opt/beman.exemplar/
/opt/beman.exemplar/
├── include
│ └── beman
│ └── exemplar
│ └── identity.hpp
└── lib
└── libbeman.exemplar.a
5 directories, 2 filesThat's OK! =================== Tested with BUILD_TESTING=OFF on main with this script: set -x
rm -rf .build /opt/beman.exemplar/
cmake -B .build -S . &> /dev/null
cmake --build .build --config Asan --target all -- -k 0 &> /dev/null
ctest --build-config Asan --output-on-failure --test-dir .build
cmake --install .build --prefix /opt/beman.exemplar
tree /opt/beman.exemplar
rm -rf .build /opt/beman.exemplar/
cmake -B .build -S . -DBUILD_TESTING=OFF &> /dev/null
cmake --build .build --config Asan --target all -- -k 0 &> /dev/null
ctest --build-config Asan --output-on-failure --test-dir .build
cmake --install .build --prefix /opt/beman.exemplar
tree /opt/beman.exemplarIndeed, it's broken. Your fix is valid. Do you want to create an issue to also run one with BUILD_TESTING=OFF on CI? It can be a default compiler ("system") and it can only validate that we install the library when tests are deactivated. For all other CI cases, we should run tests, install library, and the check we have expected files in the tree. LE It seems you already started in configuration-test. |
neatudarius
approved these changes
Nov 12, 2024
Member
Author
|
Go for it! |
neatudarius
reviewed
Nov 12, 2024
Member
Author
|
I already included a CI check for configuration with |
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
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.
exemplar currently cannot install when
BUILD_TEST=off(see: #70).This is due to
CMAKE_INSTALL_INCLUDEDIR/CMAKE_INSTALL_LIBDIRnot defined when we are not fetching configuration for Google Test.This PR fixes that by adding
include(GNUInstallDirs).This PR also adds configuration test (plain cmake build, no unit testing) for the BUILD_TEST cmake parameter to CI.
Closes: #70