|
... |
|
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. The code coverage helps the developer to detect if the code he has added is already covered by the testsuite. If it is not the case, you are invited to add a new test to cover your contributions.
|
|
\ No newline at end of file |
|
|
|
|
|
## Alya tests structure
|
|
|
|
|
|
|
|
Tests are located in `alya/tests` directory. You will find several subdirectories, organized by modules (kernel, nastin,...) or by features (mpio)
|
|
|
|
To add a new test, choose the appropriate subdirectory, or create a new one.
|
|
|
|
|
|
|
|
Let's say you want to add a new test for nastin:
|
|
|
|
|
|
|
|
`cd tests/nastin`
|
|
|
|
|
|
|
|
## Create the new test
|
|
|
|
|
|
|
|
Create a new directory for your test. We will name this test `test-example`
|
|
|
|
|
|
|
|
`mkdir test-example`
|
|
|
|
|
|
|
|
You will take care of keeping the same name for the test directory and the files contained within.
|
|
|
|
|
|
|
|
## Add .dat files
|
|
|
|
|
|
|
|
In the `test-example`, add the required .dat files to run your test. Their name must follow the test directory name:
|
|
|
|
|
|
|
|
- `test-example.dat`
|
|
|
|
- `test-example.dom.dat`
|
|
|
|
- `test-example.ker.dat`
|
|
|
|
- `test-example.nsi.dat`
|
|
|
|
- etc.
|
|
|
|
|
|
|
|
## Add .json file.
|
|
|
|
|
|
|
|
Add a new `test-example.json` that configures the test. The file format is described [here](./Test-configuration)
|
|
|
|
|
|
|
|
## Reference files
|
|
|
|
|
|
|
|
Create the `base/1p` directory to store the reference files used to validate the execution results.
|
|
|
|
|
|
|
|
`mkdir -p base/1p`
|
|
|
|
|
|
|
|
Put inside the files you will compare after the case execution. Take care of merging the subdomains. These files must have exactly the same name as those generated during alya execution.
|
|
|
|
|
|
|
|
## 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. |