Improve appeyor build
Check bench number and do not hard-code *.cpp file names. No functional change.pull/1218/head
parent
fe60caba94
commit
5ea327d924
42
appveyor.yml
42
appveyor.yml
|
@ -1,5 +1,5 @@
|
||||||
version: 1.0.{build}
|
version: 1.0.{build}
|
||||||
clone_depth: 5
|
clone_depth: 50
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
@ -28,18 +28,40 @@ init:
|
||||||
- msbuild /version
|
- msbuild /version
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
- cd src
|
- ps: |
|
||||||
- echo project (Stockfish) >> CMakeLists.txt
|
# Get sources
|
||||||
- echo add_executable(stockfish benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp >> CMakeLists.txt
|
$src = get-childitem -Path *.cpp -Recurse | select -ExpandProperty FullName
|
||||||
- echo main.cpp material.cpp misc.cpp movegen.cpp movepick.cpp pawns.cpp position.cpp psqt.cpp >> CMakeLists.txt
|
$src = $src -join ' '
|
||||||
- echo search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp syzygy/tbprobe.cpp) >> CMakeLists.txt
|
$src = $src.Replace("\", "/")
|
||||||
- echo set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/src) >> CMakeLists.txt
|
|
||||||
# - echo target_compile_options(stockfish PUBLIC "/Ox") >> CMakeLists.txt
|
# 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:
|
build_script:
|
||||||
- cmake -G "Visual Studio 14 2015 Win64" .
|
- cmake -G "Visual Studio 14 2015 Win64" .
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
|
||||||
before_test:
|
before_test:
|
||||||
- cd Debug
|
- cd src/Debug
|
||||||
- stockfish.exe bench > null
|
- 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 }
|
||||||
|
|
Loading…
Reference in New Issue