|
When contributing to alya, you'll have to add tests to ensure that the features you added or modified do not impact negatively the code behavior. For specific functionalities unity tests are an appropriate option. By running the command "make test" all the unity tests will be executed. Note that unity tests should not be expensive in terms of computing or memory resources.
|
|
When contributing to Alya, you'll have to add tests to ensure that the features you added or modified do not impact negatively the code behavior and to avoid regressions. For specific functionalities unity tests are an appropriate option. By running the command `make tes` all the unity tests will be executed. Note that unity tests should not be expensive in terms of computing or memory resources.
|
|
|
|
|
|
## Alya unity tests structure
|
|
## Alya unity tests structure
|
|
|
|
|
|
Tests are located in `alya/unitt` directory. You will find several subdirectories containing different unity tests.
|
|
Tests are located in `alya/unitt` directory. You will find several subdirectories containing different unity tests.
|
|
To add a new test, just create a new subdirectory with the name "unitt_XX", where XX are some words describing your tests separated by the character "_" (see existing examples).
|
|
|
|
|
|
|
|
## Create the new test
|
|
## Create the new test
|
|
|
|
|
|
Create a new directory for your test. We will name this test `unitt_test_name`
|
|
Create a new directory for your test. We will name this folder `unitt_test_name`
|
|
|
|
|
|
`mkdir unitt_test_name`
|
|
`mkdir unitt_test_name`
|
|
|
|
|
|
|
|
|
|
Add the file with the code for your unity test. You will take care of keeping the same name for the test directory and the files contained within (as in the existing examples).
|
|
Add the file with the unity test code. You will take care of keeping the same name for the test directory and the files contained within (see existing examples).
|
|
|
|
|
|
In this folder add also the file "CMakeLists.txt" that you can find within the other's unity tests folder, without changing any thing from this file.
|
|
In this folder add also the file "CMakeLists.txt" that you can find within the other unity tests folder, without changing any thing from this file.
|
|
|
|
|
|
In the root folder that contains all the tests, edit the file "CMakeLists.txt" add your subdirectory:
|
|
In the root folder that contains all the tests, edit the file "CMakeLists.txt" add your subdirectory:
|
|
|
|
|
... | @@ -23,7 +22,7 @@ In the root folder that contains all the tests, edit the file "CMakeLists.txt" a |
... | @@ -23,7 +22,7 @@ In the root folder that contains all the tests, edit the file "CMakeLists.txt" a |
|
|
|
|
|
## Add and commit the files
|
|
## Add and commit the files
|
|
|
|
|
|
Add and commit the files that are required to run your test. Do not commit to the test directory any file that is generated during the execution nor any file that is not necessary to run the test.
|
|
Add and commit the files that are required to run your test. Do not commit any file that is generated during the execution nor any file that is not necessary to run the test.
|
|
|
|
|
|
## Run the unity test
|
|
## Run the unity test
|
|
|
|
|
... | | ... | |