Skip to content

Commit

Permalink
[INFRA] Update clang CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Nov 16, 2023
1 parent f1b03ab commit f35d118
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
compiler: "clang-17"
build: unit
build_type: Release
cxx_flags: "-stdlib=libc++"

- name: "gcc13"
compiler: "gcc-13"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
fail-fast: true
matrix:
include:
- name: "clang17"
compiler: "clang-17"
build: unit
build_type: Release

- name: "gcc13"
compiler: "gcc-13"
build: unit
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/ci_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,39 @@ jobs:
fail-fast: false
matrix:
include:
- name: "Snippet clang17"
compiler: "clang-17"
build: snippet
build_type: Release
use_include_dependencies: "OFF"
cxx_flags: "-stdlib=libc++"

- name: "Snippet gcc11"
compiler: "gcc-11"
build: snippet
build_type: Release
use_include_dependencies: "OFF"

- name: "Performance clang17"
compiler: "clang-17"
build: performance
build_type: Release
use_include_dependencies: "OFF"
cxx_flags: "-stdlib=libc++"

- name: "Performance gcc11"
compiler: "gcc-11"
build: performance
build_type: Release
use_include_dependencies: "OFF"

- name: "Header clang17"
compiler: "clang-17"
build: header
build_type: Release
use_include_dependencies: "OFF"
cxx_flags: "-stdlib=libc++"

- name: "Header gcc13"
compiler: "gcc-13"
build: header
Expand Down Expand Up @@ -87,6 +108,7 @@ jobs:
mkdir build
cd build
cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DHIBF_NATIVE_BUILD=OFF \
-DHIBF_VERBOSE_TESTS=OFF \
-DHIBF_USE_INCLUDE_DEPENDENCIES="${{ matrix.use_include_dependencies }}"
Expand Down
5 changes: 4 additions & 1 deletion test/header/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ macro (hibf_header_test component header_base_path exclude_regex)
"${CMAKE_CURRENT_SOURCE_DIR}/generate_header_source.cmake")

add_library (${header_target} OBJECT "${header_target_source}")
target_link_libraries (${header_target} hibf::test::header)
# Link hibf::test first, even though it is also linked by hibf::test:header.
# Without this, the compile options of hibf::test are appended, e.g.,
# `-Wno-error=... -Werror -Wall`, instead of `-Werror -Wall -Wno-error=...`
target_link_libraries (${header_target} hibf::test hibf::test::header)
target_sources (${target} PRIVATE $<TARGET_OBJECTS:${header_target}>)
endforeach ()
endforeach ()
Expand Down
1 change: 1 addition & 0 deletions test/hibf-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if (NOT TARGET hibf::test::header)
add_library (hibf_test_header INTERFACE)
target_link_libraries (hibf_test_header INTERFACE "hibf::test::unit")
target_link_libraries (hibf_test_header INTERFACE "hibf::test::performance")
target_compile_options (hibf_test_header INTERFACE "-Wno-unused-function")
target_compile_definitions (hibf_test_header INTERFACE -DHIBF_DISABLE_DEPRECATED_WARNINGS)
target_compile_definitions (hibf_test_header INTERFACE -DHIBF_HEADER_TEST)
add_library (hibf::test::header ALIAS hibf_test_header)
Expand Down
4 changes: 4 additions & 0 deletions test/unit/hibf/sketch/toolbox_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ TEST_F(toolbox_test, random_shuffle)
seqan::hibf::sketch::toolbox::random_shuffle(dist, ids);

// since randomness is seeded, the output is deterministic
#ifdef _LIBCPP_VERSION
auto [new_pos_0, new_pos_1, new_pos_2, new_pos_3, new_pos_4] = std::make_tuple(0u, 4u, 2u, 1u, 3u);
#else
auto [new_pos_0, new_pos_1, new_pos_2, new_pos_3, new_pos_4] = std::make_tuple(3u, 2u, 1u, 0u, 4u);
#endif

EXPECT_EQ(ids[0], new_pos_0);
EXPECT_EQ(ids[1], new_pos_1);
Expand Down
8 changes: 8 additions & 0 deletions test/unit/test/expect_same_type_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,19 @@ TEST(tuple, same_type_pass)

TEST(tuple, same_type_fail)
{
#ifdef _LIBCPP_VERSION
char const * error_message = "Expected equality of these values:\n"
" decltype(std::tuple{0, .0f, .0, 0u})\n"
" Which is: \"std::__1::tuple<int, float, double, unsigned int>\"\n"
" std::tuple<int, float, unsigned, double>\n"
" Which is: \"std::__1::tuple<int, float, unsigned int, double>\"";
#else
char const * error_message = "Expected equality of these values:\n"
" decltype(std::tuple{0, .0f, .0, 0u})\n"
" Which is: \"std::tuple<int, float, double, unsigned int>\"\n"
" std::tuple<int, float, unsigned, double>\n"
" Which is: \"std::tuple<int, float, unsigned int, double>\"";
#endif

auto && expect_result =
seqan::hibf::test::expect_same_type{}("std::type_identity< decltype(std::tuple{0, .0f, .0, 0u})>{}",
Expand Down

0 comments on commit f35d118

Please sign in to comment.