Skip to content

Commit a8f938a

Browse files
committed
fix windows ci
1 parent 28cd3b8 commit a8f938a

6 files changed

Lines changed: 70 additions & 41 deletions

File tree

.github/workflows/linux.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ on:
1111

1212
jobs:
1313
linux:
14-
name: Ubuntu
14+
name: Ubuntu (${{ matrix.label }})
1515
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- label: TBB ON
21+
qdata_use_tbb: "ON"
22+
- label: TBB OFF
23+
qdata_use_tbb: "OFF"
1624

1725
defaults:
1826
run:
@@ -46,11 +54,12 @@ jobs:
4654
Rscript --version
4755
4856
- name: Configure
49-
run: >
50-
cmake -S . -B build -G Ninja
51-
-DQDATA_BUILD_BENCHMARKS=ON
52-
-DQDATA_BUILD_EXAMPLES=ON
53-
-DQDATA_BUILD_TESTS=ON
57+
run: |
58+
cmake -S . -B build -G Ninja \
59+
-DQDATA_USE_TBB=${{ matrix.qdata_use_tbb }} \
60+
-DQDATA_BUILD_BENCHMARKS=ON \
61+
-DQDATA_BUILD_EXAMPLES=ON \
62+
-DQDATA_BUILD_TESTS=ON
5463
5564
- name: Build
5665
run: cmake --build build --parallel

.github/workflows/macos.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ on:
1111

1212
jobs:
1313
macos:
14-
name: macOS
14+
name: macOS (${{ matrix.label }})
1515
runs-on: macos-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- label: TBB ON
21+
qdata_use_tbb: "ON"
22+
- label: TBB OFF
23+
qdata_use_tbb: "OFF"
1624

1725
defaults:
1826
run:
@@ -51,11 +59,12 @@ jobs:
5159
Rscript --version
5260
5361
- name: Configure
54-
run: >
55-
cmake -S . -B build -G Ninja
56-
-DQDATA_BUILD_BENCHMARKS=ON
57-
-DQDATA_BUILD_EXAMPLES=ON
58-
-DQDATA_BUILD_TESTS=ON
62+
run: |
63+
cmake -S . -B build -G Ninja \
64+
-DQDATA_USE_TBB=${{ matrix.qdata_use_tbb }} \
65+
-DQDATA_BUILD_BENCHMARKS=ON \
66+
-DQDATA_BUILD_EXAMPLES=ON \
67+
-DQDATA_BUILD_TESTS=ON
5968
6069
- name: Build
6170
run: cmake --build build --parallel

.github/workflows/windows.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ on:
1111

1212
jobs:
1313
windows:
14-
name: Windows
14+
name: Windows (${{ matrix.label }})
1515
runs-on: windows-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- label: TBB ON
21+
qdata_use_tbb: "ON"
22+
- label: TBB OFF
23+
qdata_use_tbb: "OFF"
1624

1725
defaults:
1826
run:
@@ -36,7 +44,7 @@ jobs:
3644
& "$env:RUNNER_TEMP\vcpkg\bootstrap-vcpkg.bat"
3745
& "$env:RUNNER_TEMP\vcpkg\vcpkg.exe" install zstd tbb --triplet x64-windows
3846
"VCPKG_ROOT=$env:RUNNER_TEMP\vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
39-
"PATH=$env:RUNNER_TEMP\vcpkg\installed\x64-windows\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
47+
"PATH=$env:RUNNER_TEMP\vcpkg\installed\x64-windows\bin;$env:RUNNER_TEMP\vcpkg\installed\x64-windows\debug\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4048
4149
- name: Install R test packages
4250
run: |
@@ -52,15 +60,17 @@ jobs:
5260
Rscript --version
5361
5462
- name: Configure
55-
run: >
56-
cmake -S . -B build -G Ninja
57-
-DCMAKE_C_COMPILER=cl
58-
-DCMAKE_CXX_COMPILER=cl
59-
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake"
60-
-DVCPKG_TARGET_TRIPLET=x64-windows
61-
-DQDATA_BUILD_BENCHMARKS=ON
62-
-DQDATA_BUILD_EXAMPLES=ON
63-
-DQDATA_BUILD_TESTS=ON
63+
run: |
64+
cmake -S . -B build -G Ninja `
65+
-DCMAKE_BUILD_TYPE=Release `
66+
-DCMAKE_C_COMPILER=cl `
67+
-DCMAKE_CXX_COMPILER=cl `
68+
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" `
69+
-DVCPKG_TARGET_TRIPLET=x64-windows `
70+
-DQDATA_USE_TBB=${{ matrix.qdata_use_tbb }} `
71+
-DQDATA_BUILD_BENCHMARKS=ON `
72+
-DQDATA_BUILD_EXAMPLES=ON `
73+
-DQDATA_BUILD_TESTS=ON
6474
6575
- name: Build
6676
run: cmake --build build --parallel

CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,7 @@ if(QDATA_BUILD_TESTS)
9393
target_compile_features(qdata_buffer_api PRIVATE cxx_std_17)
9494
target_link_libraries(qdata_buffer_api PRIVATE qdata)
9595
add_test(NAME qdata_buffer_api COMMAND qdata_buffer_api)
96-
97-
if(QDATA_TBB_TARGET)
98-
add_executable(qdata_odr_headers tests/cpp/odr_headers.cpp)
99-
target_compile_features(qdata_odr_headers PRIVATE cxx_std_17)
100-
target_link_libraries(qdata_odr_headers PRIVATE qdata)
101-
add_test(NAME qdata_odr_headers COMMAND qdata_odr_headers)
102-
endif()
96+
set_tests_properties(qdata_buffer_api PROPERTIES TIMEOUT 120)
10397

10498
find_program(RSCRIPT_EXECUTABLE Rscript REQUIRED)
10599
execute_process(
@@ -119,6 +113,7 @@ if(QDATA_BUILD_TESTS)
119113
$<TARGET_FILE:qdata_write_builtin_support>
120114
${CMAKE_CURRENT_BINARY_DIR}/builtin_cases
121115
)
116+
set_tests_properties(qdata_builtin_write_support PROPERTIES TIMEOUT 600)
122117
add_test(
123118
NAME qdata_roundtrip_qs2
124119
COMMAND ${RSCRIPT_EXECUTABLE}

tests/cpp/buffer_api.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
#include <cstdint>
2+
#include <iostream>
3+
#include <stdexcept>
24
#include <string>
35
#include <vector>
46

57
#include "qdata.h"
68

79
namespace {
810

11+
void debug_log(const char* message) {
12+
std::cerr << "[qdata_buffer_api] " << message << '\n';
13+
std::cerr.flush();
14+
}
15+
916
void expect_integer_payload(const qdata::object& obj, const std::vector<std::int32_t>& expected) {
1017
if(!qdata::holds_alternative<qdata::integer_vector>(obj)) {
1118
throw std::runtime_error("unexpected payload type");
@@ -25,19 +32,29 @@ void expect_integer_payload(const qdata::object& obj, const std::vector<std::int
2532
} // namespace
2633

2734
int main() {
35+
debug_log("start");
2836
const std::vector<std::int32_t> input{1, 2, 3, 4};
2937

38+
debug_log("serialize std::vector<std::byte>");
3039
const auto bytes = qdata::serialize(input);
40+
debug_log("deserialize std::vector<std::byte>");
3141
expect_integer_payload(qdata::deserialize(bytes), input);
3242

43+
debug_log("serialize std::vector<char>");
3344
const auto chars = qdata::serialize<std::vector<char>>(input);
45+
debug_log("deserialize std::vector<char>");
3446
expect_integer_payload(qdata::deserialize(chars), input);
3547

48+
debug_log("serialize std::vector<std::uint8_t>");
3649
const auto uints = qdata::serialize<std::vector<std::uint8_t>>(input);
50+
debug_log("deserialize std::vector<std::uint8_t>");
3751
expect_integer_payload(qdata::deserialize(uints), input);
3852

53+
debug_log("serialize std::string");
3954
const auto text = qdata::serialize<std::string>(input);
55+
debug_log("deserialize std::string");
4056
expect_integer_payload(qdata::deserialize(text), input);
4157

58+
debug_log("done");
4259
return 0;
4360
}

tests/cpp/odr_headers.cpp

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)