Skip to content

Commit c57d250

Browse files
committed
Run linters
1 parent 5f91708 commit c57d250

File tree

4 files changed

+34
-49
lines changed

4 files changed

+34
-49
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if(BUILD_TESTING)
2222
FetchContent_Declare(
2323
googletest
2424
GIT_REPOSITORY https://github.com/google/googletest.git
25-
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
25+
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
2626
)
2727
FetchContent_MakeAvailable(googletest)
2828
endif()

README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,23 @@ This repository implements `std::optional` extensions targeting C++26. The `Bema
1313
* [Give *std::optional* Range Support (P3168R2)](https://wg21.link/P3168R2)
1414
* [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)
1515

16-
1716
## Table of Contents
1817

19-
- [Beman.Optional26: C++26 Extensions for std::optional](#bemanoptional26-c26-extensions-for-stdoptional)
20-
- [Table of Contents](#table-of-contents)
21-
- [License](#license)
22-
- [Examples](#examples)
23-
- [range\_loop](#range_loop)
24-
- [optional\_ref](#optional_ref)
25-
- [How to Build](#how-to-build)
26-
- [Compiler Support](#compiler-support)
27-
- [Dependencies](#dependencies)
28-
- [Instructions](#instructions)
29-
- [Default Build and Test Flow](#default-build-and-test-flow)
30-
- [More Complex Cases](#more-complex-cases)
31-
- [Step by Step Build: Build and Run Tests](#step-by-step-build-build-and-run-tests)
32-
- [Step by Step Build: Build Production and Skip Tests](#step-by-step-build-build-production-and-skip-tests)
33-
- [Papers](#papers)
34-
18+
* [Beman.Optional26: C++26 Extensions for std::optional](#bemanoptional26-c26-extensions-for-stdoptional)
19+
* [Table of Contents](#table-of-contents)
20+
* [License](#license)
21+
* [Examples](#examples)
22+
* [range\_loop](#range_loop)
23+
* [optional\_ref](#optional_ref)
24+
* [How to Build](#how-to-build)
25+
* [Compiler Support](#compiler-support)
26+
* [Dependencies](#dependencies)
27+
* [Instructions](#instructions)
28+
* [Default Build and Test Flow](#default-build-and-test-flow)
29+
* [More Complex Cases](#more-complex-cases)
30+
* [Step by Step Build: Build and Run Tests](#step-by-step-build-build-and-run-tests)
31+
* [Step by Step Build: Build Production and Skip Tests](#step-by-step-build-build-production-and-skip-tests)
32+
* [Papers](#papers)
3533

3634
## License
3735

@@ -193,7 +191,7 @@ This should build and run the tests with GCC 14 with the address and undefined b
193191
The CMake preset system suffers from combinitorial explosion. There is a makefile in the root of the repository to aid in running more configurations.
194192

195193
```shell
196-
make -k TOOLCHAIN=clang-18 CONFIG=Tsan VERBOSE=1
194+
make -k TOOLCHAIN=clang-18 CONFIG=Tsan VERBOSE=1
197195
```
198196

199197
The makefile will use your system compiler, `c++`, if no toolchain name is provided, otherwise it will use the toolchain in the etc/ directory to perform the build. The Ninja multi config generator is used, with configurations for `RelWithDebugInfo`, `Debug`, `Tsan`, and `Asan` configured by default.
@@ -212,7 +210,7 @@ $ cmake -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan
212210
# Build.
213211
$ cmake --build .build --config Asan --target all -- -k 0
214212
...
215-
[30/30] Linking CXX executable ...
213+
[30/30] Linking CXX executable ... # Note: 30 targets here (including tests).
216214

217215
# Run tests.
218216
$ ctest --build-config Asan --output-on-failure --test-dir .build
@@ -238,7 +236,7 @@ $ cmake -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan
238236
# Build.
239237
$ cmake --build .build --config Asan --target all -- -k 0
240238
...
241-
[15/15] Linking CXX executable examples/Asan/sample
239+
[15/15] Linking CXX executable ... # Note: 15 targets here (tests were not built).
242240

243241
# Check that tests are not built/installed.
244242
$ ctest --build-config Asan --output-on-failure --test-dir .build

src/Beman/Optional26/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
# cmake-format: on
55

6-
add_library(beman_optional26 STATIC
7-
optional.cpp
8-
detail/iterator.cpp
9-
)
6+
add_library(beman_optional26 STATIC optional.cpp detail/iterator.cpp)
107

118
include(GNUInstallDirs)
129
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
@@ -21,17 +18,15 @@ target_include_directories(
2118
install(
2219
TARGETS beman_optional26
2320
EXPORT ${TARGETS_EXPORT_NAME}
24-
DESTINATION ${CMAKE_INSTALL_LIBDIR}
25-
)
21+
DESTINATION ${CMAKE_INSTALL_LIBDIR})
2622

2723
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_LOWER_PROJECT_NAME)
2824

2925
install(
3026
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
3127
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}
3228
FILES_MATCHING
33-
PATTERN "*.hpp"
34-
)
29+
PATTERN "*.hpp")
3530

3631
target_link_libraries(beman_optional26)
3732

src/Beman/Optional26/tests/CMakeLists.txt

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,17 @@
66
include(GoogleTest)
77

88
# Tests
9-
add_executable(beman_optional26_test
10-
detail/iterator.t.cpp
11-
optional_monadic.t.cpp
12-
optional_range_support.t.cpp
13-
optional_ref_monadic.t.cpp
14-
optional_ref.t.cpp
15-
optional.t.cpp
16-
)
9+
add_executable(
10+
beman_optional26_test
11+
detail/iterator.t.cpp optional_monadic.t.cpp optional_range_support.t.cpp
12+
optional_ref_monadic.t.cpp optional_ref.t.cpp optional.t.cpp)
1713

18-
target_link_libraries(beman_optional26_test
19-
beman_optional26
20-
GTest::gtest
21-
GTest::gtest_main
22-
)
14+
target_link_libraries(beman_optional26_test beman_optional26 GTest::gtest
15+
GTest::gtest_main)
2316

24-
# Issue #32: Re-enable ASAN run CI/clang-19
25-
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some platforms.
26-
# Temporary switch to gtest_add_tests and skip some Asan checks. Change also applied for CI flows.
27-
gtest_add_tests(TARGET beman_optional26_test
28-
""
29-
AUTO
30-
)
17+
# Issue #32: Re-enable ASAN run CI/clang-19.
18+
#
19+
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some
20+
# platforms. Temporary switch to gtest_add_tests and skip some Asan checks.
21+
# Change also applied for CI flows.
22+
gtest_add_tests(TARGET beman_optional26_test "" AUTO)

0 commit comments

Comments
 (0)