I would like to create a hierarchy of TestSuites
. However it appears that it is not possible to call a TestSuite
from another TestSuite
. So before I go and reinvent the wheel, I thought I would see how others have done (or would) accomplish this.
Details of what I am trying to accomplish
I have grouped packages (and their tests) that perform like functionality by directory. For illustrative purposes lets say I have three subdirectories: importers, manipulators, and processes. I have a TestSuite in each subdirectory named TestAll.mt . I also have one in the top level directory called TestAll.mt that I would like to have call the TestAll.mt in the three subdirectories.
I would like to be able to run the test suites at both the subdirectory and top levels. Running the test suite at the subdirectory level would only run the particular subset of tests, while running the test suite at the top level would run the test suites in all the subdirectories.
I would like to avoid having to add an entry for a particular test to both the subdirectory and top level test suites.
A bonus would be if the top level test suite auto discovered the test suites in the subdirectories (not having to specify the subdirectories in the root test suite), but that is not crucial.
Update
Attempt #1 -- Make a list of .mt files in each of the sub TestAll.mt s. If the top level TestAll.mt is called, the sub levels' lists would be appended to the top level's list and then that list would be supplied to TestSuite. If a sub level's TestAll.mt is called, its list would be supplied as the argument to TestSuite.
Result: Failure
From Workbench, adding any expression to a .mt that contains TestSuite
appears to cause none of the tests to run.
x=1;
TestSuite[
{
"Test1.mt",
"Test2.mt"
}
]
From a notebook, TestSuite
shows up in command completion, but does not show up in the MUnit package usage info. Executing the following:
TestSuite[
{
"/pathToTests/Test1.mt",
"/pathToTests/Test2.mt"
}
]
Results in:
TestSuite[{"/pathToTests/Test1.mt", "/pathToTests/Test2.mt"}]
Searched the MUnit package files for TestSuite, no hits.
cd "/Applications/Wolfram Workbench.app/configuration/org.eclipse.osgi/bundles/214/1/.cp/MathematicaSourceVersioned/Head/MUnit"
find . -name "*.m" -print -exec grep TestSuite {} \;
Attempt #2 -- Roll my own TestSuite
...
Comments
Post a Comment