From 4f517b81a6ba468be3c4a49d2066b2b9e0e3cb44 Mon Sep 17 00:00:00 2001 From: Chris White Date: Sat, 20 Jul 2019 16:24:15 -0400 Subject: [PATCH] Back to the standard test configuration --- CMakeLists.txt | 3 ++- appveyor.yml | 14 ++++---------- build.ps1 | 16 ++++------------ init.ps1 | 6 ------ src/bin/CMakeLists.txt | 10 +++------- test.ps1 | 22 ++-------------------- 6 files changed, 15 insertions(+), 56 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d046237..5063045 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,8 +111,9 @@ add_subdirectory(include) # checked out. if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt) enable_testing() - #set(EDITORCONFIG_CMD "${PROJECT_BINARY_DIR}/bin/editorconfig") set(EDITORCONFIG_CMD "=editorconfig_bin") + # "=" means use the given CMake target, here, "editorconfig_bin". + # Used by tests/CMakeLists.txt, variable "is_target". add_subdirectory(tests) message(STATUS "Tests enabled") else() diff --git a/appveyor.yml b/appveyor.yml index 5e4dda0..9c22c56 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,25 +1,19 @@ -# appveyor.yml for editorconfig-core-vimscript - image: - Visual Studio 2017 - + environment: CONFIG: Release VSVER: 15 matrix: - ARCH: x86 - # XXX x86 only, for faster testing - -#cache: -# - C:/projects/editorconfig-core-c/bin/x86-static/build -# - C:/projects/editorconfig-core-c/bin/x86-static/pcre2 + - ARCH: x64 install: - cmake --version - git submodule update --init - # Download PCRE2 sources. XXX nop if .../pcre2-8.lib already exists. + # Download PCRE2 sources - ps: ./init.ps1 -pcre 10.32 - # Build and install PCRE2. XXX nop if .../pcre2-8.lib already exists. + # Build and install PCRE2 - ps: ./build.ps1 -proj pcre2 -config $env:CONFIG -arch $env:ARCH -vsver $env:VSVER -init -install build_script: diff --git a/build.ps1 b/build.ps1 index 9c61b3f..6653f4d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -5,7 +5,7 @@ param( [switch] $init, [switch] $install, - + [ValidateSet("ON","OFF")] [string] $static = "ON", @@ -14,20 +14,12 @@ param( [ValidateSet("x86","x64")] [string] $arch = "x64", - + [ValidateSet("15","14","12")] [int] $vsver = 15 ) -## XXX for faster testing -#if ($proj -eq "pcre2"){ -# if (Test-Path 'C:/projects/editorconfig-core-c/bin/x86-static/build/lib/pcre2-8.lib') { -# "Skipping already-built $proj build" | Write-Host -ForegroundColor Green -# exit -# } -#} - $ErrorActionPreference="stop" function exec @@ -37,9 +29,9 @@ function exec [ScriptBlock] $ScriptBlock, [int[]] $AllowedExitCodes = @(0) ) - + $backupErrorActionPreference = $script:ErrorActionPreference - + $script:ErrorActionPreference = "Continue" try { diff --git a/init.ps1 b/init.ps1 index a54037a..cb39c3e 100644 --- a/init.ps1 +++ b/init.ps1 @@ -2,12 +2,6 @@ param( $pcre="10.32" ) -# XXX for faster testing -#if (Test-Path 'C:/projects/editorconfig-core-c/bin/x86-static/build/lib/pcre2-8.lib') { -# "Skipping already-built $proj init" | Write-Host -ForegroundColor Green -# exit -#} - $ErrorActionPreference="Stop" $dest = "bin" diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index 8390d8c..b966bc5 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -1,16 +1,16 @@ # # Copyright (c) 2011-2012 EditorConfig Team # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -62,7 +62,3 @@ set_target_properties(editorconfig_bin PROPERTIES install(TARGETS editorconfig_bin RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") -# This is a way to find the EXE name for debugging. However, it issues a -# CMake warning under policy CMP0026. -#get_target_property(out_name editorconfig_bin LOCATION) -#message(STATUS "src/bin: Generating -${out_name}-") diff --git a/test.ps1 b/test.ps1 index 23f053b..78baa91 100644 --- a/test.ps1 +++ b/test.ps1 @@ -1,7 +1,7 @@ param( [ValidateSet("pcre2","core")] [string] $proj = "core", - + [ValidateSet("ON","OFF")] [string] $static = "ON", @@ -12,11 +12,7 @@ param( [string] $arch = "x64" ) -## XXX Force succeed to save the cache -#"Force-succeeding" | Write-Host -ForegroundColor Green -#exit(0) - -# XXX $ErrorActionPreference="stop" +$ErrorActionPreference="stop" $dest = "bin" @@ -44,21 +40,7 @@ $env:Path += ";" + (Resolve-Path $bin) "Testing $proj" | Write-Host -ForegroundColor DarkGreen Push-Location $dest try { - #ctest -E utf_8_char -R "meta|version" -VV --output-on-failure . -C $config - "Running test command: ctest -E utf_8_char -VV --output-on-failure . -C $config" | - Write-Host -ForegroundColor DarkGreen ctest -E utf_8_char -VV --output-on-failure . -C $config } finally { Pop-Location } - -# XXX -"Manual test: doubled backslashes" | Write-Host -ForegroundColor Yellow -C:\projects\editorconfig-core-c\bin\x86-static\core\bin\Release\editorconfig.exe "-f" "path_separator.in" "C:/projects/editorconfig-core-c/tests/filetree\\path\\separator" -"End manual test" | Write-Host -ForegroundColor Yellow - -"Manual test: single backslashes" | Write-Host -ForegroundColor Yellow -C:\projects\editorconfig-core-c\bin\x86-static\core\bin\Release\editorconfig.exe "-f" "path_separator.in" "C:/projects/editorconfig-core-c/tests/filetree\path\separator" -"End manual test" | Write-Host -ForegroundColor Yellow - -"Done testing $proj" | Write-Host -ForegroundColor DarkGreen