Skip to content

Commit

Permalink
fix codecvt error on macos, modify ci.yml to support serial execution
Browse files Browse the repository at this point in the history
  • Loading branch information
zhllxt committed Jul 31, 2023
1 parent 0a18c3b commit 6dd493d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
## cpp17 ----------------------------------------------------------------------------------------

windows-cpp17:
name: windows-cpp17
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
Expand All @@ -42,6 +43,8 @@ jobs:
run: ctest -C ${{env.BUILD_TYPE_RELEASE}} --test-dir ${{github.workspace}}/build --output-on-failure

ubuntu-cpp17:
name: ubuntu-cpp17
needs: windows-cpp17
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
Expand All @@ -66,6 +69,8 @@ jobs:
run: ctest -C ${{env.BUILD_TYPE_RELEASE}} --test-dir ${{github.workspace}}/build --output-on-failure

macos-cpp17:
name: macos-cpp17
needs: ubuntu-cpp17
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
Expand All @@ -92,6 +97,8 @@ jobs:
## cpp20 ----------------------------------------------------------------------------------------

windows-cpp20:
name: windows-cpp20
needs: macos-cpp17
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
Expand All @@ -116,6 +123,8 @@ jobs:
run: ctest -C ${{env.BUILD_TYPE_RELEASE}} --test-dir ${{github.workspace}}/build --output-on-failure

ubuntu-cpp20:
name: ubuntu-cpp20
needs: windows-cpp20
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
Expand All @@ -140,6 +149,8 @@ jobs:
run: ctest -C ${{env.BUILD_TYPE_RELEASE}} --test-dir ${{github.workspace}}/build --output-on-failure

macos-cpp20:
name: macos-cpp20
needs: ubuntu-cpp20
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
Expand Down
13 changes: 11 additions & 2 deletions test/unit/codecvt.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "unit_test.hpp"

#include <asio2/base/detail/push_options.hpp>
#include <asio2/external/predef.h>
#include <asio2/util/string.hpp>
#include <asio2/base/detail/util.hpp>
#include <asio2/util/codecvt.hpp>
#include <sstream>
#include <fstream>
#include <asio2/base/detail/filesystem.hpp>
Expand All @@ -15,6 +15,15 @@ std::string ensure_char_pointer_valid(const char* p)
return {};
}

// https://github.com/llvm/llvm-project/issues/56655
// clang maybe don't have the std::codecvt, github actions with macos-latest has this problem.

#if BHO_COMP_CLANG
void codecvt_test()
{
}
#else
#include <asio2/util/codecvt.hpp>
void codecvt_test()
{
#if defined(__cpp_lib_char8_t)
Expand Down Expand Up @@ -413,7 +422,7 @@ void codecvt_test()

//ASIO2_TEST_END_LOOP;
}

#endif

ASIO2_TEST_SUITE
(
Expand Down

0 comments on commit 6dd493d

Please sign in to comment.