Contains the SkirtTestSuite class for performing a suite of SKIRT test cases. More...
Classes | |
class | SkirtTestSuite |
An instance of the SkirtTestSuite class represents a suite of SKIRT test cases, stored as a nested structure of files and directories according to a specific layout, and provides facilities to perform the tests, verify the results, and prepare a summary test report. More... | |
Functions | |
def | _areEqualFitsFiles (filePath1, filePath2) |
This helper function returns True if the specified FITS files are equal except for the information in a single header record, and False otherwise. More... | |
def | _areEqualLists (list1, list2, allowedDiffs) |
This helper function returns True if the specified lists are equal except for the contents of a number of items not larger than allowedDiffs, and False otherwise. More... | |
def | _readBlocks (filepath) |
This helper function reads blocks of 80 bytes from the specified binary file into a list of bytes objects, and returns the list. More... | |
def | findDifferences (sim) |
This function looks for relevant differences between the contents of the output and reference directories of the test case represented by the specified simulation. More... | |
def | getDifferenceStatistics (sim, name) |
This function returns a string describing some basic statistics on the difference between the reference and output files of the specified name in the specified simulation. More... | |
def | reportTestCase (sim) |
This function verifies the results for the test case represented by the specified simulation, creates a test report in the output directory, and returns an overall status string: "Crashed", "Failed", or "Succeeded". More... | |
Contains the SkirtTestSuite class for performing a suite of SKIRT test cases.
An instance of the SkirtTestSuite class in this module represents a suite of functional SKIRT test cases, stored as a nested structure of files and directories according to a specific layout, and provides facilities to perform the tests, verify the results, and prepare a summary test report.
|
private |
This helper function returns True if the specified FITS files are equal except for the information in a single header record, and False otherwise.
|
private |
This helper function returns True if the specified lists are equal except for the contents of a number of items not larger than allowedDiffs, and False otherwise.
|
private |
This helper function reads blocks of 80 bytes from the specified binary file into a list of bytes objects, and returns the list.
def pts.test.functional.findDifferences | ( | sim | ) |
This function looks for relevant differences between the contents of the output and reference directories of the test case represented by the specified simulation.
The function returns three lists of file names, which should all be empty for the test case to be successful:
The function only handles files of the following types:
Any other files are ignored. Specifically, this means that the following file types are not compared:
def pts.test.functional.getDifferenceStatistics | ( | sim, | |
name | |||
) |
This function returns a string describing some basic statistics on the difference between the reference and output files of the specified name in the specified simulation.
It supports text columns files and FITS files. Essentially, the string shows the number of nonzero values that don't match, that differ by more than 10 percent, and that differ by more than 50% between the files.
def pts.test.functional.reportTestCase | ( | sim | ) |
This function verifies the results for the test case represented by the specified simulation, creates a test report in the output directory, and returns an overall status string: "Crashed", "Failed", or "Succeeded".