X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=appveyor.yml;h=c81869b58dbc6b7bcf626c42d3d7bab0c598ba70;hp=97a97b5490d9239a12a346bba1e8f4549a120b6e;hb=571f54b176b5c30aaac35bc7bbd255c79cdcb926;hpb=e61f7b1e6d0273ef9447efa01e90578adef4613e diff --git a/appveyor.yml b/appveyor.yml index 97a97b54..c81869b5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 1.0.{build} -clone_depth: 5 +clone_depth: 50 branches: only: @@ -9,28 +9,63 @@ branches: # Operating system (build VM template) os: Visual Studio 2015 +# Build platform, i.e. x86, x64, AnyCPU. This setting is optional. platform: - x86 - x64 -# Build configuration, i.e. Debug, Release, etc. +# build Configuration, i.e. Debug, Release, etc. configuration: - Debug - Release +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: - - cmd: cmake --version - - cmd: msbuild /version + - cmake --version + - msbuild /version -# Scripts to run before build before_build: - - cmd: cd src - - cmd: echo project (Stockfish) >> CMakeLists.txt - - cmd: echo add_executable(stockfish benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp >> CMakeLists.txt - - cmd: echo main.cpp material.cpp misc.cpp movegen.cpp movepick.cpp pawns.cpp position.cpp psqt.cpp >> CMakeLists.txt - - cmd: echo search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp syzygy/tbprobe.cpp) >> CMakeLists.txt + - 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 + $g = "Visual Studio 14 2015" + If (${env:PLATFORM} -eq 'x64') { $g = $g + ' Win64' } + cmake -G "${g}" . + Write-Host "Generated files for: " $g build_script: - - cmake -G "Visual Studio 14 2015 Win64" . - - cmake --build . + - cmake --build . --config %CONFIGURATION% -- /verbosity:minimal + +before_test: + - cd src/%CONFIGURATION% + - stockfish bench 2> out.txt >NUL + - ps: | + # Verify bench number + $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 }