Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 33 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,87 +32,75 @@ The python scrip `vcast_exec.py` is the main driver for build/execute VectorCAST
The api for vcast_exec.py follows:

```
usage: vcast_exec.py [-h] [--build-execute] [--build | --incremental]
[--output_dir OUTPUT_DIR] [--source_root SOURCE_ROOT]
[--html_base_dir HTML_BASE_DIR] [--cobertura]
[--cobertura_extended] [--lcov] [--junit] [--export_rgw]
[--sonarqube] [--pclp_input PCLP_INPUT]
[--pclp_output_html PCLP_OUTPUT_HTML]
[--exit_with_failed_count [EXIT_WITH_FAILED_COUNT]]
[--check_build_log] [--aggregate] [--metrics]
[--fullstatus] [--utfull] [--tcmr] [--noindex]
[--jobs JOBS] [--ci] [-l LEVEL] [-e ENVIRONMENT]
[--gitlab | --azure] [--print_exc] [--timing] [-v]
[--version]
[ManageProject]
usage: vcast_exec.py [VectorCAST Project]
[-h/--help]
[--build-execute] [--setup SETUP] [--use_imported_result IMPORTEDRESULTS] [--build | --incremental]
[--output_dir OUTPUT_DIR] [--source_root SOURCE_ROOT] [--html_base_dir HTML_BASE_DIR]
[--cobertura] [--cobertura_extended] [--lcov] [--junit] [--export_rgw] [--sonarqube]
[--pclp_input PCLP_INPUT] [--pclp_output_html PCLP_OUTPUT_HTML]
[--exit_with_failed_count] [EXIT_WITH_FAILED_COUNT]] [--exit_with_failed_comp [EXIT_WITH_FAILED_COMP] [--check_build_log]
[--aggregate] [--metrics] [--fullstatus] [--utfull] [--tcmr] [--noindex]
[--jobs JOBS] [--ci] [-l LEVEL] [-e ENVIRONMENT] [--gitlab | --azure]
[--print_exc] [--timing] [-v/--verbose] [--version]

positional arguments:
ManageProject VectorCAST Project Name

optional arguments:
options:
-h, --help show this help message and exit

Script Actions:
Options for the main tasks

--build-execute Builds and exeuctes the VectorCAST Project
--setup SETUP Path to setup_env.bat/.sh (optional)
--use_imported_result IMPORTEDRESULTS
Use existing VCR file from repository for CBT via Imported Results
--build Only builds the VectorCAST Project
--incremental Use Change Based Testing (Cannot be used with --build)

Metrics Options:
Options generating metrics

--output_dir OUTPUT_DIR
Set the base directory of the xml_data directory.
Default is the workspace directory
Set the base directory of the xml_data directory. Default is the workspace directory
--source_root SOURCE_ROOT
Set the absolute path for the source file in coverage
reporting
Set the absolute path for the source file in coverage reporting
--html_base_dir HTML_BASE_DIR
Set the base directory of the html_reports directory.
The default is the workspace directory
Set the base directory of the html_reports directory. The default is the workspace directory
--cobertura Generate coverage results in Cobertura xml format
--cobertura_extended Generate coverage results in extended Cobertura xml
format
--cobertura_extended Generate coverage results in extended Cobertura xml format
--lcov Generate coverage results in an LCOV format
--junit Generate test results in Junit xml format
--export_rgw Export RGW data
--sonarqube Generate test results in SonarQube Generic test
execution report format (CppUnit)
--sonarqube Generate test results in SonarQube Generic test execution report format (CppUnit)
--pclp_input PCLP_INPUT
Generate static analysis results from PC-lint Plus XML
file to generic static analysis format (codequality)
Generate static analysis results from PC-lint Plus XML file to generic static analysis format (codequality)
--pclp_output_html PCLP_OUTPUT_HTML
Generate static analysis results from PC-lint Plus XML
file to an HTML output
Generate static analysis results from PC-lint Plus XML file to an HTML output
--exit_with_failed_count [EXIT_WITH_FAILED_COUNT]
Returns failed test case count as script exit. Set a
value to indicate a percentage above which the job
will be marked as failed
--check_build_log Checks build log for a list of error phrases. Returns
failure if any are found.
Returns failed test case count as script exit. Set a value to indicate a percentage above which the job will be marked as failed
--exit_with_failed_comp [EXIT_WITH_FAILED_COMP]
Returns failed if any of the functions have a Complexity (Vg) > value.
--check_build_log Checks build log for a list of error phrases. Returns failure if any are found.

Report Selection:
VectorCAST Manage reports that can be generated

--aggregate Generate aggregate coverage report VectorCAST Project
--metrics Generate metrics reports for VectorCAST Project
--fullstatus Generate full status reports for VectorCAST Project
--utfull Generate Full Reports for each VectorCAST environment
in project
--tcmr Generate Test Cases Management Reports for each
VectorCAST environment in project
--noindex Stops index.html report that ties all the other HTML
reports together from being created
--utfull Generate Full Reports for each VectorCAST environment in project
--tcmr Generate Test Cases Management Reports for each VectorCAST environment in project
--noindex Stops index.html report that ties all the other HTML reports together from being created

Build/Execution Options:
Options that effect build/execute operation

--jobs JOBS Number of concurrent jobs (default = 1)
--ci Use Continuous Integration Licenses
-l LEVEL, --level LEVEL
Environment Name if only doing single environment.
Should be in the form of compiler/testsuite
Environment Name if only doing single environment. Should be in the form of compiler/testsuite
-e ENVIRONMENT, --environment ENVIRONMENT
Environment Name if only doing single environment.
--gitlab Build using GitLab CI (default)
Expand All @@ -125,10 +113,13 @@ The api for vcast_exec.py follows:
--timing Prints timing information for metrics generation
-v, --verbose Enable verbose output
--version Displays the version information

```

# Change log
04/2025
* Added a quality gate for function level complexity greater that X
* Added in support for Imported Results

01/2025
* Added --check_build_log to examine the VectorCAST build log to see if any errors occurred during the build-execute
* return codes:
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2026.03.09-1138-0400-gff5d994
v2026.04.24-1438-0400-g69116b2
8 changes: 8 additions & 0 deletions cobertura.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@

encFmt = getVectorCASTEncoding()

vgByFunction = {}

def write_xml(x, name, verbose = False):

if verbose:
Expand Down Expand Up @@ -370,6 +372,10 @@ def processStatementBranchMCDC(fileApi, lines, extended = False):

return linesCovered, linesTotal

def updateVgByFunction(coverXML, coverApi):
for func in coverApi.functions:
fullName = func.source_file.path + "::" + func.parameterized_name
vgByFunction[fullName] = func.metrics.complexity

def procesCoverage(coverXML, coverApi, extended = False, source_root = ""):

Expand Down Expand Up @@ -634,6 +640,8 @@ def runCoberturaResults(packages, api, verbose = False, extended = False, source

vg += file.metrics.complexity
pkg_vg += file.metrics.complexity

updateVgByFunction(classes, file)

if extended:
total_fc += file.metrics.function_calls
Expand Down
Loading
Loading