Makefile.am:
- Replace 4 hardcoded parallel commands with loop over FUNC_TEST_GROUPS
- Easy to extend by adding group numbers to the variable
functionaltests.c:
- Remove test counts from comments (prone to becoming outdated)
- Restore previous comment style with === separators for readability
- Replace switch with groups[] array structure for extensibility
proftest.h:
- Fix comment to describe current state, not the change made
CONTRIBUTING.md:
- Document test groups and parallel execution commands
- Add instructions for adding new test groups
- Split 69 functional tests into 4 groups for parallel execution
- Add check-functional-parallel target to Makefile.am
- Fix VPATH builds with $(srcdir)/tests path
- Add test failure detection verification in CI
- Update Dockerfiles with parallel make -j$(nproc)
- Add --depth 1 for faster git clone in Dockerfiles
- Replace stbbr_for_id() with stbbr_for_query()/stbbr_send()
- Content-based stubbing matches stanzas by namespace instead of ID
- Use regex assertions for flexible output matching
- Fix timing issues in chat_session and presence tests
As 9f2abc75 accidentally got the ordering of some of the includes wrong,
I decided to propose my initial solution again.
Additional to that, I've opened a MR against CMocka to solve this on
their side, since I believe that the current way this is done is not
sustainable [0].
[0] https://gitlab.com/cmocka/cmocka/-/merge_requests/91
Fixes: 9f2abc75 ("Fix tests with gcc15 (uintptr_t)")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
CProof note: our new tests need to also be updated.
## Summary
Fixes https://github.com/profanity-im/profanity/issues/1907
Update functional and unit test code to comply with the current cmocka test runner.
## Changes
- `UnitTest` struct to `CMUnitTest` struct
- `unit_test()` macro to `cmocka_unit_test(f)` macro
- `unit_test_setup_teardown()` macro to `cmocka_unit_test_setup_teardown` macro
- `run_tests()` macro to `cmocka_run_group_tests()` function
- Setup and teardown functions return `int` instead of `void`
## Testing
### Unit Tests
`make check`
### Functional Tests
I did not compile or run functional tests because they are *shelved* for now.
### Valgrind
I'm not entirely sure how to fun Valgrind in this case. I did not do fancy memory management, so it should be fine.