Currently I am using 2-level test hierarchy in DUnit (Test Project -> Test Case -> Test method; see example below). Is it possible to introduce 3rd level or even more levels?
DUnit tests hierarchy
1.1k views Asked by kludg At
3
There are 3 answers
0
On
You can group related tests in test suites, which can be nested.
If you want to do it at run time, check out my "Open Component Test Framework (OpenCTF)" at sourceforge.
0
On
I build a hierarchy by putting backslashes in the `SuitePath'. For instance:
initialization
RegisterTests('Group1\Group2', [TExampleTests1.Suite,
TExampleTests2.Suite]);
RegisterTests('Group1\Group3', [TExampleTests3.Suite,
TExampleTests4.Suite]);
end.
In the end I get something like this:
A lot less mucking around than with David's way, and you can spread your group definitions across disparate units.
You can use test suites to create as many levels of nesting as you desire. The documentation offers the following example: