Skip to content

Instantly share code, notes, and snippets.

@daparic
Last active December 16, 2024 06:26
Show Gist options
  • Select an option

  • Save daparic/01faa3778fac7bb877e1be67e8586af4 to your computer and use it in GitHub Desktop.

Select an option

Save daparic/01faa3778fac7bb877e1be67e8586af4 to your computer and use it in GitHub Desktop.

https://docs.parasoft.com/display/CPPTESTPROVS20242/Testing+from+the+Command+Line+Interface

Demo project location

C:\Users\dx\src\demo-visualstudio>git remote -v
origin  git@github.com:daparic/demo-visualstudio (fetch)
origin  git@github.com:daparic/demo-visualstudio (push)

Must use cpptestcli from this location

C:\Users\dx\src\demo-visualstudio>where cpptestcli
c:\Program Files\Parasoft\C++test for Visual Studio (x86_64)\10.7\cpptestcli.exe
D:\parasoft\2024\parasoft_cpptest_professional-2024.2.0-win32.x86_64\cpptest\bin\cli\cpptestcli.exe

Do SA on demo-visualstudio.sln

C:\Users\dx\src\demo-visualstudio>cpptestcli -config "builtin://Effective C++" -solution demo-visualstudio.sln -report report1
Parasoft C/C++test Professional 2024.2.0 (10.7.1.20241115B2628) -- Copyright (C) 2024 Parasoft Corporation
Parasoft Test 10.7.1.202411141540 -- Copyright (C) 2024 Parasoft Corporation

Sending usage data is enabled
 License: Initializing local license for C++test 10.7
 License: Activating Custom Edition
 License: Checking features
 License: Main C++test feature: License is valid
 License: Static Analysis feature: License is valid
 License: Automation feature: License is valid
 License: DTP Publish feature: License is valid
 License: Unit Test feature: License is valid
 License: Coverage feature: License is valid
 License: Desktop Command Line feature: License is valid
 License: Embedded Support feature: License is valid
 License: AUTOSAR Rules feature: License is valid
 License: CWE Rules feature: License is valid
 License: DISA STIG Rules feature: License is valid
 License: HIC++ Rules feature: License is valid
 License: JSF Rules feature: License is valid
 License: MISRA Rules feature: License is valid
 License: MISRA C 2012 Rules feature: License is valid
 License: MISRA C++ 2023 Rules feature: License is valid
 License: OWASP Rules feature: License is valid
 License: Security Rules feature: License is valid
 License: SEI CERT C Rules feature: License is valid
 License: SEI CERT C++ Rules feature: License is valid
 License: Coverage Advisor feature: License is valid
 License: Code Dependency Export feature: License is valid
 License: Requirements Traceability feature: License is valid
 License: Flow Analysis feature: License is valid
 License: Rule Wizard feature: License is valid
 License: Runtime Error Detection feature: License is valid
 License: Assembly Coverage feature: This feature is not included in the current license
 License: Activation finished: License is valid
 License: Machine id WIN32-3c29da18 (Default)
 INFO: No resources specified as scope, using all workspace projects as selected scope.

 > [0%] Running: Scope
 > [3%] Computing scope
 >>    [3%] Initializing
 >>    [9%] Building
 >>    [13%] Finding files
 >>    [14%] Computing selection for demo-visualstudio
 >>    [15%] Finding files
 >>    [17%] Applying scope filters
 >>    [19%] Computing lines to check
 > [21%] Preparing options
 >>    [21%] demo-visualstudio
 >>    [25%] Reporting scope results
 Total Files: 13
 Source Files to Check: 13
 Total Source Lines: 432
 Source Lines to Check: 432
 Test Data Files: ---
 Excluded Files: 0
 > [31%] Running: Static
 > [33%] Static analysis (C/C++ Static Analysis) - 95 rules enabled
 Files Checked:
     C/C++ Static Analysis: 13/13  Skipped: 0
 Failed Runs: 0
 Violations Found: 37
 Violations Suppressed: 1
 Number of Rules Violated: 12
 > [63%] Finished
 > [80%] Generating reports
 > [100%] Done
@daparic

daparic commented Dec 16, 2024

Copy link
Copy Markdown
Author

SA result has co-dependency

Test1

cpptestcli -config "builtin://Effective C++" -solution demo-visualstudio.sln -report report2 -resource "demo-visualstudio/Source Files/ATM.cpp" -resource "demo-visualstudio/Header Files/ATM.h"

Test2

cpptestcli -config "builtin://Effective C++" -solution demo-visualstudio.sln -report report1 -resource "demo-visualstudio/Source Files/ATM.cpp"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment