Custom compiler with cpptestcli

ThomasMooreThomasMoore Posts: 7

Is there a way to specify the custom compilers path when using cpptestcli from version 10.4.2 of the professional edition? I've tried setting the value in the Parasoft/Configurations screen and then exporting the localsettings with Configurations selected, but no values are exported. We would prefer to not have to manually install the compiler settings into the cpptest installation folder if at all possible.


  • brian_nucklesbrian_nuckles Posts: 32 admin
    edited April 2020

    @ThomasMoore You may be looking for the compiler.dir.user property.
    After specifying the user compiler directory you should be able to refer to its name with the -compiler flag.

  • ThomasMooreThomasMoore Posts: 7

    The -compiler flag is not supported in the Professional version of C/C++test according to the output of cpptestcli below.

    $ cpptestcli -data . -config -compiler ceel_1_0_4
    Parasoft C/C++test Professional -- Copyright (C) 2019 Parasoft Corporation
    Parasoft Test -- Copyright (C) 2010-2019 Parasoft Corporation
    ERROR: Error: unknown option: -compiler (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.

    Where is the "cpptest.compiler.dir.user" property provided? I tried setting it in the file that is passed via the -localsettings command line parameter, but it still complains about not being able to find the compiler.

  • mhernandezmhernandez Posts: 8 admin

    @Thomas Moore In C++test Professional: the configuration files should be saved at: .metadata.plugins\com.parasoft.xtest.checkers.eclipse.core.cpp/compilers

    In C++test Standard, the "cpptest.compiler.dir.user" property is used to specify the directory where the compiler files are at.

  • brian_nucklesbrian_nuckles Posts: 32 admin

    Hi Thomas, the link above also describes the property to set inside the localsettings file named, this may allow you to specify ceel_1_0_4 in the properties file itself. The error you received was due to the version of C/C++test installed. The Professional version is designed to be run through the GUI of Eclipse or Visual Studio and lacks some of the more intricate features (like the -compiler flag) as the C/C++test Standard version. Standard is designed to be run in automation/headless/embedded environments and contains the full custom compiler functionality mentioned above. It can be downloaded from the customer portal and licensed using your existing key.

  • ThomasMooreThomasMoore Posts: 7

    I downloaded the standard version, but it's not working with the license I'm able to use with the professional version. Any ideas?

    $ ~/parasoft/cpptest/cpptestcli -config -localsettings localsettings
    Parasoft C/C++test Standard -- Copyright (C) 2019 Parasoft Corporation

    Loading preferences...
    Checking license...
    License: Activation failed: Cannot connect to license server.
    License: Machine id LINUX2-479cd542

    ERROR: License not set - aborting

    HINT: license settings can be added to /
    or to a custom configuration file (-localsettings )
    HINT: for network license, specify the following settings:
    HINT: for local license, specify the following settings:

    $ cat localsettings
    cpptest.license.custom_edition_features=Static Analysis, Flow Analysis, Unit Test, Rule Wizard, Desktop Command Line, Embedded Support, Code Review, Runtime Error Detection, DTP Publish, Coverage, Assembly Coverage, AUTOSAR Rules, HIC++ Rules, JSF Rules, MISRA Rules, MISRA C 2012 Rules, Security Rules, SEI CERT C Rules, SEI CERT C++ Rules

  • mzwawamzwawa Posts: 19

    Hi Thomas,
    in the localsettings file you use the properties:[server][port]
    this means that you are trying to connect to a standalone License Server. Is that true?
    Probably you also need this one:
    However, if you want to get a license from the DTP License Server, then you should use the properties like:
    cpptest.license.custom_edition_features=C++test, Static Analysis, Flow Analysis, Unit Test, Rule Wizard, Desktop Command Line, Embedded Support, Code Review, Runtime Error Detection, DTP Publish, Coverage, Assembly Coverage, AUTOSAR Rules, HIC++ Rules, JSF Rules, MISRA Rules, MISRA C 2012 Rules, Security Rules, SEI CERT C Rules, SEI CERT C++ Rules

  • ThomasMooreThomasMoore Posts: 7

    Yes, I'm trying to use a standalone license server as we don't have DTP setup. However, I'm still getting the same error when adding to the settings file.

    Can the standard edition run unit tests developed in the professional version? It looks like the standard edition can only perform static analysis and analysis of unit tests performed in other unit test tools.

  • mzwawamzwawa Posts: 19

    Hi Thomas,
    I've checked the license settings for standalone license server and it looks that they are different for C/C++test Standard and Professional.
    The common part is:
    cpptest.license.use_network=true[server name]

    specific for Standard:

    and for Professional:

    To answer your second question:
    Unit tests created in Professional can be only executed in Professional. Standard can only run static code analysis and execute unit tests created in other tools.

  • ThomasMooreThomasMoore Posts: 7

    Going back to my original question. Since only the professional version can run the unit tests we've developed, and we need to cross-compile in order to run the unit tests, the only way to use the professional cpptestcli with a custom compiler is to manually copy the compiler into either the C/C++test installation folder or into the workspace folder? There's no equivalent to the "cpptest.compiler.dir.user" property in C/C++test Professional?

    Note that the only reason I've created a custom compiler is to remove the inclusion of cpptestruntime.lib in the linker command because I need to cross compile the runtime library and not use the pre-compiled one. The compiler is GCC-based and I can change the paths to the compiler in the Project settings, which works except for the need to remove cpptestruntime.lib from the linker settings. Is creating a custom compiler the only way to make this work?

  • Andrey MadanAndrey Madan Posts: 362 ✭✭✭

    @ThomasMoore - You cannot execute parasoft unit testing framework using C/C++test standard edition. You need to use C/C++test Professional for that. What is the name of your company? Let me know more details - [email protected]

  • JeffEstesJeffEstes Posts: 102 admin

    Just to let others know on this thread. I am connected with Thomas and will answer his questions on this.

Sign In or Register to comment.