Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add windows build to Build & Test workflow. #359

Merged
merged 10 commits into from
Jan 27, 2025
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,29 @@ jobs:
- name: Test Release
run: ./build/release/test/all_tests

test_windows:
name: "Test (windows-latest, msvc)"
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
fetch-depth: 50
nirosys marked this conversation as resolved.
Show resolved Hide resolved
- name: Build Debug
run: |
mkdir build64
cmake -G "Visual Studio 17 2022" -A x64 -S . -B "build64"
cmake --build build64 --config Debug
- name: Test Debug
run: 'build64\test\Debug\all_tests.exe'
- name: Build Release
run: |
cmake --build build64 --config Release
- name: Test Release
run: 'build64\test\Release\all_tests.exe'

documentation:
name: Generate Documentation
needs:
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ project(IonC
VERSION 1.1.3
LANGUAGES CXX C)


# we default to 'Release' build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
Expand Down Expand Up @@ -112,6 +111,9 @@ add_subdirectory(tools)
if (IONC_BUILD_TESTS)
if (NOT TARGET gtest_main)
message("Using included google-test")
# Prevent googletest from linking against different versions of the C Runtime Library on
# Windows.
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(deps/google-test EXCLUDE_FROM_ALL)
endif()
add_subdirectory(test)
Expand Down
8 changes: 0 additions & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_DONT_DEFINE_SUCCEED=1 -DGTEST_DONT_DEFINE_FAIL=1")
# Verbose parameterized names are disabled in debug configuration and on Windows. These don't
# always integrate well with IDEs (e.g. CLion), but are nice to have from the command line.
if (MSVC)
# Prevent googletest from linking against different versions of the C Runtime Library on
# Windows.
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif()

add_executable(all_tests
gather_vectors.cpp
Expand All @@ -33,9 +28,6 @@ add_executable(all_tests
test_ion_reader_seek.cpp
)

set_property(TARGET all_tests PROPERTY CXX_STANDARD 98)


target_include_directories(all_tests
PRIVATE
.
Expand Down
10 changes: 5 additions & 5 deletions test/test_ion_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ TEST(IonStream, SeekOnUserStreamReadsAllData) {
POSITION offset = 0;

ION_READ_STATE ion_read_file = {
.in = ION_DATA,
.in_size = sizeof(ION_DATA),
.read_offset = 0,
.block_size = block_size,
.num_calls = 0,
/* .in = */ ION_DATA,
/* .in_size = */ sizeof(ION_DATA),
/* .read_offset = */ 0,
/* .block_size = */ block_size,
/* .num_calls = */ 0,
};

ion_reader_open_stream(&reader, &ion_read_file, seek_on_userstream_handler, NULL);
Expand Down
Loading