Commit Graph

19 Commits

Author SHA1 Message Date
Charly Delay
3674e8b844 chore(testsuite): make sure Exec_Dir is tested
Change-Id: I4e8b4ecdf3f55e4b36fa66fa08f49a2a58915293
TN: PA28-026
2016-11-28 13:05:52 -05:00
Charly Delay
d7124595d0 gnathub: remove obsolete GNATprove plugin
This plugin stopped working some time ago due to major changes in
GNATprove output. Remove support for it as it will be re-implemented as
part of P701-003.

Change-Id: I7c0b6399243a865c57211b0f2c16573bf5ed63a9
TN: P701-003
TN: N805-021
2016-07-26 16:42:45 +02:00
Charly Delay
bbff367312 GNAThub.source_files(): new function
This new function lists source files on a per project basis. This is
more accurate than using GNAThub.source_dirs() and list the content of
each source directory.

Change-Id: I4cea06be722afa51eea3339070a263225e52f5f6
TN: P310-015
2016-03-11 12:57:07 +01:00
Charly Delay
cf7de3c106 testsuite: refactor for clarity and maintenance
Change-Id: I1d500175c06a0839268c8a3c4bfc31043c1bf259
2015-09-30 18:23:28 +02:00
Charly Delay
67aa11f229 testsuite: minor test reformating
Extract the test about cross support in two separate test cases in
tests.api-python.project:

 * check-cross-api.py
 * check-cross-api-override.py

Change-Id: I7a2e3de80f0193553a5879bad55032f6b2bd5abd
TN: O909-050
2015-09-30 03:41:48 +02:00
Charly Delay
20b809d27c gnathub: add support for cross options (--target, --RTS)
* add support in GNAThub for --target and --RTS command line
   switches.
 * add support for Target and Runtime attributes defined in the project
   file.
 * add tests to cover the new API methods (Project.target &
   Project.runtime).

Change-Id: I42a88471598fefec16a7505ad70cd24b08f3dd8b
TN: O909-050
2015-09-28 21:56:06 +02:00
JC Delay
be4e020101 Add a test for GNAThub.Project.scenario_switches()
Change-Id: I5757f952ff8f2656d7de52b8de929f471b2de857
2015-05-27 17:43:32 +02:00
JC Delay
caf8b756bd Revamp of the documentation
This commit introduces several changes:

  * rewrite the docstring of Python scripts to use AdaCore style and
    have a consistent documentation notation across projects
  * add plug-ins documentation to the generated doc, so that users don't
    need to dive into the source files when developing their own
    plug-ins
  * use a custom style for the HTML documentation (lighter & easier to
    read)

Change-Id: Ied42183e866ee552b90af2f4ef1d2410be601ca4
2014-10-13 17:03:34 +02:00
JC Delay
1233534158 Unify GNAThub.Plugin.name()
Provide a default implementation to the GNAThub.Plugin.name property:

    return type(self).__name__

Use plugin().name along with plugin.__name__ to discriminate plugins
from their name in the plugin-runner.py.

Change-Id: Ie478427ffd78c45cdab8dd1e842b3736020cd710
TN: N623-022
2014-08-14 19:48:58 +02:00
JC Delay
13d92f6f58 gnathub: add test for project attribute Project_Name.
Change-Id: If421b217f8db0d348ebe5f67f881b1d93885e7f3
TN: N702-022
2014-07-03 12:25:15 +02:00
JC Delay
71720f2491 gnathub: add support for fetching any project-attribute.
The lack of such support was uncovered by a customer that wants to
access the "Main" attribute of the project file. Generalizing the
"Property_As_String" and "Property_As_List" routine is simple enough and
does not break backward compatibility.

src/gnathub/ChangeLog:

  * gnathub-project.ad? (GNATdashboard_Package): Rename the constant for
    consistency with GNATCOLL.Project and make its declaration public so
    that it can be referenced from other packages (in particular:
    GNAThub.Python).
    (Property_As_List, Property_As_String): New optional parameter
    "Package_Name". Defaults to GNATdashboard_Package.
  * gnathub-pyhton.adb (Register_Project_Class): Register the optional
    parameter "package" to Python static methods property_as_list and
    property_as_string.

src/lib/GNAThub/ChangeLog:

  * __init__.py (property_as_list, property_as_string): Update
    documentation.

testsuite/tests/api-python/project/*:

    * Add a new test to extract the "main" attribute from the project
      file.

features-10: New features file to keep track of enhancements.

Change-Id: I2f6808b95f76581432e0893847b951183d4ca341
TN: N623-022
2014-06-30 14:05:02 +02:00
JC Delay
f8868fabac Tentative fix for test api-python.project on Windows.
Change-Id: If86fb3428cd7cf57aadd6dc1bcc78ef203b6394f
Issue: DSH-60
2014-04-27 12:07:29 +02:00
JC Delay
497fa66e8b gnathub: update testsuite with new support.
Change-Id: Id628a5f3eff0776c91315aac54db2db8ed828495
Issue: DSH-60.
2014-04-25 16:48:22 +02:00
JC Delay
cfe2d2c397 Update result of GNAThub.Project.source_dirs
This static method now returns a dictionary associating project name to
a list of source directories.

This will be needed when integrating imported projects as modules within
SonarQube.

Change-Id: If92313c8ea68cf7d17728c26d6d57f415792c6ba
2014-04-10 19:32:08 +02:00
JC Delay
213bd23696 Rationalize plug-in loading mechanism.
It relies on the definition of three concepts:

    * Repositories (containing one or more scripts)
    * Scripts (containing one or more plug-ins)
    * Plug-ins (the actual piece of code that GNAThub will execute)

The notion of "core" and "extra" plug-ins is replaced by two
repositories: [system] and the [global].

Those repositories contains scripts that themselves contains plug-ins.
The user can define a [local] repository in it project file. This is
done with the 'Local_Repository' attribute. It replaces the previous
'Specific_Plugins' attribute.

GNAThub lists all available scripts, and loads them to create a list of
plug-ins (actual Python classes).

The user can then select the plug-ins to run:

    * With a switch on the command line (--plugins)
    * With an attribute of the project ('Plugins')

Both expect a list of plug-ins names. The name of a plug-in is the name
of the Python class (case-insensitive).

If none is specified, GNAThub executes all plug-ins it has found.

src/gnathub/ChangeLog:

    * gnathub-project.adb (GNAThub.repositories): New function. It
      returns a dictionary associating the name of a repository with the
      path to the actual directory.
      (GNAThub.core_plugins, GNAThub.extra_plugins): Remove functions.
    * gnathub-project.adb: Replace attribute Specific_Plugins by
      Local_Repository.

src/lib/ChangeLog:

    * GNAThub/__init__.py (GNAThub.repositories): Write the
      documentation for the new function.
      (GNAThub.core_plugins, GNAThub.extra_plugins): Remove functions.
      (register, run): Remove those function since they are only used by
      the plugin-runner.py.
    * scripts/plugin-runner.py: Full re-write of this script.

docs/source/user-manual/execute_driver.rst: Update documentation.

testsuite/tests/api-python/*: Update test cases.

Issue: DSH-37
Change-Id: Ic65001ce01eb3a625e0e08cd4b2747dbbb166846
2014-03-26 20:51:10 +01:00
JC Delay
1925a63c95 gnathub: Fix SonarRunner execution failures.
The sonarconfig.py plugin creates the sonar-runner.properties file which
describes the project to the Sonar Runner. So far, the sonar.sources
property was hard-coded to "." ie. the current directory.

This led to plethora of invalid scenarios when gnathub is not invoked
from the same directory as the project file it is fed with (even running
gnathub from the same directory cannot guarantee a successful
execution).

This patch fixes this issue by setting the sonar.sources property to a
comma-separated list of Source_Dirs as declared in the project file.

src/ChangeLog:

    * gnathub/gnathub-project.ad[bs] (Source_Dirs): new routine
    * gnathub/gnathub-python.adb: define a new Python static method for
      the Project class: source_dirs()
    * lib/GNAThub/__init__.py (Project.source_dirs): new routine

share/gnathub/core/ChangeLog:

    * sonarconfig.py: set sonar.sources property to a comma-separated
      list of source directories

testsuite/tests/ChangeLog:

    * api-python/project/*: test availability of the
      Project.source_dirs() static method

Issue: DSH-31
Change-Id: Id108129ab327453a381def79ed5c8d3644afe4bc
2014-03-24 19:04:49 +01:00
JC Delay
ae47bef8aa Update gnathub.python.api.project test
Check for the support of all project attributes.

Change-Id: I881d26ad7063851a2b57f70f13bc9ef80df3364d
2014-03-13 16:06:35 +01:00
JC Delay
e998523b76 Tune the sphinx configuration file for the GNATdashboard project.
* Customize conf.py
    * Add docs target to the top-level Makefile
    * Write the introduction to the User's Manual.

Change-Id: I9c52246a4160d9e8abaaf217635124761960d05c
Feature: DSH-8
2014-03-13 16:06:35 +01:00
JC Delay
2902e46ed0 Testsuite refactoring.
Add support for custom category names through YAML configuration file.
This allows results to not be stored with the same hierarchy as the
actual tests (the testsuite is more stable with this mode).

Also renames the testsuite directory.

Change-Id: I4e4b997d6b3732d116fb2fc7605d8f99d8117857
2014-03-10 19:33:10 +01:00