Skip to content

Commit

Permalink
add gcc-11...gcc-13
Browse files Browse the repository at this point in the history
* tweak noexcept constructors in tests due to a regression in GCC 11+
* tweak test build failures
* enable CI steps
* bump GTest to 1.14
  • Loading branch information
janondrusek committed Oct 20, 2023
1 parent c2fd16a commit 7d5d64a
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 20 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/libunifex-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions cmake/CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
12 changes: 6 additions & 6 deletions examples/linux/io_epoll_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename S>
auto discard_value(S&& s) {
return then((S&&)s, [](auto&&...) noexcept {});
}

//! Seconds to warmup the benchmark
static constexpr int WARMUP_DURATION = 3;
Expand Down Expand Up @@ -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;
});
Expand All @@ -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();})
Expand Down
5 changes: 2 additions & 3 deletions test/async_scope_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,8 @@ TEST_F(async_scope_test, attach_connect) {
}

TEST_F(async_scope_test, attach_copy) {
mock_receiver<void()> 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;

Expand Down
8 changes: 4 additions & 4 deletions test/async_scope_v2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ template <bool ThrowOnCopy, bool ThrowOnMove>
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;

Expand Down Expand Up @@ -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;
};

Expand Down
4 changes: 2 additions & 2 deletions test/nest_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7d5d64a

Please sign in to comment.