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...
Public Member Functions | |
def | __init__ (self, subSuite=".", *suitePath=None) |
The first argument accepted by the constructor indicates the selection of functional tests to be performed: More... | |
def | clean (self) |
This function prepares the contents of all test case directories in the sub-suite for performing the tests. More... | |
def | endorse (self) |
This function "endorses" the current output of all test case directories in the sub-suite by replacing the contents of the "ref" directory by the contents of the "out" directory. More... | |
def | perform (self, *skirtPath=None, visual=None) |
This function performs all tests in the test suite, verifies the results, and prepares a summary test report. More... | |
def | size (self) |
This function returns the number of test cases in this test suite. More... | |
def | skiPaths (self) |
This function returns a list of the paths to the ski files for the test cases in this test suite. More... | |
Private Attributes | |
_skiPaths | |
_suitePath | |
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.
A test suite consists of a set of independent test cases (i.e. test cases can be executed in arbitrary order)
Each test case in a test suite is defined by a collection of files and directories as follows:
.ski filename extension) specifying the simulation to be performed for the test casein
containing the input files for the simulation, if anyref
containing the reference files for the test, i.e. a copy of the output files generated by a correct simulation runout
to receive the actual output files when the test is performed; the contents of this directory are automatically removed and recreated when running the test case
.ski filename extensionA test suite is defined by a collection of files and directories as follows:
For example, a test suite may be structured with nested sub-suites as follows (where each CaseN
directory contains a ski file plus ref
, in
, and out
directories):
SKIRT Tests SPH simulations Case1 Case2 Geometries Radial Case1 Case2 Cylindrical Case1 Case2 Case3 Full 3D Case1 Case2 Instruments
It is also allowed to nest test cases inside another test case, but this is not recommended.
def pts.test.functional.SkirtTestSuite.__init__ | ( | self, | |
subSuite = "." , |
|||
* | suitePath = None |
||
) |
The first argument accepted by the constructor indicates the selection of functional tests to be performed:
In addition, the constructor accepts an optional argument specifying the path of the directory containing the complete functional test suite. If specified, the path is interpreted as described for the pts.utils.absPath() function. If omitted, the default path is pts.utils.projectParentPath()/"Functional9".
def pts.test.functional.SkirtTestSuite.clean | ( | self | ) |
This function prepares the contents of all test case directories in the sub-suite for performing the tests.
Specifically, it creates in
, out
and ref
directories next to the ski file, if they don't exist, and it removes all files from the out
directory (without touching any of its subdirectories, which should not be present anyway).
def pts.test.functional.SkirtTestSuite.endorse | ( | self | ) |
This function "endorses" the current output of all test case directories in the sub-suite by replacing the contents of the "ref" directory by the contents of the "out" directory.
def pts.test.functional.SkirtTestSuite.perform | ( | self, | |
* | skirtPath = None , |
||
visual = None |
|||
) |
This function performs all tests in the test suite, verifies the results, and prepares a summary test report.
The function accepts two optional arguments:
def pts.test.functional.SkirtTestSuite.size | ( | self | ) |
This function returns the number of test cases in this test suite.
def pts.test.functional.SkirtTestSuite.skiPaths | ( | self | ) |
This function returns a list of the paths to the ski files for the test cases in this test suite.