How to setup Teat RealTime to not analyse macro in source code

Technote (FAQ)


Question

How do you get macro in source code not to be analysed when using IBM Rational Test RealTime?

Cause

Your source code includes a macro, for example SAMPLE_CRITICAL_SECTION(), while you do not like the macro not to be alalysed during test by changing the source code as shown below.

#ifdef RTRT_REST
#pragma attol stop_analyze
#endif
SAMPLE_CRITICAL_SECTION( )
#ifdef RTRT_REST
#pragma attol start_analyze
#endif

Note: SAMPLE_CRITICAL_SECTION( ) is a macro.


Answer

SAMPLE_CRITICAL_SECTION is already a macro so you can change its definition in the parser settings or even on the preprocessing command line through -D option in Rational Test RealTime.

For example, change the definition using the preprocessing command line as follows:

  1. Go to Build > Compiler > Preprocessing-only flags

  2. Add the following parameter:
    • -DSAMPLE_CRITICAL_SECTION=";//"
      or
    • -DSAMPLE_CRITICAL_SECTION="#pragma attol stop_analyze;<actual code>;#pragma start_analyze"

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Test RealTime
General Information

Software version:

8.0

Operating system(s):

Windows

Reference #:

1633200

Modified date:

2013-04-03

Translate my page

Machine Translation

Content navigation