Skip to content

Conversation

@ClausKlein
Copy link
Contributor

@ClausKlein ClausKlein commented Nov 28, 2025

Feature: add example/scope-module if possible too:

bash-5.3$ CXX=g++ cmake --preset gcc-release --fresh 
-- The CXX compiler identification is GNU 15.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Compiler is: GNU version:  15.2.0
cmake is: 4.2.0 modules scan :  1
-- Performing Test HAVE_FLAG__ffile_prefix_map__Users_clausklein_Workspace_cpp_beman_project_scope_build_gcc_release__deps_catch2_src__
-- Performing Test HAVE_FLAG__ffile_prefix_map__Users_clausklein_Workspace_cpp_beman_project_scope_build_gcc_release__deps_catch2_src__ - Success
Tests to be built: scope_success;scope_exit;scope_fail;unique_resource;module
Examples to be built: scope_example;unique_resource;unique_resource-file
-- Configuring done (15.7s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/scope/build/gcc-release

bash-5.3$ cmake --build --preset gcc-release
[246/246] Linking CXX executable tests/test.scope_success

bash-5.3$ cd build/gcc-release/
bash-5.3$ ctest
Test project /Users/clausklein/Workspace/cpp/beman-project/scope/build/gcc-release
      Start  1: scope_success supports move-only captures
 1/43 Test  #1: scope_success supports move-only captures ...............................   Passed    0.04 sec
      Start  2: scope_success handler with side-effect object
 2/43 Test  #2: scope_success handler with side-effect object ...........................   Passed    0.01 sec
      Start  3: scope_success does not run handler if exception is thrown
 3/43 Test  #3: scope_success does not run handler if exception is thrown ...............   Passed    0.03 sec
      Start  4: scope_success noexcept handler works
 4/43 Test  #4: scope_success noexcept handler works ....................................   Passed    0.02 sec
      Start  5: scope_success runs handler on normal scope exit
 5/43 Test  #5: scope_success runs handler on normal scope exit .........................   Passed    0.01 sec
      Start  6: scope_success handles nested guards in reverse order
 6/43 Test  #6: scope_success handles nested guards in reverse order ....................   Passed    0.01 sec
      Start  7: scope_success can be released to prevent handler
 7/43 Test  #7: scope_success can be released to prevent handler ........................   Passed    0.02 sec
      Start  8: scope_success moves transfer ownership of handler
 8/43 Test  #8: scope_success moves transfer ownership of handler .......................   Passed    0.01 sec
      Start  9: scope_success does NOT run handler on exception
 9/43 Test  #9: scope_success does NOT run handler on exception .........................   Passed    0.02 sec
      Start 10: moved-from scope_success does not trigger handler
10/43 Test #10: moved-from scope_success does not trigger handler .......................   Passed    0.01 sec
      Start 11: scope_success can be released before normal scope exit
11/43 Test #11: scope_success can be released before normal scope exit ..................   Passed    0.01 sec
      Start 12: scope_success honors release inside nested logic
12/43 Test #12: scope_success honors release inside nested logic ........................   Passed    0.01 sec
      Start 13: scope_exit does not run handler if released
13/43 Test #13: scope_exit does not run handler if released .............................   Passed    0.01 sec
      Start 14: scope_exit handles nested guards in correct order
14/43 Test #14: scope_exit handles nested guards in correct order .......................   Passed    0.01 sec
      Start 15: scope_exit runs handler on exception
15/43 Test #15: scope_exit runs handler on exception ....................................   Passed    0.01 sec
      Start 16: moved-from scope_exit does not trigger handler
16/43 Test #16: moved-from scope_exit does not trigger handler ..........................   Passed    0.02 sec
      Start 17: scope_exit supports noexcept lambdas
17/43 Test #17: scope_exit supports noexcept lambdas ....................................   Passed    0.01 sec
      Start 18: scope_exit runs handler on normal scope exit
18/43 Test #18: scope_exit runs handler on normal scope exit ............................   Passed    0.01 sec
      Start 19: scope_exit supports move semantics
19/43 Test #19: scope_exit supports move semantics ......................................   Passed    0.01 sec
      Start 20: scope_exit with move-only captured resource
20/43 Test #20: scope_exit with move-only captured resource .............................   Passed    0.01 sec
      Start 21: scope_fail does NOT run on normal scope exit
21/43 Test #21: scope_fail does NOT run on normal scope exit ............................   Passed    0.01 sec
      Start 22: scope_fail coexists with scope_success
22/43 Test #22: scope_fail coexists with scope_success ..................................   Passed    0.01 sec
      Start 23: scope_fail handler works inside noexcept lambda (not triggered)
23/43 Test #23: scope_fail handler works inside noexcept lambda (not triggered) .........   Passed    0.01 sec
      Start 24: scope_fail handles nested guards in reverse order
24/43 Test #24: scope_fail handles nested guards in reverse order .......................   Passed    0.01 sec
      Start 25: scope_fail handler can include side-effect cleanup
25/43 Test #25: scope_fail handler can include side-effect cleanup ......................   Passed    0.01 sec
      Start 26: scope_fail executes multiple guards in reverse order
26/43 Test #26: scope_fail executes multiple guards in reverse order ....................   Passed    0.01 sec
      Start 27: scope_fail does not trigger on conditional early return
27/43 Test #27: scope_fail does not trigger on conditional early return .................   Passed    0.01 sec
      Start 28: scope_fail runs handler on exception
28/43 Test #28: scope_fail runs handler on exception ....................................   Passed    0.01 sec
      Start 29: scope_fail with move-only captures
29/43 Test #29: scope_fail with move-only captures ......................................   Passed    0.01 sec
      Start 30: scope_fail doesn't trigger in function that catches its own exception
30/43 Test #30: scope_fail doesn't trigger in function that catches its own exception ...   Passed    0.01 sec
      Start 31: scope_fail can be released to cancel handler
31/43 Test #31: scope_fail can be released to cancel handler ............................   Passed    0.01 sec
      Start 32: scope_fail behaves correctly when moved
32/43 Test #32: scope_fail behaves correctly when moved .................................   Passed    0.01 sec
      Start 33: scope_fail supports release just before exception
33/43 Test #33: scope_fail supports release just before exception .......................   Passed    0.01 sec
      Start 34: scope_fail supports move-only captures
34/43 Test #34: scope_fail supports move-only captures ..................................   Passed    0.01 sec
      Start 35: unique_resource moves properly
35/43 Test #35: unique_resource moves properly ..........................................   Passed    0.01 sec
      Start 36: unique_resource reset cleans up old resource
36/43 Test #36: unique_resource reset cleans up old resource ............................   Passed    0.01 sec
      Start 37: unique_resource cleans up on exception
37/43 Test #37: unique_resource cleans up on exception ..................................   Passed    0.01 sec
      Start 38: unique_resource handles exception during reset
38/43 Test #38: unique_resource handles exception during reset ..........................   Passed    0.01 sec
      Start 39: unique_resource does not clean up if reset before exception
39/43 Test #39: unique_resource does not clean up if reset before exception .............   Passed    0.01 sec
      Start 40: Construct file unique_resource
40/43 Test #40: Construct file unique_resource ..........................................   Passed    0.01 sec
      Start 41: unique_resource does not clean up after release
41/43 Test #41: unique_resource does not clean up after release .........................   Passed    0.01 sec
      Start 42: unique_resource calls cleanup on destruction
42/43 Test #42: unique_resource calls cleanup on destruction ............................   Passed    0.01 sec
      Start 43: module-test
43/43 Test #43: module-test .............................................................   Passed    0.01 sec

100% tests passed, 0 tests failed out of 43

Total Test time (real) =   0.71 sec

bash-5.3$ cmake --install .
-- Install configuration: "RelWithDebInfo"
-- Installing: /Users/clausklein/.local/lib/libbeman.scope.a
-- Installing: /Users/clausklein/.local/include/beman/scope/beman.scope.cppm
-- Installing: /Users/clausklein/.local/include/beman/scope/scope.hpp
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/bmi-GNU_RelWithDebInfo/beman.scope.gcm
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/beman.scope-config.cmake
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/beman.scope-config-version.cmake
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/beman.scope-targets.cmake
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/beman.scope-targets-relwithdebinfo.cmake
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/cxx-modules/cxx-modules-beman.scope-targets.cmake
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/cxx-modules/cxx-modules-beman.scope-targets-RelWithDebInfo.cmake
-- Installing: /Users/clausklein/.local/lib/cmake/beman.scope/cxx-modules/target-scope-RelWithDebInfo.cmake
bash-5.3$ 

@coveralls
Copy link

coveralls commented Nov 28, 2025

Coverage Status

coverage: 100.0%. remained the same
when pulling d62d6c4 on ClausKlein:develop
into 6af8df2 on bemanproject:main.

Co-authored-by: Jeff Garland <jeff@crystalclearsoftware.com>
@ClausKlein ClausKlein marked this pull request as draft December 3, 2025 06:14
Comment on lines +94 to +95
CXX_MODULES_BMI
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/beman.scope/bmi-${CMAKE_CXX_COMPILER_ID}_$<CONFIG>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note this!

Copy link
Member

Choose a reason for hiding this comment

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

Noted. We don't have a standard for how to do this, but this seems reasonable for now -- but something we need to ultimately add into exemplar.

Copy link
Member

Choose a reason for hiding this comment

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

I'm going to merge this -- I've recorded an issue for us to look at bemanproject/exemplar#272 (comment)

@ClausKlein ClausKlein marked this pull request as ready for review December 4, 2025 05:51
@JeffGarland
Copy link
Member

ok so what's with this part of the install given that the library is header only? Is this something that's a side effect of the module packaging?

-- Installing: /Users/clausklein/.local/lib/libbeman.scope.a

Outside of this, I'm happy with the PR.

@ClausKlein
Copy link
Contributor Author

ok so what's with this part of the install given that the library is header only? Is this something that's a side effect of the module packaging?

Yes, see the CMakeLists.txt

Copy link
Member

@JeffGarland JeffGarland left a comment

Choose a reason for hiding this comment

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

I'm approving and merging. @ClausKlein thanks for the refinements

@JeffGarland JeffGarland merged commit f191bef into bemanproject:main Dec 14, 2025
36 checks passed
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.

3 participants