The function os.path.normpath does not normalize drive letters.
Switch to using the resolve() method from pathlib, which supports this.
Change-Id: I4489020c7c0a6977407feb5bd2684c5c13e492d6
(cherry picked from commit ef455321c5)
If the encoding is not specified, files opened under Windows are
assumed to be cp-1252 encoded, which is almost always wrong nowadays.
Force an utf-8 encoding when we initially open the file to read.
(Keeping in mind that we have backup code for latin1-encoded files.)
Change-Id: I3847b223ce36ae5c3a2df2d9fbcf7f8360678661
Sonar scanner execution requires to provide login
information for analysis results upload into SQ
dashboard.
Using default credentials for authenticate.
Update the documentation with the latest supported
SonarQube server and SonarScanner versions and add
a note to inform that credentials are mandatory when
sonar-scanner is executed.
Change-Id: I72623adccf44f5c043f3abe0005d7f352e7ad23a
The sonar-work-dir switch usage allows to specify
the path to the folder that will be used for sonar
scanner work by SonarQube's Ada plugin.
Default behavior is kept unchanged. Hence, if this
switch is not used then the default sonar folder
is generated under obj/gnathub and this will be used
for all SonarQube specific configurations.
The documentation is updated with the new switch
description.
A specific test case is added.
Change-Id: I34c38f26b16132c78dd73c176417c6373c4ca948
As a follow up to the previous change, adjust the location
of the GNAThub dir. Fixes the build of the documentation.
Change-Id: I10607c0602169167be9d9f93b599d299219121db
A Python virtualenv might overwrite the site-packages entry
in sys.path; when this happens, plugin-runner.py can no longer
load GNAThub.py.
To address this, place GNAThub.py in the core directory rather
than in the Python install.
This means that tests can no longer simply rely on the GNAThub
module being available for testing - to make this available
to tests, set an environment variable COREDIR to point to the
directory containing this. (We could make this simpler by setting
the PYTHONPATH for all tests, but this presents the risk of
hiding setup problems where the python-runner.py would normally
not find the GNAThub module)
Simplify the structure in the process, removing src/lib and
placing all Python files under share/gnathub/core.
Simplify the Makefile accordingly.
Remove use of deprecated API in the testsuite driver.
Change-Id: I2574afd9560eba7ff9a6e0a98836d1a04b11c807
This avoid problems when -show-header is specified in the project
file, and codepeer is called from GNATHub directly.
(This already works when codepeer calls gnathub which calls codepeer
thanks to a kludge.)
Change-Id: Ie042e70ab70cc853ef1804670ee9d746566cde4a
GNATstack entities related issues are uploaded to
SonarQube dashboard
The severity is set as Info and no technical debt is
is associated with it since no remediation
effort is set
Change-Id: I0e34799943763c43edcd5bd0e11468a047a03cff
* Mangle unsupported characters in test names
* Use only one line per test in summary report
Change-Id: Ia894385d0d0da76a35bff029feeb19ea6d7f28ad
TN: U326-060
The attributes "column_begin" and "column_end"
are handled now for a line of the generated .xml
report
Default values are set to 1 for "column_end" and
"column_begin"
Change-Id: I2c16b8ef21eb25542aa2ca3a9d76074c715beeab
Passing 'with-sonarqube' parameter
Add sonar-scanner testing using SonarQube Web API
sonar-scanner.py
New test case is added for sonar-scanner
When 'with-sonarqube' qualifier is used then
SonarQube Web API is used to gather analysis
results and compare with the expected ones.
Change-Id: If950fcbdb9172557cbf35e2c68483a6b9a9891a7
For the 2nd run of gnatprove to gather analysis
results the --targs parameter are not passed which
makes that the analysis results are not accurate
in gnathub DB and in SonarQube analysis dashboard
The fix will add --targs argument for the 2nd run
and also handle the case where not both records
are presents (flow and proof) in the generated
.spark files
Change-Id: I85229fa03c6b6657303c330fc24860d13448529d
Add new qualifier to GNAThub testsuite to be able
to run specific tests using SonarQube instance in
order to add sonar-ada-pugin automated testing
Change-Id: If2925567ee4c6b49ade25fb0b3303b5ea76771bf
This is a rewritting of Matthieu Eyraud patch to
consider GNATcoverage results as part of coverage
of the code in SonarQube.
The sonar-ada-plugin was displaying coverage data
but only for gcov data.
This fix is also to consider GNATcoverage data
when it is present. If there is data for both tool,
we will consider GNATcoverage data only as it is
more precise.
Change-Id: Ie0e2dd8e013963dbfeab8104b1fcfa8888b3d084
The spark2014.xml default rules profile contains
the latest changes of gnatprove --list-categories
output
* Specific script is added to handle new format
* Ada default profile is updated based on these
changes
Change-Id: If8237ed1bf358b793ac4fea4f7e0d48b08461845
GNATprove stores the .spark files in the
"gnatprove" subfolder of the object dir for each
project in the project tree.
Spark2014 GNAThub plugin explored only the main
project object dir folder to gather analysis
results. Enhancing this behavior to explore all
the .spark files of the gnatprove subfolder of the
obejct dir of each project in the project tree and
gather all analysis results.
Add basic test to check gnathub database content.
Change-Id: I5d80b28663c491efe2989fc591bd31a3b85e3a38