1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00
BadFish/appveyor.yml
Marco Costalba 5ea327d924 Improve appeyor build
Check bench number and do not
hard-code *.cpp file names.

No functional change.
2017-08-20 19:22:11 +02:00

67 lines
1.8 KiB
YAML

version: 1.0.{build}
clone_depth: 50
branches:
only:
- master
- appveyor
# Operating system (build VM template)
os: Visual Studio 2015
# Build platform, i.e. x86, x64, AnyCPU. This setting is optional.
platform:
- x86
- x64
- Any CPU
# build Configuration, i.e. Debug, Release, etc.
configuration: Debug
matrix:
# The build fail immediately once one of the job fails
fast_finish: true
# Scripts that are called at very beginning, before repo cloning
init:
- cmake --version
- msbuild /version
before_build:
- ps: |
# Get sources
$src = get-childitem -Path *.cpp -Recurse | select -ExpandProperty FullName
$src = $src -join ' '
$src = $src.Replace("\", "/")
# Build CMakeLists.txt
$t = 'cmake_minimum_required(VERSION 3.8)',
'project(Stockfish)',
'set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/src)',
'set(source_files', $src, ')',
'add_executable(stockfish ${source_files})'
# Write CMakeLists.txt withouth BOM
$MyPath = (Get-Item -Path "." -Verbose).FullName + '\CMakeLists.txt'
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[System.IO.File]::WriteAllLines($MyPath, $t, $Utf8NoBomEncoding)
# Obtain bench reference from git log
$b = git log HEAD | sls "\b[Bb]ench[ :]+[0-9]{7}" | select -first 1
$bench = $b -match '\D+(\d+)' | % { $matches[1] }
Write-Host "Reference bench:" $bench
build_script:
- cmake -G "Visual Studio 14 2015 Win64" .
- cmake --build .
before_test:
- cd src/Debug
- ps: |
# Verify bench number
./stockfish bench 2> out.txt 1> null
$s = (gc "./out.txt" | out-string)
$r = ($s -match 'Nodes searched \D+(\d+)' | % { $matches[1] })
Write-Host "Engine bench:" $r
Write-Host "Reference bench:" $bench
If ($r -ne $bench) { exit 1 }