"Fossies" - the Fresh Open Source Software Archive

Member "stockfish-11-linux/tests/perft.sh" (18 Jan 2020, 1068 Bytes) of package /linux/privat/stockfish-11-linux.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 # verify perft numbers (positions from www.chessprogramming.org/Perft_Results)
    3 
    4 error()
    5 {
    6   echo "perft testing failed on line $1"
    7   exit 1
    8 }
    9 trap 'error ${LINENO}' ERR
   10 
   11 echo "perft testing started"
   12 
   13 cat << EOF > perft.exp
   14    set timeout 10
   15    lassign \$argv pos depth result
   16    spawn ./stockfish
   17    send "position \$pos\\ngo perft \$depth\\n"
   18    expect "Nodes searched? \$result" {} timeout {exit 1}
   19    send "quit\\n"
   20    expect eof
   21 EOF
   22 
   23 expect perft.exp startpos 5 4865609 > /dev/null
   24 expect perft.exp "fen r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq -" 5 193690690 > /dev/null
   25 expect perft.exp "fen 8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - -" 6 11030083 > /dev/null
   26 expect perft.exp "fen r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1" 5 15833292 > /dev/null
   27 expect perft.exp "fen rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8" 5 89941194 > /dev/null
   28 expect perft.exp "fen r4rk1/1pp1qppp/p1np1n2/2b1p1B1/2B1P1b1/P1NP1N2/1PP1QPPP/R4RK1 w - - 0 10" 5 164075551 > /dev/null
   29 
   30 rm perft.exp
   31 
   32 echo "perft testing OK"