libotr-ng
libotr-ng copied to clipboard
Refactor tests
Why
A library should be correctly tested.
Reference
Please, refer to the test folder.
Tasks
- [ ] Understand the scope of the test and remove what does not correspond to it.
- [ ] Focus on creating tests that test overall functionality rather than unit test.
- [ ] Think about what to expose for tests.
- [ ] Check the variable names.
- [ ] Remove repeated tests.
- [ ] Remove or decide what to do with test
test_api_messaging. - [ ] Check that everywhere real functionality is used: API tests should test the API, and not use "unit-like" functions on them.
Open questions
None.
After discussing this, we have decided several things. Please add to this list if you remember something specific. We should refactor the tests to be a bit more factored. We also need to make a distinction between unit tests and functional tests. We should do these things:
- [x] Create a new category of unit tests - either in a completely new directory, or using a naming convention like test_unit_client_profile.c
- [x] Make it possible to run functional and unit tests separately
- [x] Look at existing tests and move existing ones that look like unit tests into the newly created unit tests.
- [x] Make it possible to run unit tests separately
- [x] Make it possible to capture coverage information for unit tests only.
I'll do the unit test refactoring and then unassign myself
Thanks @olabini
This is something we can tackle at the assembly at CCC. We should create tasks. But this can be a nice start for people in OTRv4.