Search code examples
ctestingarmparasoft

Parasoft skips all the files without testing


I am trying to check "Coding Standarts" of our project with Parasoft. This is a C project which uses "gnu.cross.cortexm3". I open this project with Parasoft and try to test it with "Example Configurations" but it skips all the files in project and doesn't check any file.

When I create a new simple makefile C project(Hello World) which uses "gnu.mingw" and try to test it with "Example Configurations", it works and it checks the main file's coding standarts.

When I copy this makefile project's ".cproject" and ".project" files and paste them to the first project, Parasoft starts testing, doesn't skip files but give this error:

Coding Standards checker: error during parsing file.

Using different project files can be sounds wrong, but it works for fixing the problem about "skipping all files"

I reviewed diff result of those project files, generally the line differences are about "gnu.mingw" and "gnu.cross.cortexm3" but, of course, I don't know details of those files, eclipse knows them. What should I do to use Parasoft in our finished project?

Here is a discussion about the "Skipping all files" problem. They recommends using "Build data file(bdf)". Parasoft user guide shows how to create bdf in makefile projects. But how can I create bdf file for this project?


Solution

  • The problem was that Parasoft couldn't compile and link the project, because it couldn't solve build configurations in ".cproject" and ".project" files which are created by our project IDE.

    Here is how I solved:

    Using BDF approach is recommended in here . Then, I read the Parasoft User Guide to learn how to use BDF, but I couldn't figure it out. Because, everything is based on makefile project in the user guide, and our project doesn't have any specific makefile, it generates its makefile automatically(selected in properties). After that, I asked this question in Stack Overflow, and this answer was so helpful and obvious. It is so easy:

    1. I added my Parasoft directory in PATH.(In my case it is "C:\Program Files (x86)\Parasoft\C++test\9.0")

      Our old command in project "Properties -> C/C++ Build -> Setting -> Command" was:

      <arm_compiler_name> <args>
      
    2. I prepend "cpptestscan " to the command:

      cpptestscan <arm_compiler_name> <args>
      
    3. I cleaned and builded the project again. Then, it created "cpptestscan.bdf" file in its output directory.

    4. I created a new project in Parasoft with "New Project -> C++ Test -> Create project from a build data file" with "cpptestscan.bdf". Then I run example rule set, and it worked.