Technote (FAQ)
Question
How can you test an Ada package with Component Testing for Ada in Rational Test RealTime. The package contains the package 'preelaborate'.
Cause
If an Ada package contains a pragma preelaborate, all the packages that this package uses also require a pragma preelaborate.
The Component Testing for Ada runtime library does not support this pragma. Therefore any dependency from the code under test to the runtime library causes a compiler error.
Answer
The following methods can avoid the dependencies.
- Instrument the code under test without the option
-INIT_UNSUPPORTED.
Then the instrumentor comments out the pragmapreelaborate.
Now the runtime library no longer needs to contain the pragmapreelaborate. You get a warning message to indicate that the instrumentor commented out the pragma.
TestRT Coverage Ada - WARNING: Option -INIT_UNSUPPORTED should be used to not comment the pragma Preelaborate
- Test the code as a black box.
This means that the test entry point is outside the package under test. Use the instructionBegin, without any parameters, in the test script. Now you can test the code without instrumenting it. However you cannot access private elements of the package under test..
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.
