简体   繁体   中英

Code insertion when C file included in the PTU

For example I have C file which contains functions A, B and C. A is my function under test (unit test). A() calls B() and C(). I wan't make B() and C() stubs rather than real functions. Since B() and C() are defined in the same C file, I should "-rename" to make them stubs (refer https://www-01.ibm.com/support/docview.wss?uid=swg21125279 ). This works fine, I get the test report and coverage report.

Now I want run the same test without any code insertion (ie, non-instrumentation). For that, I changed the C file property "instrumented" to "No" and unticked "Code Coverage" option from "Build Settings". When build the node i get error saying B() and C() redefined. In the above link it is stated that, "-rename" do not work with non-instrumentation. For non-instrumentation, what could be the solution in this scenario?

One thing I did is excluded C file from the node (by cross marking it) and included the file in PTU itself. Test executes fine, however I'm not sure whether code insertion happened or not. I believe no code insertion happened because I didn't enable "Code Coverage" in the "Build Setting"

RTRT中的-RENAME选项只能与已检测的源文件一起使用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM