Skip to main content

skip to main content

developerWorks  >  Rational  >

Using IBM Rational Test RealTime and the Microsoft Visual Studio Plug-In

developerWorks
Document options

Document options requiring JavaScript are not displayed


New site feature

Check out our new article design and features. Tell us what you think.


Rate this page

Help us improve this content


Level: Introductory

Fiona Foster (ffoster@ca.ibm.com)IBM

09 Jun 2005
Updated 14 Nov 2005

In this article, Fiona Foster discusses how to install and use the Test RealTime plug-in for Microsoft Visual Studio. Also included are general hints and troubleshooting guidelines.

The IBM® Rational Test RealTime™ product (on Microsoft Windows® installations only) includes an integration with Microsoft® Visual Studio®. In order for the integration to work properly, Visual Studio and Test RealTime must be installed on the same workstation.

Before you are able to use the two products together, the plug-in must be installed by doing the following:

From the Windows Start Menu, click Programs > Rational Software > Test RealTime > Tools > Install Rational Test RealTime add-in for Microsoft Visual Studio 6.0

NOTE: The plug-in has to be installed for each user. Furthermore, Visual Studio must have been run at least once by the user, and it cannot be running when the plug-in is installed.

When the plug-in has been installed you should see a dialog box like that shown in Figure 1 following:


Figure 1. Installation confirmation dialog box
Installation confirmation dialog box

If a previous version of the plug-in has been installed, see the following troubleshooting section to ensure that it has been properly uninstalled before installing the new version.

Check your system settings

Prior to using the integration, there are a few things to check to avoid possible compile errors.

Check a registry key.

  1. Launch the registry by clicking Start > Run > Regedit
  2. Navigate to:
    HKEY_CURRENT_USER/Software/Microsoft/DevStudio/BuildSystem/Components/Platforms/Win32(x86)/Directories
  3. Double-click the key Path Dirs and make sure that the following is not listed:
    C:\Program Files\Rational\Test RealTime\targets\cvisual6\cmd

Verify an environment variable

  1. To make sure that the environment variable ATLTGT is not set, click Start > Settings > Control Panel > System > Advanced > Environment Variables
  2. If ATLTGT is listed, please highlight it and click Delete


Figure 2. Verifying the value of the environment variable ATLTGT
Verifying the value of the environment variable ATLTGT

Enable integration

  1. Open Visual Studio and open the project you wish to instrument.
  2. Click Tools > Rational Test RealTime Options and examine the dialog box (shown in Figure 3 following).Note that all the controls are grayed out, as the plug-in has not been enabled.
  3. Clicking Enable will enable the plug-in. Now the button reads Disable, and the controls are no longer grayed out.


Figure 3. Enabling the plug-in
Enabling the plug-in

  1. After enabling the plug-in, you should set the specific options for RunTime Analysis by setting the appropriate options that you wish to use on your Visual Studio project.

    • Levels
      • Functions
      • Calls
      • Blocks
      • Conditions
    • Instrumentation Mode
    • Ternary
    • Dump
    • Trace
    • Memory Profiling
    • Performance Profiling
  2. After setting these options, click Apply and then click OK.


Figure 4. Plug-in enabled and options selected
Plug-in enabled and options selected



Back to top


Building a Visual Studio project using the plug-in

Now that the plug-in has been enabled and all the options have been set, you are ready to build and compile the Visual Studio Project.

Build the project

  1. If the project has not already been opened, please open the project by clicking File > Open
  2. Build the project by clicking Build > Build <project_name> (where <project_name> is the name of the project)
  3. When building, you should see something like the following in the Build Log:
myfirstVCDlg.cpp
TestRT attolccp - INFO: C++ Calls coverage not supported yet
TestRT attolccp - INFO: C++ Conditions coverage types not supported yet
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl _atc9521.cpp
   -nologo
   -MDd
   -W3
   -Gm
   -GX
   -ZI
   -Od
   -DWIN32
   -D_DEBUG
   -D_WINDOWS
   -D_MBCS
   -D_AFXDLL
   -FdDebug/
   -FD
   -GZ
_atc9521.cpp
Linking...

myfirstVC.exe - 0 error(s), 0 warning(s)

Note: The only way to see that the files are being instrumented is that each file gets "compiled" twice by "cl" (first the file is preprocessed, and then the instrumented file is compiled). The telltale sign is that files prefixed with "_atc" are compiled. These are instrumented files.

myfirstVCDlg.cpp
TestRT attolccp - INFO: C++ Calls coverage not supported yet
TestRT attolccp - INFO: C++ Conditions coverage types not supported yet

Execute the project

In order to generate the Test RealTime reports, you must first run the project.

  1. Please run the application by clicking Build > Execute <project_name> (where <project_name> is the name of the project)
  2. Shut down the application

View the results

There are 2 ways to view the results.

From within Visual Studio:

  1. Click Tools > Rational Test RealTime Viewer
  2. Visual Studio will then launch and load all the reports automatically

Via the command line:

  1. Depending on what runtime features were selected in the Build, you should see the following files located in the same directory as where your project resides:
    • .tio, .fdc - code coverage report files
    • .tsf, .tdf - runtime tracing report files
    • .tsf, .tpf - memory profiling report files
    • .tsf, .tqf - performance profiling report files
  2. After building and running a Test RealTime executable, a trace file - atlout.spt (dump file) - is produced
  3. Split the trace file by opening up a DOS window, changing to the directory where the project resides, and typing atlsplit atlout.spt
  4. After the split of the trace file you should see the following: Splitting 'atlout.spt' traces file...
    Traces file successfully split.
  5. From the command line, load the files that were generated by the split--coverage (*.fdc), trace (*.tsf), memory profiling (*.tpf), and performance profiling (*.tqf) by typing studio *.fdc *.tsf *.tpf *.tqf *.tio
  6. The Test RealTime GUI then launches and displays the results
  7. You can also use the Test RealTime GUI: click File > Browse Reports and select the directory that contains the *.fdc *.tsf *.tpf *.tqf files.


Back to top


General troubleshooting

When attempting to troubleshoot, the first thing to do is quit Visual Studio, then remove and reinstall the plug-in.

Reinstall Test RealTime

  1. Quit Visual Studio.
  2. Uninstall the plug-in: from the Windows Start Menu click Programs > Rational Software > Test RealTime > Tools > Install Rational Test RealTime add-in for Microsoft Visual Studio 6.0
  3. Now clean the registry: click Start > Run and type regedit
  4. Navigate to:

    HKEY_CURRENT_USER/Software/Microsoft/DevStudio/BuildSystem/Components/Platforms/Win32(x86)/Directories
  5. Double click Path Dirs and remove all paths that contain "Test RealTime"
  6. Navigate to the following key and delete it:

    HKEY_CURRENT_USER\Software\Rational Software\Test RealTime
  7. Now re-install the plug-in by clicking Start > Programs > Rational Software > Test RealTime->Tools > Install Rational Test RealTime add-in for Microsoft Visual Studio 6.0

IMPORTANT: Visual Studio must not be running. The plug-in needs to be installed for each user.

Other user questions

Question: When trying to build, the following error is displayed in the Build Log. What should I do?

Compiling...
Error 3: Test RealTime not properly installed
Error executing cl.exe.

Solution 1: This could indicate that the cl.exe in the TDP was running while the plug-in was being installed or configured, which means that the cl.exe in the TDP cannot find the options used to instrument. Ensure that the TDP directory is not in the path.

There are also a few other things to check when this error displays. One possible cause is that the Test RealTime plug-in for Microsoft Visual Studio has not been installed.

This can be done from Start > Programs > Rational Test RealTime > Tools > Install Rational Test RealTime Plug-In for Microsoft Visual Studio 6.

Solution 2: If the plug-in is correctly installed, please check the following keys:

HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build
System\Components\Platforms\Win32 (x86)\Directories

Here, you should find the Path Dirs key (and some other keys):

Path Dirs = <something>, where the path to the target package of TestRT Coverage should come first.
HKEY_CURRENT_USER\Software\Rational Software\Test RealTime\<version>\Coverage

Restore Path = <your initial path>, where <version> corresponds to the version of Test RealTime that is installed.

Solution 3: Make sure that the environment variable ATLTGT is not set.

Click Start > Settings > Control Panel > System > Advanced > Environment Variables

If ATLTGT is listed, highlight it and click Delete.

For more information, please refer to the following solutions:

http://www-1.ibm.com/support/docview.wss?rs=945&context=SSSHUF&q1=graphical&uid=swg21132129&loc=en_CA&cs=utf-8&lang=en+en

http://www-1.ibm.com/support/docview.wss?rs=945&context=SSSHUF&q1=cl.exe&q2=visual+studio&uid=swg21131539&loc=en_CA&cs=utf-8&lang=en

Question: After successfully executing the application, when I try to view the results in the Test RealTime GUI, no graphical information is displayed. Why?

Solution: After you execute the project, the atlout.spt file (which should reside in the same directory where your project is saved) is produced. This atlout.spt file needs to be split by running the following command from a DOS window:

atlsplit atlout.spt

After a successful split, you should see something similar to the following:

Splitting 'atlout.spt' traces file...
Traces file successfully split.

Now you are ready to view the results, and there are two ways in which this can be accomplished:

  • Via the command line
  • Via the Test RealTime GUI (File > Browse Reports)

Via the GUI

When you view the reports, you also have to open the corresponding static file (.tsf) or trace file (.tdf), depending on the type of coverage you selected for the project.

The following is a list of the corresponding file formats:

  • .tio, .fdc - code coverage report files
  • .tsf, .tdf - runtime tracing report files
  • .tsf, .tpf - memory profiling report files
  • .tsf, .tqf - performance profiling report files

When opening the report file in Visual Studio, make sure that the dynamic or static file is also opened. For example:

  1. Click Files > Browse Reports > Add purifylt.tpf
  2. Click Files > Browse Reports > Add .tpf (or .tqf, .tdp or other files applicable to the project, which may include some or all of these).

    Note: The .tsf files may reside in a different directory.

  3. Click Open

Once the .tsf static/dynamic file are opened together, the graphical information will display.

Via the command line

Note: Make sure that you are in the directory in which you saved the project.

  1. For Memory Profiling, type studio <your_file>.tpf *.tsf
  2. For Performance Profiling, type studio <your_file>.tqf *.tsf
  3. For Runtime Trace, type studio <your_file>.tdf *.tsf
  4. For Code Coverage, type studio <your_file>.tio *.fdc

    Note: unless specified differently during the split, the Coverage report file is named attolcov.tio.

  5. For all runtime analysis components, type studio *.tsf *.fdc <your_file>.tpf <your_file>.tqf <your_file>.tdf <your_file>.tio

For more information, please refer to the following Solution on the external website:

http://www.ibm.com/support/docview.wss?rs=945&context=SSSHUF&q1=graphical&uid=swg21130549&loc=en_CA&cs=utf-8&lang=en+en



Resources



About the author

Fiona was hired by IBM Rational in July 2000 to support the Rational Rose RealTime product. For the past two and a half years she has supported Test RealTime by writing technotes and whitepapers, and delivering training for the Test RealTime product.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top