Skip to content

Commit

Permalink
More CI fixing, mainly working around C++ parse bugs in older MSVCs b…
Browse files Browse the repository at this point in the history
…eing tested by the CI.
  • Loading branch information
ned14 committed Apr 17, 2022
1 parent ceeaddb commit 2e6ec8e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/installability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
shell: bash
run: |
git config --global core.longpaths true
sudo apt-get remove -y libssl-dev
sudo apt-get autoremove
if [ "${{ matrix.configuration }}" = "status_code" ]; then
export CMAKE_CONFIGURE_OPTIONS="-DLLFIO_FORCE_OPENSSL_OFF=ON -DLLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON"
else
export CMAKE_CONFIGURE_OPTIONS="-DLLFIO_FORCE_OPENSSL_OFF=ON"
export CMAKE_CONFIGURE_OPTIONS="-DLLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON"
fi
git clone --depth 1 https://github.com/ned14/quickcpplib.git
pip install --user gitpython
Expand Down
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,19 @@ if(NOT PROJECT_IS_DEPENDENCY)
set(LATEST_CXX_FEATURE)
foreach(feature ${CMAKE_CXX_COMPILE_FEATURES})
if(feature STREQUAL "cxx_std_23")
set(LATEST_CXX_FEATURE "cxx_std_23")
indented_message(STATUS "NOTE: This compiler claims to support C++ 23, enabling for header-only unit test suite")
if(NOT MSVC OR MSVC_VERSION VERSION_GREATER_EQUAL 1930)
set(LATEST_CXX_FEATURE "cxx_std_23")
indented_message(STATUS "NOTE: This compiler claims to support C++ 23, enabling for header-only unit test suite")
endif()
endif()
endforeach()
if(NOT LATEST_CXX_FEATURE)
foreach(feature ${CMAKE_CXX_COMPILE_FEATURES})
if(feature STREQUAL "cxx_std_20")
set(LATEST_CXX_FEATURE "cxx_std_20")
indented_message(STATUS "NOTE: This compiler claims to support C++ 20, enabling for header-only unit test suite")
if(NOT MSVC OR MSVC_VERSION VERSION_GREATER_EQUAL 1930)
set(LATEST_CXX_FEATURE "cxx_std_20")
indented_message(STATUS "NOTE: This compiler claims to support C++ 20, enabling for header-only unit test suite")
endif()
endif()
endforeach()
endif()
Expand Down
6 changes: 3 additions & 3 deletions include/llfio/revision.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define LLFIO_PREVIOUS_COMMIT_REF 621d1a7907e51ff06a52462a85d4bc8702bc1acb
#define LLFIO_PREVIOUS_COMMIT_DATE "2022-04-16 21:39:20 +00:00"
#define LLFIO_PREVIOUS_COMMIT_UNIQUE 621d1a79
#define LLFIO_PREVIOUS_COMMIT_REF ceeaddba4c571291d42690a54424e8bf8cf4d5dd
#define LLFIO_PREVIOUS_COMMIT_DATE "2022-04-16 23:05:51 +00:00"
#define LLFIO_PREVIOUS_COMMIT_UNIQUE ceeaddba
4 changes: 2 additions & 2 deletions test/tests/byte_socket_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,8 @@ static inline void TestCoroutinedSocketHandles()
}
};
auto serversocket =
llfio::listening_byte_socket_handle::listening_socket(llfio::ip::family::v4, llfio::listening_byte_socket_handle::mode::write,
llfio::byte_socket_handle::caching::all, llfio::byte_socket_handle::flag::multiplexable)
llfio::listening_byte_socket_handle::listening_byte_socket(llfio::ip::family::v4, llfio::listening_byte_socket_handle::mode::write,
llfio::byte_socket_handle::caching::all, llfio::byte_socket_handle::flag::multiplexable)
.value();
serversocket.bind(llfio::ip::address_v4::loopback()).value();
auto endpoint = serversocket.local_endpoint().value();
Expand Down
30 changes: 17 additions & 13 deletions test/tests/tls_socket_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,11 @@ static inline void TestBlockingTLSSocketHandles()
runtest(tls_socket_source->wrap(&rawserversocket).value(), tls_socket_source->wrap(&rawwriter).value());
}

static inline void TestNonBlockingTLSSocketHandles()
struct TestNonBlockingTLSSocketHandlesRunTest
{
namespace llfio = LLFIO_V2_NAMESPACE;
if(llfio::tls_socket_source_registry::empty())
{
std::cout << "\nNOTE: This platform has no TLS socket sources in its registry, skipping this test." << std::endl;
return;
}
auto tls_socket_source = llfio::tls_socket_source_registry::default_source().instantiate().value();
auto runtest = [](llfio::listening_tls_socket_handle_ptr serversocket, auto &&make_writer)
template <class F> TestNonBlockingTLSSocketHandlesRunTest(LLFIO_V2_NAMESPACE::listening_tls_socket_handle_ptr serversocket, F &&make_writer)
{
namespace llfio = LLFIO_V2_NAMESPACE;
BOOST_REQUIRE(serversocket->is_valid());
BOOST_CHECK(serversocket->is_socket());
BOOST_CHECK(serversocket->is_readable());
Expand Down Expand Up @@ -262,15 +256,25 @@ static inline void TestNonBlockingTLSSocketHandles()
BOOST_REQUIRE(!connected);
writer->close().value();
reader.first->close().value();
};
}
};
static inline void TestNonBlockingTLSSocketHandles()
{
namespace llfio = LLFIO_V2_NAMESPACE;
if(llfio::tls_socket_source_registry::empty())
{
std::cout << "\nNOTE: This platform has no TLS socket sources in its registry, skipping this test." << std::endl;
return;
}
auto tls_socket_source = llfio::tls_socket_source_registry::default_source().instantiate().value();
std::cout << "\nUnwrapped TLS socket:\n" << std::endl;
runtest(tls_socket_source->multiplexable_listening_socket(llfio::ip::family::v4).value(),
[&] { return tls_socket_source->multiplexable_connecting_socket(llfio::ip::family::v4).value(); });
TestNonBlockingTLSSocketHandlesRunTest(tls_socket_source->multiplexable_listening_socket(llfio::ip::family::v4).value(),
[&] { return tls_socket_source->multiplexable_connecting_socket(llfio::ip::family::v4).value(); });

std::cout << "\nWrapped TLS socket:\n" << std::endl;
auto rawserversocket = llfio::listening_byte_socket_handle::multiplexable_listening_byte_socket(llfio::ip::family::v4).value();
auto rawwriter = llfio::byte_socket_handle::multiplexable_byte_socket(llfio::ip::family::v4).value();
runtest(tls_socket_source->wrap(&rawserversocket).value(), [&] { return tls_socket_source->wrap(&rawwriter).value(); });
TestNonBlockingTLSSocketHandlesRunTest(tls_socket_source->wrap(&rawserversocket).value(), [&] { return tls_socket_source->wrap(&rawwriter).value(); });
}

/* This test makes the assumption that the host OS is able to validate github.com's
Expand Down

0 comments on commit 2e6ec8e

Please sign in to comment.