pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
510 stars 116 forks source link

Board regression testing #102

Closed lemonsqueeze closed 5 years ago

lemonsqueeze commented 5 years ago

Regression tests for board logic and moggy, before further PR madness comes in. I like the idea of being able to engage wild low-level board implementation changes while being reasonably sure things still work as they should.

For board regtest we replay some games hashing public board data structures at every move and compare that to the reference output. For moggy, generate playout moves starting from a fixed random seed and compare that to the move sequence in the reference output.

For now you need to build with BOARD_TESTS=1 then:

make test_board
make test_moggy

Added board test to travis so it gets tested automatically.