cpptestcli doesn't function properly

NovodesNovodes Posts: 9

I recently received a license for parasoft and I set everything up on my machine.
I even ran a flow analysis on my code with the desktop app together with the local parasoft rep.
I am now trying to run parasoft using the command line using cpptestcli.
I set things up as written here:
I am following the examples from this page: https://docs.parasoft.com/display/CPPTEST1040/Command+Line+Options
and yet they simply don't work.

For example:
C:\Users\Eyal\Documents\PNG_ManifestRepo\PNG_ND_APPLICATION\Src>cpptestcli -machineID
gives me the following:
_Parasoft C/C++test Professional 2021.1.0 ( -- Copyright (C) 2021 Parasoft Corporation

Using default workspace "C:\Users\Eyal\parasoft\workspace"
ERROR: Error: Missing parameter: -config_

What am I doing wrong?



  • Bogdan CzwartkowskiBogdan Czwartkowski Posts: 141 admin

    Hello @Novodes ,

    Can you try running the command "cpptestcli -machineid" (with small letters only)?

    If you run "cpptestcli -help", it will print an exact form of the options we expect, for example, the machine identifier option is as follows:

        Prints machine id.
  • NovodesNovodes Posts: 9

    Hi @Bogdan Czwartkowski ,
    Thanks for your reply. Yes that was the issue with that specific command. Once I wrote it correctly there was no issue.

    However, I am still incountering difficulties with other commands.
    For example the command -compiler:

    C:\Windows\System32>cpptestcli -compiler armclang_6_6
    Parasoft C/C++test Professional 2021.1.0 ( -- Copyright (C) 2021 Parasoft Corporation
    Using default workspace "C:\Users\Eyal\parasoft\workspace"
    ERROR: Error: Missing parameter: -config

    Can you please help with that?

  • Bogdan CzwartkowskiBogdan Czwartkowski Posts: 141 admin
    edited August 11

    Hi @Novodes ,

    First a couple remarks:

    • From your output I see that you are running C/C++test Professional Edition v. 2021.1. The -compiler option is not valid for this edition (-compiler is used by C/C++test Standard Edition). With C/C++test Professional you need to have a project configured in your workspace. C/C++test configuration for the project, including compiler settings, is available in project properties and this is where you need to select your compiler. See here: https://docs.parasoft.com/display/CPPTESTPROEC20211/Setting+Project+and+File+Options
    • Also, I would avoid running the tool under C:\Windows\system32 - this is folder of the operating system, and it is better not to do any work there. C/C++test may need to save some temporary data or output files in the current folder, so it is best to run it in a dedicated folder or in the folder of the project that you want to analyze.

    Now, back to the -config option:
    C/C++test can perform many types of analyses and tests. Therefore, in order to run C/C++test from command line, you need to tell C/C++test what it is exactly you want to do in particular run, and the means to do that is to specify test configuration via the -config option.
    I assume here that you are familiar with the concept of C/C++test test configurations. If not, here is the relevant documentation page: https://docs.parasoft.com/display/CPPTESTPROEC20211/Concepts+and+Terms#ConceptsandTerms-TestConfigurations

    List of built-in configurations for the latest C/C++test 2021.1 is here: https://docs.parasoft.com/display/CPPTESTPROEC20211/Built-in+Test+Configurations
    You can also get it by running "cpptestcli -list-configs" (again "cpptestcli -help" to the rescue).

    In your case, to run e.g. builtin flow analysis configuration, you would need to use -config option like this:
    cpptestcli -config "builtin://Flow Analysis" <other cpptestcli options>

  • NovodesNovodes Posts: 9

    Thanks. I will try and update.

  • NovodesNovodes Posts: 9
    edited August 12

    Hi @Bogdan Czwartkowski ,
    I have had some progress, yet a few things are not clear to me and I would appreciate your help.

    So I am now running the cpptestcli from within the workspace of parasoft under documents/parasoft/PROJECT_NAME.
    However, when I run it, it claims that no files are found so the analysis runs but on zero files. Here is a screenshot of my project folder under the parasoft workspace:

    And this is the output from the command line:

    And this is the same project under parasoft IDE with the analysis report when run within the parasoft IDE:

    As you can see in the Parasoft IDE, the same analysis run within the parasoft IDE works and reviews all the files. But when run from command line it does not run on any file.

    I think I need to define the scope by defining the input:

    I manged to create a bdf file but I cannot refer to it because I get this error:
    ERROR: Error: unknown option: -input (supported in C/C++test Standard only)
    This is what I wrote:

    C:\Users\Eyal\Documents\parasoft\TestFW_Fusa>cpptestcli -config "builtin://Find Duplicated Code" -input %cd%\..\..\PNG_ManifestRepo\PNG_MCU_STM32WB55RGVX\cpptestscan.bdf
    Parasoft C/C++test Professional 2021.1.0 ( -- Copyright (C) 2021 Parasoft Corporation
    Using default workspace "C:\Users\Eyal\parasoft\workspace"
    ERROR: Error: unknown option: -input (supported in C/C++test Standard only)
    HINT: Command line contains the option(s) only supported in C/C++test Standard.
    Modify the command line with C/C++test Professional options or consider using C/C++test Standard.
    See the C/C++test User Guide for details or contact Parasoft Support.
  • NovodesNovodes Posts: 9

    Hi @Bogdan Czwartkowski ,
    Please ignore my previous comment.
    So I managed to run everything and it works fine!
    Thanks for the help. I battled a lot with defining the scope of the project until I realized that the input field is not applicable to version of parasoft I have (professional). I also realized that it was automatically targeting the default workspace location instead of the folder I was currently at. So I modified the targeted location with the -data variable. Then everything worked fine. Finally...

    However, this is not so good for me in terms of automation. Because my plan is to automatically run the analysis on the project every run and I need to be able to define the scope not only from within the IDE. I want to use a bdf file. I managed to create it but I cannot use the -input field in my version of parasoft. Do you know how I could enable it nonetheless? I mean, professional seems to be more advanced than "standard" and yet I have greater limitations... this seems odd.


  • NovodesNovodes Posts: 9
    edited August 19

    I gave up and just installed the Standard edition and this way I can use the bdf file repeatedly without an issue.

    I used the following command to run the analysis:

    cpptestcli -input "cpptestscan.bdf" -report "C:\Users\Eyal\Documents\PNG_ManifestRepo\PNG_MCU_STM32WB55RGVX\reports" -config "C:\Users\Eyal\Documents\parasoft\My_Find Duplicated Code.properties" -compiler armclang_6_6

    So the issue is resolved for me.

Sign In or Register to comment.