configure cwindlines 17 configure AllowExecutionInBpCommand true D setargs clear echo " The MULTI script driving this demo session will demonstrate how to" echo "examine and improve coverage of your program by using the MULTI Profile" echo "Window. For more information about profiling, consult the on-line help." echo " The project has already been set up to build with coverage instrumentation." echo "The Profile window has been opened in order to collect profile data." echo " If you have not done so already connect to your target, or simply" echo "click 'Go on Selected Items (F5)' to begin." echo " " echo " " profile define BP6() { Q 1 bA main##DONE { scrollcommand +MAX wid=-2 echo " " echo " As demonstrated by the I/O display above, the script was able to" echo "test some of the cases which had not been previously tested, and" echo "by using the filter, we are able to obtain full coverage for the" echo "system." echo " This concludes the scripted portion of this demo. For more" echo "information about the MULTI Profile window, please refer to the" echo "on-line help." echo " " echo " To terminate the application, click 'Go on Selected Items (F5)'." echo " " profile process substitute %EVAL{mprintf("profile filter load \"%s/src_covr/filter.gprf\"", _TOP_PROJECT_DIR)} } Q 0 } define BP5() { Q 1 bA main##DONE { scrollcommand +MAX wid=-2 echo " The test harness ran the list of commands in test1.txt, resulting in" echo "the I/O displayed if you scroll up. The Profile window now displays" echo "the coverage results of the test." echo " The \"\% covered in filter\" indicates that the coverage is nearly" echo "complete. If you select the Coverage tab, you can select functions" echo "which are still not completely covered." echo " For example, although test1.txt included an unknown command, the" echo "\"Unknown command\" message was not triggered because a parameter was" echo "not specified." echo " We will now use a second test script which completely covers the" echo "code in the server." echo " " echo " To Continue, click 'Go on Selected Items (F5)'." profile process substitute %EVAL{mprintf("profile filter load \"%s/src_covr/filter.gprf\"", _TOP_PROJECT_DIR)} mute on k force mute off python -b -f src_covr/setargs.gpy src_covr/test2.txt BP6() } Q 0 } define BP4() { Q 1 bA ReadInput##BEGIN { scrollcommand +MAX wid=-2 echo " " echo " " echo " The test harness allows the server to be tested by reading from" echo "files using MULTI's host I/O mechanism. This demo includes two" echo "command lists which increase the amount of coverage achieved in the" echo "server. We will now restart the server using the first test script." echo " " echo " To Continue, click 'Go on Selected Items (F5)'." echo " " echo " " mute on k force mute off python -b -f src_covr/setargs.gpy src_covr/test1.txt BP5() } Q 0 } define BP3() { Q 1 bA ProcessCommand##SUCCESS { scrollcommand +MAX wid=-2 echo " " echo " The coverage information currently displayed also includes our" echo "test harness code. We are not interested in the coverage of this" echo "code, so we can filter it out by deselecting it in the filter." echo " If the filter is not visible at the left of the Profile window, you" echo "can show it by pressing the \"Filter\" button." echo " This script has automatically deselected this file in the filter." echo "Notice that the status area in the Overview tab is affected by" echo "this change to the filter. Filters can be saved and loaded using" echo "the Profile window's File menu or the \"profile\" command." echo " " echo " To Continue, click 'Go on Selected Items (F5)'." substitute %EVAL{mprintf("profile filter load \"%s/src_covr/filter.gprf\"", _TOP_PROJECT_DIR)} BP4() } Q 0 } define BP2() { Q 1 bA GetFile##SUCCESS { scrollcommand +MAX wid=-2 echo " " echo " Now that the server has successfully retrieved a file, let's see" echo "how much of the server code was covered. We have pressed the \"Process\"" echo "button in the Profile window to collect data." echo " We have also changed the Mode displayed by the Profile window to" echo "Instrumentation." echo " The Coverage tab and Debugger source pane will hold the most useful" echo "information for increasing coverage. Select the Coverage tab in" echo "the Profile window to view coverage statistics for each function." echo " " echo " To Continue, click 'Go on Selected Items (F5)'." profile process BP3() } Q 0 } define BP1() { Q 1 bA main { scrollcommand +MAX wid=-2 echo " " echo " " echo " " echo " This program simulates a very basic file server. When run with no" echo "arguments, it waits for commands to be input. Let's have it display" if (_TARGET_OS == 7) { echo "the README file by typing \"GET README\" followed by Enter in the" echo "console window that was created when the program was run." } else if (_TARGET_OS == 8) { echo "the README file by typing \"GET README\" followed by Enter in the" echo "terminal from which the IDE was launched." } else { echo "the README file by changing to the I/O tab and typing \"GET README\"" echo "follwed by Enter, or typing \"targetinput GET README\\n\" in the command" echo "pane." } echo " " echo " " BP2() resume } Q 0 } BP1() Q 1 b main##FAILED { echo " " echo " Could not open the input file. This could be caused by:" echo " " echo "1) The program is unable to resolve the full path to the data file. " echo " Make sure the project has been rebuilt if it was moved." echo "2) The project was not created in the default project directory (src_covr). " echo " Modify coverage.rc and replace src_covr with the subdirectory" echo " containing the project source." echo "3) You are loading from ROM where command line arguments are not " echo " supported. Modify the main function of the coverage program to " echo " ignore argc and specify the absolute path." echo "3) The file does not exist" echo " " echo " To Continue and terminate this demonstration, click 'Go on Selected Items (F5)'." } Q 0