Skip to content

Commit

Permalink
Back to the standard test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cxw42 committed Jul 20, 2019
1 parent 6d3f2f1 commit 4f517b8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 56 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 4 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
16 changes: 4 additions & 12 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param(
[switch] $init,

[switch] $install,

[ValidateSet("ON","OFF")]
[string] $static = "ON",

Expand All @@ -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
Expand All @@ -37,9 +29,9 @@ function exec
[ScriptBlock] $ScriptBlock,
[int[]] $AllowedExitCodes = @(0)
)

$backupErrorActionPreference = $script:ErrorActionPreference

$script:ErrorActionPreference = "Continue"
try
{
Expand Down
6 changes: 0 additions & 6 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 3 additions & 7 deletions src/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}-")
22 changes: 2 additions & 20 deletions test.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param(
[ValidateSet("pcre2","core")]
[string] $proj = "core",

[ValidateSet("ON","OFF")]
[string] $static = "ON",

Expand All @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit 4f517b8

Please sign in to comment.