From 710d07882409aa011d3ed66765df28a645443bfd Mon Sep 17 00:00:00 2001 From: Elias Kosunen Date: Fri, 11 May 2018 21:38:40 +0300 Subject: [PATCH] Fix Appveyor tests Formatting --- CMakeLists.txt | 4 +++- include/fmt/core.h | 6 +++--- include/fmt/format-inl.h | 18 +++++++++--------- include/fmt/format.h | 21 ++++++++++++++------- support/appveyor.yml | 21 +++++++++++++-------- support/travis-build.py | 2 +- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d4418e6..eb29eb2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(PEDANTIC_COMPILE_FLAGS -Weverything -Wpedantic -Wno-weak-vtables -Wno-padded -Wno-gnu-statement-expression -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-reserved-id-macro - -Wno-global-constructors -Wno-disabled-macro-expansion) + -Wno-global-constructors -Wno-disabled-macro-expansion + -Wno-switch-enum -Wno-documentation-unknown-command + -Wno-gnu-string-literal-operator-template) set(WERROR_FLAG -Werror) endif () diff --git a/include/fmt/core.h b/include/fmt/core.h index 820304ff..17b685a2 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -558,8 +558,8 @@ template FMT_CONSTEXPR basic_format_arg make_arg(const T &value); #if FMT_GCC_VERSION >= 406 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wuseless-cast" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wuseless-cast" #endif #define FMT_MAKE_VALUE(TAG, ArgType, ValueType) \ @@ -631,7 +631,7 @@ FMT_MAKE_VALUE(pointer_type, std::nullptr_t, const void*) #if FMT_GCC_VERSION >= 406 // -Wuseless-cast -#pragma GCC diagnostic pop +# pragma GCC diagnostic pop #endif // Formatting of arbitrary pointers is disallowed. If you want to output a diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index f66a5ff6..ac29038c 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -115,8 +115,8 @@ int safe_strerror( void operator=(const StrError &) {} #if FMT_CLANG_VERSION -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-member-function" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-member-function" #endif // Handle the result of XSI-compliant version of strerror_r. @@ -154,7 +154,7 @@ int safe_strerror( } #if FMT_CLANG_VERSION -#pragma clang diagnostic pop +# pragma clang diagnostic pop #endif public: @@ -223,8 +223,8 @@ FMT_FUNC void system_error::init( namespace internal { #if FMT_GCC_VERSION >= 406 || FMT_CLANG_VERSION -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wformat-nonliteral" #endif template @@ -256,7 +256,7 @@ int char_traits::format_float( } #if FMT_GCC_VERSION >= 406 || FMT_CLANG_VERSION -#pragma GCC diagnostic pop +# pragma GCC diagnostic pop #endif template @@ -479,14 +479,14 @@ void basic_fixed_buffer::grow(std::size_t) { } #if FMT_CLANG_VERSION -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmissing-noreturn" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmissing-noreturn" #endif FMT_FUNC void internal::error_handler::on_error(const char *message) { FMT_THROW(format_error(message)); } #if FMT_CLANG_VERSION -#pragma clang diagnostic pop +# pragma clang diagnostic pop #endif FMT_FUNC void report_system_error( diff --git a/include/fmt/format.h b/include/fmt/format.h index cd25ef48..f7bfe233 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -77,9 +77,16 @@ #if FMT_CLANG_VERSION && !FMT_ICC_VERSION # pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wswitch-enum" +# pragma clang diagnostic ignored "-Wweak-vtables" +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wgnu-statement-expression" +# pragma clang diagnostic ignored "-Wc++98-compat" +# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +# pragma clang diagnostic ignored "-Wglobal-constructors" +# pragma clang diagnostic ignored "-Wdisabled-macro-expansion" # pragma clang diagnostic ignored "-Wdocumentation-unknown-command" # pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template" -# pragma clang diagnostic ignored "-Wswitch-enum" #endif #include "core.h" @@ -1617,8 +1624,8 @@ FMT_CONSTEXPR unsigned parse_nonnegative_int(Iterator &it, ErrorHandler &&eh) { } #if FMT_MSC_VER -#pragma warning(push) -#pragma warning(disable: 4512) +# pragma warning(push) +# pragma warning(disable: 4512) #endif template @@ -1639,7 +1646,7 @@ class custom_formatter: public function { }; #if FMT_MSC_VER -#pragma warning(pop) +# pragma warning(pop) #endif template @@ -2564,8 +2571,8 @@ class basic_writer { void on_num() { #if FMT_CLANG_VERSION - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundefined-func-template" + # pragma clang diagnostic push + # pragma clang diagnostic ignored "-Wundefined-func-template" #endif unsigned num_digits = internal::count_digits(abs_value); char_type sep = internal::thousands_sep(writer.locale_.get()); @@ -2573,7 +2580,7 @@ class basic_writer { writer.write_int(size, get_prefix(), spec, num_writer{abs_value, size, sep}); #if FMT_CLANG_VERSION - #pragma clang diagnostic pop + # pragma clang diagnostic pop #endif } diff --git a/support/appveyor.yml b/support/appveyor.yml index 600d71aa..cc5ef9a9 100644 --- a/support/appveyor.yml +++ b/support/appveyor.yml @@ -19,7 +19,8 @@ environment: matrix: allow_failures: - - image: Visual Studio 2013 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + CMAKE_GENERATOR: Visual Studio 12 2013 init: - ps: | @@ -28,12 +29,10 @@ init: } before_build: - # Workaround for CMake not wanting sh.exe on PATH for MinGW. - - ps: | - mkdir build - cd build + - mkdir build + - cd build - cmake -G "$($env:CMAKE_GENERATOR)$($env:CMAKE_GENERATOR_SUFFIX)" -DFMT_WERROR=OFF -DFMT_PEDANTIC=ON -DCMAKE_BUILD_TYPE=$env:CONFIGURATION .. + - ps: cmake -G "$($env:CMAKE_GENERATOR)$($env:CMAKE_GENERATOR_SUFFIX)" -DFMT_WERROR=OFF -DFMT_PEDANTIC=ON -DCMAKE_BUILD_TYPE=Debug .. build: project: C:\projects\fmt\build\fmt.sln @@ -42,8 +41,14 @@ build: test_script: - ps: | - cd build - ctest -C $env:CONFIGURATION + New-Item .\DartConfiguration.tcl -ItemType file + ctest -C Debug -T Test + $XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform + $XslInputElement.Load("https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl") + $file = $(ls Testing\*\Test.xml) | Select -first 1 + $XSLInputElement.Transform((Resolve-Path $file), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml")) + $wc = New-Object 'System.Net.WebClient' + $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml)) on_failure: - appveyor PushArtifact Testing/Temporary/LastTest.log diff --git a/support/travis-build.py b/support/travis-build.py index ce34b98a..21fc0871 100755 --- a/support/travis-build.py +++ b/support/travis-build.py @@ -86,7 +86,7 @@ test_build_dir = os.path.join(fmt_dir, "_build_test") # Configure library. makedirs_if_not_exist(build_dir) common_cmake_flags = [ - '-DCMAKE_INSTALL_PREFIX=' + install_dir, '-DCMAKE_BUILD_TYPE=' + build, + '-DCMAKE_INSTALL_PREFIX=' + install_dir, '-DCMAKE_BUILD_TYPE=' + build ] extra_cmake_flags = [] if standard != '14':