Appling C++Test unit tests to library projects using Code Composer 7 embedded
Greetings,
I'm trying to generate unit tests for a code base that implements a library for an embedded application built for Code composer. Unlike the Parasoft Visual Studio version, the CCS 7 system doesn't seem to understand how to run the linker for the TI compiler on a 'project' that only creates an library archive.
Do I need to instrument the 'Parasoft build' properties to enable the linker -- if so is there an example available?
My current 'simplistic' solution is to generate a 'Unit Test' project that links the library code as an executable. I'm hoping there is a more elegant solution available.
Best Answers
-
Hello,
The default strategy that C++test applies is to take the linker options from the original project settings. This in case of library projects has an obvious disadvantage - executable binary can't be built.The approach with an additional project makes perfect sense. If you would like to avoid creating additional projects only for testing purposes, you can consider editing linker settings in the original project's C++test build settings. You can insert all required linker options to the:
Project Properties->Parasoft->C++test->Build Settings-> Linker optionsBy default this options field will have the following content:
${cpptest:original_options}You can remove this variable if you want to prevent C++test from adding linker (archiver) options taken from the original project's settings, and just enter there all the options that are required to link the test executable. Important: C++test will take care of appending objects, all you need to specify is linker flags, like the location of linker script, target specification, etc...
Hope that helps
5 -
Mirek,
Thanks for the quick response. I am going with a standalone unit test application as the target is also remote and configuring the jtag and loader for each library without CCS7 support would be problematic.0