From 61ec03f82883a878aee5e3a61c8d621d81349e6d Mon Sep 17 00:00:00 2001 From: seleznevae Date: Sat, 1 Feb 2020 16:12:50 +0300 Subject: [PATCH] [A] Add more test cases for windows and fix compilation. --- appveyor.yml | 119 ++++++++++++++++++++--- lib/fort.hpp | 14 +-- src/fort.hpp | 14 +-- tests/bb_tests/test_table_border_style.c | 2 +- 4 files changed, 123 insertions(+), 26 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8ed7b1c..69d7285 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,25 +1,122 @@ version: '{build}' -image: Visual Studio 2017 +environment: + matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + configuration: Debug + platform: x86 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 14 2015 -platform: - - x64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + configuration: Debug + platform: x86 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 15 2017 -configuration: - - Debug - - Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + configuration: Debug + platform: x86 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 16 2019 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + configuration: Debug + platform: x64 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 16 2019 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + configuration: Debug + COMPILER: mingw + platform: x86 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Ninja + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + configuration: Release + COMPILER: mingw + platform: x86 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Ninja + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + configuration: Release + platform: x86 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 14 2015 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + configuration: Release + platform: x86 + name: with_win_header + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 14 2015 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + configuration: Release + platform: x86 + CXX_FLAGS: "/permissive- /std:c++latest /utf-8" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 15 2017 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + configuration: Release + platform: x86 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 16 2019 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + configuration: Release + platform: x64 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 14 2015 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + configuration: Release + platform: x64 + CXX_FLAGS: "/permissive- /std:c++latest /utf-8 /F4000000" + LINKER_FLAGS: "/STACK:4000000" + GENERATOR: Visual Studio 15 2017 + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + configuration: Release + platform: x64 + CXX_FLAGS: "" + LINKER_FLAGS: "" + GENERATOR: Visual Studio 16 2019 + + +init: + - cmake --version + - msbuild /version install: - git submodule update --init --recursive + - if "%COMPILER%"=="mingw" appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip + - if "%COMPILER%"=="mingw" 7z x ninja.zip -oC:\projects\deps\ninja > nul + - if "%COMPILER%"=="mingw" set PATH=C:\projects\deps\ninja;%PATH% + - if "%COMPILER%"=="mingw" set PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH% + - if "%COMPILER%"=="mingw" g++ --version + - if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32 before_build: - - mkdir build - - cd build - - cmake -G "Visual Studio 15 2017 Win64" .. + - dir + - if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin") else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin") - dir -build: - project: $(APPVEYOR_BUILD_FOLDER)\build\$(APPVEYOR_PROJECT_NAME).sln +build_script: + - cmake --build . --config "%configuration%" test_script: - dir diff --git a/lib/fort.hpp b/lib/fort.hpp index 5ebb51b..c83b66b 100644 --- a/lib/fort.hpp +++ b/lib/fort.hpp @@ -188,7 +188,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error */ - bool set_cell_text_align(enum fort::text_align value) + bool set_cell_text_align(fort::text_align value) { return set_property(FT_CPROP_TEXT_ALIGN, static_cast(value)); } @@ -258,7 +258,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_row_type(enum fort::row_type value) + bool set_cell_row_type(fort::row_type value) { return set_property(FT_CPROP_ROW_TYPE, static_cast(value)); } @@ -286,7 +286,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_content_fg_color(enum fort::color value) + bool set_cell_content_fg_color(fort::color value) { return set_property(FT_CPROP_CONT_FG_COLOR, static_cast(value)); } @@ -300,7 +300,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_bg_color(enum fort::color value) + bool set_cell_bg_color(fort::color value) { return set_property(FT_CPROP_CELL_BG_COLOR, static_cast(value)); } @@ -314,7 +314,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_content_bg_color(enum fort::color value) + bool set_cell_content_bg_color(fort::color value) { return set_property(FT_CPROP_CONT_BG_COLOR, static_cast(value)); } @@ -328,7 +328,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_text_style(enum fort::text_style value) + bool set_cell_text_style(fort::text_style value) { return set_property(FT_CPROP_CELL_TEXT_STYLE, static_cast(value)); } @@ -342,7 +342,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_content_text_style(enum fort::text_style value) + bool set_cell_content_text_style(fort::text_style value) { return set_property(FT_CPROP_CONT_TEXT_STYLE, static_cast(value)); } diff --git a/src/fort.hpp b/src/fort.hpp index 5ebb51b..c83b66b 100644 --- a/src/fort.hpp +++ b/src/fort.hpp @@ -188,7 +188,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error */ - bool set_cell_text_align(enum fort::text_align value) + bool set_cell_text_align(fort::text_align value) { return set_property(FT_CPROP_TEXT_ALIGN, static_cast(value)); } @@ -258,7 +258,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_row_type(enum fort::row_type value) + bool set_cell_row_type(fort::row_type value) { return set_property(FT_CPROP_ROW_TYPE, static_cast(value)); } @@ -286,7 +286,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_content_fg_color(enum fort::color value) + bool set_cell_content_fg_color(fort::color value) { return set_property(FT_CPROP_CONT_FG_COLOR, static_cast(value)); } @@ -300,7 +300,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_bg_color(enum fort::color value) + bool set_cell_bg_color(fort::color value) { return set_property(FT_CPROP_CELL_BG_COLOR, static_cast(value)); } @@ -314,7 +314,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_content_bg_color(enum fort::color value) + bool set_cell_content_bg_color(fort::color value) { return set_property(FT_CPROP_CONT_BG_COLOR, static_cast(value)); } @@ -328,7 +328,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_text_style(enum fort::text_style value) + bool set_cell_text_style(fort::text_style value) { return set_property(FT_CPROP_CELL_TEXT_STYLE, static_cast(value)); } @@ -342,7 +342,7 @@ public: * - true: Success; cell property was changed. * - false: In case of error. */ - bool set_cell_content_text_style(enum fort::text_style value) + bool set_cell_content_text_style(fort::text_style value) { return set_property(FT_CPROP_CONT_TEXT_STYLE, static_cast(value)); } diff --git a/tests/bb_tests/test_table_border_style.c b/tests/bb_tests/test_table_border_style.c index a56e36d..a40333a 100644 --- a/tests/bb_tests/test_table_border_style.c +++ b/tests/bb_tests/test_table_border_style.c @@ -630,7 +630,7 @@ void test_table_builtin_border_styles(void) assert_str_equal(table_str, table_str_etalon); ft_destroy_table(table); -#if defined(FT_HAVE_WCHAR) && !defined(FT_MICROSOFT_COMPILER) +#if defined(FT_HAVE_WCHAR) && !defined(FT_MICROSOFT_COMPILER) && !defined(_WIN32) ft_set_default_border_style(FT_DOUBLE2_STYLE); table = create_basic_wtable(); table_wstr = ft_to_wstring(table);