Next: , Previous: Setting Up and Tearing Down the Testing Environment, Up: Creating Unit Tests Using gnattest


26.6 Regenerating Tests

Bodies of test routines and env_mgmt packages are never overridden after they have been created once. As long as the name of the subprogram, full expanded Ada names, and the order of its parameters is the same, the old test routine will fit in its place and no test stub will be generated for the subprogram.

This can be demonstrated with the previous example. By uncommenting declaration and body of function Dec in simple.ads and simple.adb, running gnattest on the project, and then running the test driver:

     gnattest --harness-dir=driver -Psimple.gpr
     cd driver
     gprbuild -Ptest_driver
     test_runner

the old test is not replaced with a stub, nor is it lost, but a new test stub is created for function Dec.

The only way of regenerating tests stubs is to remove the previously created tests.