Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • alya-testsuite4 alya-testsuite4
  • Project information
    • Project information
    • Activity
    • Members
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • alyaalya
  • alya-testsuite4alya-testsuite4
  • Wiki
  • Add a new unity test

Add a new unity test · Changes

Page history
Update Add a new unity test authored Mar 05, 2021 by Ricard Borrell's avatar Ricard Borrell
Show whitespace changes
Inline Side-by-side
Add-a-new-unity-test.md
View page @ 5afb78d9
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
......
Clone repository
  • Home
  • User
    • Presentation
    • SSH configuration
    • Get the testsuite
    • Basic usage
    • Advanced configuration
    • Advanced usage
    • Analyze the results
    • Code Coverage
  • Developer
    • Add a new test
    • Add a new unity test
    • Test configuration
    • Base file format
    • Manage the tolerances
    • Troubleshooting
  • Benchmarks
    • Database UML
    • Add a new benchmark