Skip to content

Commit

Permalink
Define VEE in testsuites dependencies (#1201)
Browse files Browse the repository at this point in the history
* Define VEE in testsuites dependencies

* Remove the doc on using one VEE Port per Testsuite since it is not supported for the moment
  • Loading branch information
tdelhomenie-microej authored and denisbedin committed Feb 27, 2025
1 parent 4ac7d80 commit 4882cb3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
1 change: 1 addition & 0 deletions SDK6UserGuide/addDependency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Let's have a look at the mostly used configurations:
- **testImplementation** (from Gradle Java plugin) : Dependencies used by the test classes of the project.
This configuration extends the **implementation** configuration, so it inherits from all the dependencies declared with the **implementation** configuration.
- **microejVee** : VEE Port, Virtual Device or Kernel used by the project for build and test.
- **testMicroejVee** : VEE Port, Virtual Device or Kernel used by the project for test only.

Here is an example of dependencies declaration for a project::

Expand Down
4 changes: 2 additions & 2 deletions SDK6UserGuide/migrateVeePort.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ Then for each Testsuite:
}

- The tested VEE Port was defined in SDK 5 in the ``config.properties`` file, with the ``target.platform.dir`` property.
In SDK6, it is done by declaring the VEE Port Configuration project as a project dependency::
In SDK 6, it is done by declaring the VEE Port Configuration project as a project dependency::

dependencies {
microejVee(project(":vee-port"))
testMicroejVee(project(":vee-port"))
}

and including the testsuite project in the ``settings.gradle.kts`` file of the multi-project::
Expand Down
44 changes: 38 additions & 6 deletions SDK6UserGuide/testProject.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,8 @@ Executing tests on the Simulator allows to check the behavior of the code in an
but without requiring the board.
This solution is therefore less constraining and more portable than testing on the board.

The target VEE Port must be declared in the projects dependencies, as explained in :ref:`sdk_6_select_veeport`.

Declaring a VEE Port in project dependencies only applies to the current project.
This configuration is not fetched transitively by consumer projects.
Especially when configuring the VEE Port to test a library project,
application projects depending on this library will not "see" this test VEE Port,
they must configure a VEE Port on their own and are free to use a different one.
.. _sdk_6_testsuite_configuration:

Configure the Testsuite
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -98,6 +93,43 @@ This piece of configuration is the minimum configuration required to define a te
to annotate Java Test classes. Finally the fourth line declares a dependency to a required JUnit library.


.. _sdk_6_testsuite_vee_configuration:

Configure the VEE
~~~~~~~~~~~~~~~~~

The VEE used to execute the tests must be declared in the project dependencies,
with the ``microejVee`` or the ``testMicroejVee`` configuration (refer to :ref:`sdk_6_select_veeport` for more details on the selection capabilities).
A VEE declared with the ``microejVee`` configuration is used to run the Application, as well as to execute the testsuites.
The ``microejVee`` is generally used in Application projects, since the tests should run on the same Application target VEE::

dependencies {
...
microejVee("com.mycompany:vee-port:1.0.0")
}

A VEE declared with the ``testMicroejVee`` configuration is used only for the testsuites.
It is recommended in Library projects, since they don't need a VEE to run, the VEE is scoped for the tests only::

dependencies {
...
testMicroejVee("com.mycompany:vee-port:1.0.0")
}

As a summary, the rules are:

- Only one VEE must be declared globally.
- If the VEE is declared with ``microejVee``, it is used to run the Application (if it is an Application) and to execute the tests.
- If the VEE is declared with ``testMicroejVee``, it is only used to execute the tests.

.. warning::

Declaring a VEE in project dependencies only applies to the current project.
This configuration is not fetched transitively by consumer projects.
But it is highly recommended to scope the VEE to its usage since this behavior is aimed to change in a future version.
Especially when configuring the VEE to test a Library project, it is recommended to use ``testMicroejVee``.


Create a Test Class
~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 4882cb3

Please sign in to comment.