Commit 0a35a1ea authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by Laura, Jason R
Browse files

Updated Writing ISIS3 Tests Using Gtest and Ctest (markdown)

parent be458dfc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ INSTANTIATE_TEST_CASE_P(
will ensure that the tests start with `BundleSettings`.

# Test names
We use gtest as our unit testing framework, but use ctest to actually run the tests. The test name can be defined in the test definition. The naming convention for gtests is `UnitTest<Object><test case>` for unit tests and `FunctionalTest<app name><test case>` for app tests each in upper camel case. The documentation for how this works can be found in [cmake's documentation](https://cmake.org/cmake/help/v3.13/module/GoogleTest.html).
We use gtest as our unit testing framework, but use ctest to actually run the tests. The test name can be defined in the test definition. The naming convention for gtests is `UnitTest<Object><test case>` for unit tests and `FunctionalTest<app name><test case>` for app tests each in upper camel case. Source files should follow a similar pattern of UnitTest<Object>.cpp and FunctionalTest<app>.cpp. The documentation for how this works can be found in [cmake's documentation](https://cmake.org/cmake/help/v3.13/module/GoogleTest.html).

To run the gtests for a specific class, use `ctest -R ClassName`

@@ -61,6 +61,8 @@ To run all gtests, use `ctest -R "\." -E "(_app_|_unit_)"`. Not that this comman
## Test fixtures
`TEST_F(Foo, Bar)` will also produce the test `Foo.Bar`.

The names of fixtures are at the developer's decretion. Fixtures that require extra data should have their data files placed in ISIS3/isis/tests/data inside a folder matching the fixture name.

## Parameterized tests
```
TEST_P(Foo, Bar) {