Next: , Previous: Testing Primitive Operations of Tagged Types, Up: Creating Unit Tests Using gnattest


26.9 Testing Inheritance

Since the test type hierarchy mimics the hierarchy of tested types, the inheritance of tests takes place. An example of such inheritance can be seen by running the test driver generated for the second example. As previously mentioned, actual tests are already written for this example.

     cd driver
     gprbuild -Ptest_driver
     test_runner

There are 6 passed tests while there are only 5 testable subprograms. The test routine for function Speed has been inherited and run against objects of the derived type.