Skip to content

Commit

Permalink
Run linters
Browse files Browse the repository at this point in the history
  • Loading branch information
neatudarius committed Jul 17, 2024
1 parent 5f91708 commit e72636e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 48 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(BUILD_TESTING)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
)
FetchContent_MakeAvailable(googletest)
endif()
Expand Down
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,23 @@ This repository implements `std::optional` extensions targeting C++26. The `Bema
* [Give *std::optional* Range Support (P3168R2)](https://wg21.link/P3168R2)
* [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)


## Table of Contents

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

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

## License

Expand Down Expand Up @@ -212,7 +210,7 @@ $ cmake -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo;Asan
# Build.
$ cmake --build .build --config Asan --target all -- -k 0
...
[30/30] Linking CXX executable ...
[30/30] Linking CXX executable ... # Note: 30 targets here (including tests).

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

# Check that tests are not built/installed.
$ ctest --build-config Asan --output-on-failure --test-dir .build
Expand Down
11 changes: 3 additions & 8 deletions src/Beman/Optional26/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

add_library(beman_optional26 STATIC
optional.cpp
detail/iterator.cpp
)
add_library(beman_optional26 STATIC optional.cpp detail/iterator.cpp)

include(GNUInstallDirs)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
Expand All @@ -21,17 +18,15 @@ target_include_directories(
install(
TARGETS beman_optional26
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
DESTINATION ${CMAKE_INSTALL_LIBDIR})

string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_LOWER_PROJECT_NAME)

install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}
FILES_MATCHING
PATTERN "*.hpp"
)
PATTERN "*.hpp")

target_link_libraries(beman_optional26)

Expand Down
32 changes: 12 additions & 20 deletions src/Beman/Optional26/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,17 @@
include(GoogleTest)

# Tests
add_executable(beman_optional26_test
detail/iterator.t.cpp
optional_monadic.t.cpp
optional_range_support.t.cpp
optional_ref_monadic.t.cpp
optional_ref.t.cpp
optional.t.cpp
)
add_executable(
beman_optional26_test
detail/iterator.t.cpp optional_monadic.t.cpp optional_range_support.t.cpp
optional_ref_monadic.t.cpp optional_ref.t.cpp optional.t.cpp)

target_link_libraries(beman_optional26_test
beman_optional26
GTest::gtest
GTest::gtest_main
)
target_link_libraries(beman_optional26_test beman_optional26 GTest::gtest
GTest::gtest_main)

# Issue #32: Re-enable ASAN run CI/clang-19
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some platforms.
# Temporary switch to gtest_add_tests and skip some Asan checks. Change also applied for CI flows.
gtest_add_tests(TARGET beman_optional26_test
""
AUTO
)
# Issue #32: Re-enable ASAN run CI/clang-19.
#
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some
# platforms. Temporary switch to gtest_add_tests and skip some Asan checks.
# Change also applied for CI flows.
gtest_add_tests(TARGET beman_optional26_test "" AUTO)

0 comments on commit e72636e

Please sign in to comment.