Skip to content

Commit 28111d4

Browse files
authored
Fix issues with Github actions and added new test builds (#162)
* Added Catch2WithMain dependency for tests * Renamed catch2/catch.hpp to catch2/catch_all.hpp * Removed all redundant defines for catch2 * Updated Github actions to user more recent versions of stuff * Updated Github actions to user more recent versions of stuff * Updated Ninja version * Added clang 14 * Added gcc 12 * Updated cmake version * Revert "Updated cmake version" This reverts commit 74f59ad. * Try using vsdev env properly * Don't use GCC 12 yet * Add MSVC 2022
1 parent de7a2b6 commit 28111d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+112
-99
lines changed

.github/workflows/skyr-url-ci.yml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: [ push, pull_request ]
55

66
env:
77
CMAKE_VERSION: 3.17.3
8-
NINJA_VERSION: 1.9.0
8+
NINJA_VERSION: 1.11.0
99

1010
jobs:
1111
build:
@@ -109,6 +109,22 @@ jobs:
109109
cxx_standard: 20,
110110
}
111111

112+
# Clang-14
113+
- {
114+
name: "Linux Clang 14 Debug (C++20)", artifact: "Linux.tar.xz",
115+
os: ubuntu-latest,
116+
build_type: Debug,
117+
cc: "clang-14", cxx: "clang++-14",
118+
cxx_standard: 20,
119+
}
120+
- {
121+
name: "Linux Clang 14 Release (C++20)", artifact: "Linux.tar.xz",
122+
os: ubuntu-latest,
123+
build_type: RelWithDebInfo,
124+
cc: "clang-14", cxx: "clang++-14",
125+
cxx_standard: 20,
126+
}
127+
112128
# AppleClang
113129
- {
114130
name: "macOS Clang Debug (C++17)", artifact: "macOS.tar.xz",
@@ -173,8 +189,27 @@ jobs:
173189
cxx_standard: 20,
174190
}
175191

192+
# MSVC 2022
193+
- {
194+
name: "Windows MSVC 2022 Debug (C++20)", artifact: "Windows-MSVC.tar.xz",
195+
os: windows-latest,
196+
build_type: Debug,
197+
cc: "cl", cxx: "cl",
198+
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
199+
cxx_standard: 20,
200+
}
201+
- {
202+
name: "Windows MSVC 2022 Release (C++20)", artifact: "Windows-MSVC.tar.xz",
203+
os: windows-latest,
204+
build_type: RelWithDebInfo,
205+
cc: "cl", cxx: "cl",
206+
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
207+
cxx_standard: 20,
208+
}
209+
176210
steps:
177-
- uses: actions/checkout@v1
211+
- uses: actions/checkout@master
212+
- uses: seanmiddleditch/gha-setup-vsdevenv@master
178213

179214
- name: Download Ninja and CMake
180215
id: cmake_and_ninja
@@ -243,6 +278,15 @@ jobs:
243278
sudo apt-get update
244279
sudo apt-get -y install g++-11
245280
281+
- name: Install GCC 12
282+
id: install_gcc_12
283+
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-12' )
284+
shell: bash
285+
working-directory: ${{ env.HOME }}
286+
run: |
287+
sudo apt-get update
288+
sudo apt-get -y install g++-12
289+
246290
- name: Install Clang 8
247291
id: install_clang_8
248292
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-8' )
@@ -282,6 +326,16 @@ jobs:
282326
chmod +x llvm.sh
283327
sudo ./llvm.sh 12
284328
329+
- name: Install Clang 14
330+
id: install_clang_14
331+
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-14' )
332+
shell: bash
333+
working-directory: ${{ env.HOME }}
334+
run: |
335+
wget https://apt.llvm.org/llvm.sh
336+
chmod +x llvm.sh
337+
sudo ./llvm.sh 14
338+
285339
- name: Install vcpkg (Linux)
286340
id: vcpkg_linux
287341
if: startsWith(matrix.config.os, 'ubuntu')
@@ -354,12 +408,18 @@ jobs:
354408
set(BUILD_V2 OFF)
355409
if ("${{ matrix.config.name }}" STREQUAL "Windows MSVC 2019 Debug (C++20)" OR
356410
"${{ matrix.config.name }}" STREQUAL "Windows MSVC 2019 Release (C++20)" OR
411+
"${{ matrix.config.name }}" STREQUAL "Windows MSVC 2022 Debug (C++20)" OR
412+
"${{ matrix.config.name }}" STREQUAL "Windows MSVC 2022 Release (C++20)" OR
357413
"${{ matrix.config.name }}" STREQUAL "Linux GCC 11 Debug (C++20)" OR
358414
"${{ matrix.config.name }}" STREQUAL "Linux GCC 11 Release (C++20)" OR
415+
"${{ matrix.config.name }}" STREQUAL "Linux GCC 12 Debug (C++20)" OR
416+
"${{ matrix.config.name }}" STREQUAL "Linux GCC 12 Release (C++20)" OR
359417
"${{ matrix.config.name }}" STREQUAL "Linux Clang 11 Debug (C++20)" OR
360418
"${{ matrix.config.name }}" STREQUAL "Linux Clang 11 Release (C++20)" OR
361419
"${{ matrix.config.name }}" STREQUAL "Linux Clang 12 Debug (C++20)" OR
362-
"${{ matrix.config.name }}" STREQUAL "Linux Clang 12 Release (C++20)"
420+
"${{ matrix.config.name }}" STREQUAL "Linux Clang 12 Release (C++20)" OR
421+
"${{ matrix.config.name }}" STREQUAL "Linux Clang 14 Debug (C++20)" OR
422+
"${{ matrix.config.name }}" STREQUAL "Linux Clang 14 Release (C++20)"
363423
)
364424
set(BUILD_V2 ON)
365425
endif()

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function(skyr_create_test file_name output_dir test_name version)
1010
PRIVATE
1111
skyr-url-${version}
1212
Catch2::Catch2
13+
Catch2::Catch2WithMain
1314
fmt::fmt
1415
)
1516
set_target_properties(

tests/v1/containers/static_vector_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include <memory>
7-
#define CATCH_CONFIG_MAIN
8-
#include <catch2/catch.hpp>
7+
#include <catch2/catch_all.hpp>
98
#include <skyr/v1/containers/static_vector.hpp>
109

1110

tests/v1/domain/domain_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include <string>
7-
#define CATCH_CONFIG_MAIN
8-
#include <catch2/catch.hpp>
7+
#include <catch2/catch_all.hpp>
98
#include <skyr/v1/domain/domain.hpp>
109
#include <skyr/v1/domain/errors.hpp>
1110

tests/v1/domain/idna_table_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/domain/idna.hpp>
98

109

tests/v1/domain/punycode_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include <string>
7-
#define CATCH_CONFIG_MAIN
8-
#include <catch2/catch.hpp>
7+
#include <catch2/catch_all.hpp>
98
#include <skyr/v1/domain/punycode.hpp>
109

1110

tests/v1/filesystem/filesystem_path_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/url.hpp>
98
#include <skyr/v1/filesystem/path.hpp>
109

tests/v1/json/json_query_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66

7-
#define CATCH_CONFIG_MAIN
8-
#include <catch2/catch.hpp>
7+
#include <catch2/catch_all.hpp>
98
#include <vector>
109
#include <skyr/v1/json/json.hpp>
1110

tests/v1/network/ipv4_address_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/network/ipv4_address.hpp>
98

109
TEST_CASE("ipv4 addresses", "[ipv4]") {

tests/v1/network/ipv6_address_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/network/ipv6_address.hpp>
98

109
TEST_CASE("ipv6_address_tests", "[ipv6]") {

tests/v1/percent_encoding/percent_decoding_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#define FMT_HEADER_ONLY
98
#include <fmt/format.h>
109
#include <skyr/v1/percent_encoding/percent_decode.hpp>

tests/v1/percent_encoding/percent_encoding_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#define FMT_HEADER_ONLY
98
#include <fmt/format.h>
109
#include <skyr/v1/percent_encoding/percent_encode.hpp>

tests/v1/unicode/byte_conversion_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include <string>
7-
#define CATCH_CONFIG_MAIN
8-
#include <catch2/catch.hpp>
7+
#include <catch2/catch_all.hpp>
98
#include <skyr/v1/unicode/details/to_u8.hpp>
109

1110
TEST_CASE("weird_01", "byte_conversion_tests") {

tests/v1/unicode/unicode_code_point_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
#include <iterator>
77
#include <string_view>
8-
#define CATCH_CONFIG_MAIN
9-
#include <catch2/catch.hpp>
8+
#include <catch2/catch_all.hpp>
109
#include <skyr/v1/unicode/code_point.hpp>
1110

1211

tests/v1/unicode/unicode_range_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
#include <iterator>
77
#include <string_view>
8-
#define CATCH_CONFIG_MAIN
9-
#include <catch2/catch.hpp>
8+
#include <catch2/catch_all.hpp>
109
#include <skyr/v1/unicode/ranges/transforms/u16_transform.hpp>
1110
#include <skyr/v1/unicode/ranges/transforms/u32_transform.hpp>
1211
#include <skyr/v1/unicode/ranges/transforms/u8_transform.hpp>

tests/v1/unicode/unicode_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/unicode/ranges/transforms/u16_transform.hpp>
98
#include <skyr/v1/unicode/ranges/transforms/u32_transform.hpp>
109
#include <skyr/v1/unicode/ranges/transforms/u8_transform.hpp>

tests/v1/url/parse_host_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
#include <string_view>
77
#include <variant>
8-
#define CATCH_CONFIG_MAIN
9-
#include <catch2/catch.hpp>
8+
#include <catch2/catch_all.hpp>
109
#include <skyr/v1/core/host.hpp>
1110

1211
TEST_CASE("parse_host_tests", "url.parse_host") {

tests/v1/url/url_literal_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
#include <algorithm>
77
#include <memory>
8-
#define CATCH_CONFIG_MAIN
9-
#include <catch2/catch.hpp>
8+
#include <catch2/catch_all.hpp>
109
#include <skyr/v1/url.hpp>
1110

1211
using namespace skyr::literals;

tests/v1/url/url_parse_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/core/parse.hpp>
98
#include <skyr/v1/core/serialize.hpp>
109

tests/v1/url/url_search_parameters_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/url.hpp>
98
#include <skyr/v1/url_search_parameters.hpp>
109

tests/v1/url/url_serialize_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/core/parse.hpp>
98
#include <skyr/v1/core/serialize.hpp>
109

tests/v1/url/url_setter_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v1/url.hpp>
98

109
TEST_CASE("url_setter_tests", "[url]") {

tests/v1/url/url_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include <algorithm>
99
#include <memory>
10-
#define CATCH_CONFIG_MAIN
11-
#include <catch2/catch.hpp>
10+
#include <catch2/catch_all.hpp>
1211
#include <skyr/v1/url.hpp>
1312

1413
TEST_CASE("url_tests", "[url]") {

tests/v1/url/url_tests_with_exceptions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include <algorithm>
99
#include <memory>
10-
#define CATCH_CONFIG_MAIN
11-
#include <catch2/catch.hpp>
10+
#include <catch2/catch_all.hpp>
1211
#include <skyr/v1/url.hpp>
1312

1413
TEST_CASE("url_tests", "[url]") {

tests/v1/url/url_vector_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include <vector>
7-
#define CATCH_CONFIG_MAIN
8-
#include <catch2/catch.hpp>
7+
#include <catch2/catch_all.hpp>
98
#include <skyr/v1/url.hpp>
109

1110
TEST_CASE("url_vector_tests", "[url]") {

tests/v2/containers/static_vector_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include <memory>
7-
#define CATCH_CONFIG_MAIN
8-
#include <catch2/catch.hpp>
7+
#include <catch2/catch_all.hpp>
98
#include <skyr/v2/containers/static_vector.hpp>
109

1110

tests/v2/core/parse_host_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
#include <string_view>
77
#include <variant>
8-
#define CATCH_CONFIG_MAIN
9-
#include <catch2/catch.hpp>
8+
#include <catch2/catch_all.hpp>
109
#include <skyr/v2/core/host.hpp>
1110

1211
TEST_CASE("parse_host_tests", "url.parse_host") {

tests/v2/core/parse_path_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v2/core/parse_path.hpp>
98

109
TEST_CASE("path_parsing_example_tests", "[parse]") {

tests/v2/core/parse_query_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// (See accompanying file LICENSE_1_0.txt of copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#define CATCH_CONFIG_MAIN
7-
#include <catch2/catch.hpp>
6+
#include <catch2/catch_all.hpp>
87
#include <skyr/v2/core/parse_query.hpp>
98

109
TEST_CASE("query_parsing_example_tests", "[parse]") {

0 commit comments

Comments
 (0)