Documentation ¶
Overview ¶
Package testsuite contains data structures and functionality to be able to run chess test suites which contain chess positions as EPD (Extended Position Description). EPD contain a standard FEN of a position but also meta data to describe a result for a successful test. This could be best move on the position, mate in x or avoid moves. https://www.chessprogramming.org/Extended_Position_Description For the purpose of testing our chess engine only the opcodes "bm" (best move), "am" (avoid move) and "dm" (direct mate) are implemented.
Index ¶
Constants ¶
const ( None testType = iota DM testType = iota BM testType = iota AM testType = iota )
Implemented test types.
const ( NotTested resultType = iota Skipped resultType = iota Failed resultType = iota Success resultType = iota )
resultType define possible results for a tests as a type and constants.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SuiteResult ¶
type SuiteResult struct { Counter int SuccessCounter int FailedCounter int SkippedCounter int NotTestedCounter int Nodes uint64 Time time.Duration }
SuiteResult data structure to collect sum of the results of tests.
type Test ¶
type Test struct {
// contains filtered or unexported fields
}
Test defines the data structure for a test after reading in the test files. Each EPD from the read file will create an instance of this struct and when the tests are run the result will be stored back to this instance.
type TestSuite ¶
type TestSuite struct { Tests []*Test Time time.Duration Depth int FilePath string LastResult *SuiteResult }
TestSuite is the data structure for the running a file of EPD tests.
func NewTestSuite ¶
NewTestSuite creates an instance of a TestSuite and reads in the given file to create test cases which can be run with RunTests().