TESTCENTER(1)
NAME
testcenter − shell command that invokes GUI version of TestCenter
SYNTAX
testcenter [ switches ] proofed_binary_name
SWITCHES
-motifUse the Motif version of the GUI
-openlookUse the OPEN LOOK version of the GUI
-background colorSpecifies background color.
-bg colorSpecifies background color.
-config pathnameUses the X resource specifications in pathname instead of the defaults.
-debugEnables protocol error handler. If this switch is specified, any X protocol error or fatal OITM error causes an error message to be printed on stderr followed by a core dump. No
-display host:dpy.scnSpecifies X server to connect to. If -display host:dpy.scn is specified, the program’s display is targeted for machine host on the network, on display and screen dpy.scn. If this argument is not specified, the display is taken from the environment variable DISPLAY, if it exists; otherwise, the display is targeted for the originating host, display and screen using unix:0.0.
-fastdrawTells TestCenter to sacrifice appearance for faster drawing. If -fastdraw is specified, the appearance of objects drawn on the screen will be compromised for for faster drawing. This is useful if your program is displaying on an X terminal over an RS232 line.
-font font_nameSpecifies default text font for all objects in the GUI.
-foreground fgcolorSpecifies foreground color.
-fgcolor fgcolorSame as -foreground.
-name name_stringSpecifies name_string as the name for this instance of program. If -name name_string is specified, name_string will be the value of the instance portion of the WM_CLASS property for this instance of the exeecution of the program. If -title is not also specified, name_string will be the value of the WM_NAME property, and will be displayed in the title bar of the main application window (assuming the window manager uses WM_NAME).
-olTells TestCenter to use the most appropriate OPEN LOOK model. If the monitor is monochrome, the 2-D model is used; if the monitor is color, the 3-D model is used.
-ol2dTells TestCenter to use the 2-D OPEN LOOK model.
-openlook_2dSame as -ol2d.
-ol3dTells TestCenter to use the 3- OPEN LOOK model.
-openlook_3dSame as -ol3d.
-reverseTells TestCenter to reverse foreground and background colors.
-rvSame as -reverse
-xrm‘resource_string:value’Sets the X resource resource_string in the X resource database to the value string.
DESCRIPTION
Starts the GUI version of TestCenter for proofed_binary_name, which is a TestCenter version of an application created with the proof command.
By default, if you do not specifiy an interface with -motif or -openlook, TestCenter starts as either Motif or OPEN LOOK depending on your platform. For instance, on Hewlett-Packard workstations, the default GUI is Motif, and for Sun workstations it is OPEN LOOK.
Each time proofed_binary_name runs, TestCenter creates a results file containing information about that execution run. The results file, by default, is named proofed_binary_name.X.Y, where X is an increasing integer representing a version number, and Y is an increasing number representing a single execution run. For example, my_program.tc.2.4 contains results for the fourth run of the second version of my_program.tc. You can override the default name by setting the TC_RESULTFILE environment variable.
By default, TestCenter writes each results file to the current directory. If the current directory is not writable, then TestCenter attempts to create the file in your home directory. If that is not possible, then TestCenter issues a message that it was unable to create a results file, but continues execution of proofed_binary_name. You can override this default location of the file by setting the TC_RESULTDIR environment variable.
If there is no proofed_binary_name and no results file associated with that name, then TestCenter quits with an error message.
If the DISPLAY variable is not set, or the GUI cannot connect to the window server, then TestCenter quits with an error message.
If you are not running X windows, then TestCenter quits with an error message.
USAGE
The TestCenter startup commands are installed in a CenterLine/bin directory, which could be installed anywhere on your system. The best way to use the commands is to put CenterLine/bin on your path. You can also use the CENTERLINE_HOME environment variable to specify the location of the TestCenter commands. See your system administrator if you don’t know where CenterLine/bin is on your system.
When you start TestCenter, by default it reads commands from the system-wide startup file, named tcenterinit, then from the local startup file, named .tcenterinit, if one exists, in your home directory, or otherwise in your working directory, and finally from a program-specific startup file named proofed_binary_name.tcinit, from the current directory.
TestCenter starts by opening the Main Window. The Main Window contains the Results area, which lists a results file for each run of your program, along with a summary of the results in that file. To examine and deal with any results more closely, invoke one of the graphical browsers by selecting one or more results files and clicking on a Browser button. There are three browsers in the GUI: the Error Browser, the Leak Browser, and the Coverage Browser.
You can collect run-time information about your application over many different test cases by rerunning it using the same GUI. One way to do this is to rerun proofed_binary_name from the shell, using different arguments each time you run your program. You can also rerun proofed_binary_name using the Run and Run With Arguments menu choices from the Run menu in the Main Window. No matter how you run your program, each run of the proofed program creates a new results file.
TO FIND AND FIX A RUN-TIME ERROR
Run your proofed program, either by typing the name of the proofed executable in a shell window, or by choosing Run from the Run menu in the Main Window. As your program executes, a new results file appears in the Main Window.
When an error occurs, the Error Browser automatically opens, displaying the error. To view a different error, click on the folder icon next to the error report you want to examine.
The Source Area in the Error Browser shows you the code where the error occurs. Click on Edit to invoke your editor to fix the error. Click Make to rebuild your application and click Run to run your application again.
If you want to stop execution at an error, start your proofed executable under the control of a debugger (either dbx or pdm). Set a breakpoint in the built-in function, testcenter_stop. When you reach the breakpoint, fix the error TestCenter found there.
You can suppress errors using the Suppress menu.
TO FIND AND FIX A MEMORY LEAK
After your proofed program has finished running, select the most recent results file from the list in the Results area, and click Leaks.
The Leak Browser is very similar to the Error Browser. When the Leak Browser opens, the Source Area shows you the code where the leak occurs. Click on Edit to invoke your editor to fix the leak. Click Make to rebuild your application and click Run to run your application again.
You can suppress errors using the Suppress menu.
TO VIEW CODE COVERAGE RESULTS
Start TestCenter without running your program by using the testcenter command. For example:
$ testcenter my_program.tc
When TestCenter starts up, the Results area in the Main Window lists all the files that contain results for a particular program. Select one or more results files and click Coverage.
To view cumulative results, select more than one results file from the Results area before clicking Coverage. Be sure to select only results files from the same executable.
While you are in the Coverage Browser you can do all of the following:
o View results filtered by function, class, location, and directory.
o View results sorted according to several keys.
o Edit the source code for a particular item in the Results Area.
o View a detailed listing of source code that has not been executed.
CUSTOMIZING TESTCENTER
Use the Options menu choice from the TestCenter menu to specify features you’d like to use. Alternatively, you can specify options in your startup file; see the "Options" section of the TestCenter User’s Guide and Reference.
Select the Add/Change/Delete menu item from the User-Defined menu to create buttons for your particular needs. The User-Defined menu is available from the TestCenter menu in the Main Window.
ENVIRONMENT VARIABLES
CENTERLINE_HOMESet the path to the directory in which TestCenter is installed, such as /usr/local/CenterLine.
EDITORUse this editor (vi or emacs) when editing in TestCenter.
TC_BINARYNAMESearch path for proofed executable (binary).
TC_CACHEUse this value as the name of the cache directory instead of TC.Cache. If TC_CACHE is not set, or set to an empty string, then TestCenter does not cache anything.
TC_COMMENTAssigns its value to the "User comment" field in the Properties Window. The value is set upon program start, and then again upon program exit.
TC_DEBUGGERUse this value as the name of the debugger if the debug_on_error option has been set to be true. If your debugger does not automatically start a shell, specify this option literally as follows, except for debugger_name which stands for the name of the debugger: clxterm -e debugger_name &s &d For instance, to specify gdb, enter the following: setenv TC_DEBUGGER "clxterm -e gdb &s &d Note the space after the -e switch.
TC_FOLLOW_CHILDFollow the child process instead of the parent process in a program that forks.
TC_FREE_QUEUE_LENGTHSet the number of elements for the queue of free memory regions in a proofed program.
TC_FREE_QUEUE_THRESHOLD
Set the element length threshold, respectively, for the queue of free memory regions in a proofed program.
TC_INITFILE filenameUse filename for the TestCenter startup file instead of <proofed_binary_name>.tcinit.
TC_MAX_FRAMESChange the maximum length of a stack frame. The value must be less than or equal to 512, which is the default.
TC_NOGUIDo not start the GUI. If a GUI is not started or connected to, TestCenter prints error and leak information to standard error, in addition to writing the results to the results file.
If TC_SILENT is also set, then TestCenter does not print the results to standard error.
To use TestCenter in conjunction with an existing regression test suite, set the environment variable TC_NOGUI.
TC_RESULTDIR dir_namePut all result files in dir_name.
TC_RESULTFILE filenameOverride the default name for the results file. Result file names cannot have any of the following suffixes: .C, .H, .c, .h, .o
TC_SILENTDo not print results to standard error. If a GUI is not started or connected to, then the error and leak information is printed to standard error.
If TC_SILENT is set, then the results do not get printed to standard error.
TC_UNSET_VALUEChange default value used for unset memory error checking. See the "environment variables" section of the TestCenter User’s Guide and Reference for more information.
SEE ALSO
proof.1 tcreport.1
SunOS 1.0.2 &beta1.0 — Last change: 1 July 1993