Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Parsing error

alperen
alperen Posts: 6

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". Also, I guess, Parasoft need to parse with "gnu.mingw", it doesn't have to compile, and my project contains ordianry c files and headers.

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?

https://forums.parasoft.com/discussion/2768/static-report 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?

Comments

  • Bogdan Czwartkowski
    Bogdan Czwartkowski Posts: 157 admin
    edited September 2017

    Hi alperen,

    This looks like configuration issue, but we will need some more details.

    Copying .cproject and .project from one project to another may seem to fix the problem, but likely CDT- and/or C++test-specific settings are not transfered or not matching when simply copied to a new project.

    One thing I am not clear about is the nature of your gnu.cross.cortexm3 project. Hence a few questions:

    Q1. I assume the cross-project compiles just fine on the local machine, as this is prerequisite for C++test to work on a working (here: compilable) project with toolchain fully operational?

    Q2. Is this also Eclipse-based CDT project, only using a cross-compiler, or is it something else?

    Q3. How is the project built? Within Eclipse or form command line (make, scripts, ...)?

    Q4. Which exact C++test version are you using?

    Q5: Also, it would be very useful to see what exactly the parse errors are about. There can be many reasons, just for a start:

    • missing cross compiler on the PATH - C++test needs to access the toolchain
    • C++test needs to know which cross compiler executable to use, if it is different than default "gcc"
    • C++test needs to have its build settings configured
    • the cross-compile project does not have includes correctly configured
    • ...
  • alperen
    alperen Posts: 6

    Firstly thanks for your interest.

    Yes, you're right. this is a configuration issue. And, I found a way with BDF, I'll explain it briefly at the end.
    Here are my answers to your questions:

    A1: I don't know the details, but most probably NO. But I know that this is a working project, we just need to control its "Coding Standards" according to my company's rule sets.
    A2: Yes, this is an Eclipse based CDT project. I can't detailed it but it is compiled for Arm Cortex M3.
    A3: We built it in an Eclipse based editor..
    A4: Parasoft C++test 9.0. I know it an old version, but thats what we have.
    A5: Parasoft doesn't fully accept our IDE's ".cproject" and ".project" files. Especially, "C/C++ Build" and "C/C++ General" areas in project properties are problematic for Parasoft. Then, I tried opening a new project and adding include directories and compiler settings, but that didn't work.

    Here is how I solved:

    Using BDF approach is recommended 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 "How to create build data file (bdf) in Parasoft?" in Stack Overflow, and somebody answered the question. Here is the link. 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")
    2) Our old command in project "Properties -> C/C++ Build -> Setting -> Command" was:

    I prepend "cpptestscan " to the command:
    cpptestscan
    3) I cleaned and builded the project. 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". Then I run our rule set, and it worked.

  • alperen
    alperen Posts: 6

    Firstly thanks for your interest.

    Yes, you're right. this is a configuration issue. And, I found a way with BDF, I'll explain it briefly at the end.
    Here are my answers to your questions:

    A1: I don't know the details, but most probably NO. But I know that this is a working project, we just need to control its "Coding Standards" according to my company's rule sets.
    A2: Yes, this is an Eclipse based CDT project. I can't detailed it but it is compiled for Arm Cortex M3.
    A3: We built it in an Eclipse based editor..
    A4: Parasoft C++test 9.0. I know it an old version, but thats what we have.
    A5: Parasoft doesn't fully accept our IDE's ".cproject" and ".project" files. Especially, "C/C++ Build" and "C/C++ General" areas in project properties are problematic for Parasoft. Then, I tried opening a new project and adding include directories and compiler settings, but that didn't work.

    Here is how I solved:

    Using BDF approach is recommended 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 "How to create build data file (bdf) in Parasoft?" in Stack Overflow, and somebody answered the question. Here is the link. 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")
    2) Our old command in project "Properties -> C/C++ Build -> Setting -> Command" was:

    I prepend "cpptestscan " to the command:
    cpptestscan
    3) I cleaned and builded the project. 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". Then I run our rule set, and it worked.