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 test_data 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, and comment sections are intact the old test routine will fit in its place and no test skeleton 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 skeleton is created for function Dec.

The only way of regenerating tests skeletons is to remove the previously created tests together with corresponding comment sections.