diff --git a/.github/workflows/libunifex-ci.yml b/.github/workflows/libunifex-ci.yml index c195636b6..bdade946f 100644 --- a/.github/workflows/libunifex-ci.yml +++ b/.github/workflows/libunifex-ci.yml @@ -92,6 +92,96 @@ jobs: cc: "gcc-10", cxx: "g++-10", cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20 -D CMAKE_CXX_FLAGS:STRING=-fcoroutines" } + - { + name: "Linux GCC 11 Debug (C++17)", artifact: "Linux.tar.xz", + os: ubuntu-20.04, + io_sys: io_uring, + build_type: Debug, + cc: "gcc-11", cxx: "g++-11" + } + - { + name: "Linux GCC 11 Optimised (C++17)", artifact: "Linux.tar.xz", + os: ubuntu-20.04, + io_sys: io_uring, + build_type: RelWithDebInfo, + cc: "gcc-11", cxx: "g++-11" + } + - { + name: "Linux GCC 11 Debug (C++20)", artifact: "Linux.tar.xz", + os: ubuntu-20.04, + io_sys: io_uring, + build_type: Debug, + cc: "gcc-11", cxx: "g++-11", + cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20" + } + - { + name: "Linux GCC 11 Optimised (C++20)", artifact: "Linux.tar.xz", + os: ubuntu-20.04, + io_sys: io_uring, + build_type: RelWithDebInfo, + cc: "gcc-11", cxx: "g++-11", + cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20" + } + - { + name: "Linux GCC 12 Debug (C++17)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: Debug, + cc: "gcc-12", cxx: "g++-12" + } + - { + name: "Linux GCC 12 Optimised (C++17)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: RelWithDebInfo, + cc: "gcc-12", cxx: "g++-12" + } + - { + name: "Linux GCC 12 Debug (C++20)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: Debug, + cc: "gcc-12", cxx: "g++-12", + cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20" + } + - { + name: "Linux GCC 12 Optimised (C++20)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: RelWithDebInfo, + cc: "gcc-12", cxx: "g++-12", + cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20" + } + - { + name: "Linux GCC 13 Debug (C++17)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: Debug, + cc: "gcc-13", cxx: "g++-13" + } + - { + name: "Linux GCC 13 Optimised (C++17)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: RelWithDebInfo, + cc: "gcc-13", cxx: "g++-13" + } + - { + name: "Linux GCC 13 Debug (C++20)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: Debug, + cc: "gcc-13", cxx: "g++-13", + cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20" + } + - { + name: "Linux GCC 13 Optimised (C++20)", artifact: "Linux.tar.xz", + os: ubuntu-22.04, + io_sys: io_uring, + build_type: RelWithDebInfo, + cc: "gcc-13", cxx: "g++-13", + cmake_args: "-D CMAKE_CXX_STANDARD:STRING=20" + } - { name: "Linux Clang 10 Debug (C++17)", artifact: "Linux.tar.xz", os: ubuntu-20.04, @@ -519,6 +609,35 @@ jobs: wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 16 + - name: Install GCC 11 + id: install_gcc_11 + if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-11' ) + shell: bash + working-directory: ${{ env.HOME }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y + sudo apt update + sudo apt install g++-11 gcc-11 + + - name: Install GCC 12 + id: install_gcc_12 + if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-12' ) + shell: bash + working-directory: ${{ env.HOME }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y + sudo apt update + sudo apt install g++-12 gcc-12 + + - name: Install GCC 13 + id: install_gcc_13 + if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-13' ) + shell: bash + working-directory: ${{ env.HOME }} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y + sudo apt update + sudo apt install g++-13 gcc-13 - name: Install liburing id: install_liburing diff --git a/cmake/CMakeLists.txt.in b/cmake/CMakeLists.txt.in index e4dae8034..8028fe297 100644 --- a/cmake/CMakeLists.txt.in +++ b/cmake/CMakeLists.txt.in @@ -10,11 +10,7 @@ project(googletest-download NONE) include(ExternalProject) ExternalProject_Add(googletest GIT_REPOSITORY https://github.com/google/googletest.git - # This is a commit after release-1.10.0 for which - # gmock understands noexcept function qualifiers - # and for which usage of std::result_of has been - # discontinued. - GIT_TAG aa9b44a18678dfdf57089a5ac22c1edb69f35da5 + GIT_TAG v1.14.0 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build" CONFIGURE_COMMAND "" diff --git a/examples/linux/io_epoll_test.cpp b/examples/linux/io_epoll_test.cpp index e40466ef3..9335fc82e 100644 --- a/examples/linux/io_epoll_test.cpp +++ b/examples/linux/io_epoll_test.cpp @@ -52,9 +52,10 @@ using namespace unifex; using namespace unifex::linuxos; using namespace std::chrono_literals; -inline constexpr auto sink = [](auto&&...){}; - -inline constexpr auto discard = then(sink); +template +auto discard_value(S&& s) { + return then((S&&)s, [](auto&&...) noexcept {}); +} //! Seconds to warmup the benchmark static constexpr int WARMUP_DURATION = 3; @@ -107,8 +108,7 @@ int main() { return // do read: async_read_some(rPipeRef, as_writable_bytes(span{buffer.data() + 0, 1})) - | discard - | then([&] { + | then([&](auto&&...) { UNIFEX_ASSERT(data[(reps + offset) % sizeof(data)] == buffer[0]); ++reps; }); @@ -128,7 +128,7 @@ int main() { // write the data to one end of the pipe sequence( just_from([&]{ printf("writes starting!\n"); }), - defer([&, databuffer] { return discard(async_write_some(wPipeRef, databuffer)); }) + defer([&, databuffer] { return discard_value(async_write_some(wPipeRef, databuffer)); }) | via(scheduler) | repeat_effect() | let_done([]{return just();}) diff --git a/test/async_scope_test.cpp b/test/async_scope_test.cpp index 3877dfdb8..fd35e9ecc 100644 --- a/test/async_scope_test.cpp +++ b/test/async_scope_test.cpp @@ -383,9 +383,8 @@ TEST_F(async_scope_test, attach_connect) { } TEST_F(async_scope_test, attach_copy) { - mock_receiver receiver; - EXPECT_CALL(*receiver, set_value()).Times(2); - auto sender1 = scope.attach(just()); + auto receiver = UnstoppableSimpleIntReceiver{}; + auto sender1 = scope.attach(just(42)); // both senders are attached auto sender2 = sender1; diff --git a/test/async_scope_v2_test.cpp b/test/async_scope_v2_test.cpp index a52c157d6..73a83f99c 100644 --- a/test/async_scope_v2_test.cpp +++ b/test/async_scope_v2_test.cpp @@ -50,9 +50,9 @@ template struct custom_receiver final { custom_receiver() noexcept = default; - custom_receiver(const custom_receiver&) noexcept(!ThrowOnCopy) = default; + custom_receiver(const custom_receiver&) noexcept(!ThrowOnCopy) {} - custom_receiver(custom_receiver&&) noexcept(!ThrowOnMove) = default; + custom_receiver(custom_receiver&&) noexcept(!ThrowOnMove) {} ~custom_receiver() = default; @@ -235,8 +235,8 @@ TEST_F( nest_of_just_of_newtype_has_expected_static_properties) { struct newtype { newtype() = default; - newtype(const newtype&) noexcept(false) = default; - newtype(newtype&&) noexcept(false) = default; + newtype(const newtype&) noexcept(false) {} + newtype(newtype&&) noexcept(false) {} ~newtype() = default; }; diff --git a/test/nest_test.cpp b/test/nest_test.cpp index 9db459668..4c7ae2551 100644 --- a/test/nest_test.cpp +++ b/test/nest_test.cpp @@ -149,9 +149,9 @@ struct throwing_sender final { static constexpr bool sends_done = false; - throwing_sender() noexcept(false) = default; + throwing_sender() noexcept(false) {} - throwing_sender(const throwing_sender&) noexcept(false) = default; + throwing_sender(const throwing_sender&) noexcept(false) {} ~throwing_sender() = default;