1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00
profanity/tests/unittests
ike08 d35a7a7f7e Refactor tests to use the new cmocka test runner
## 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.
2023-11-01 18:30:08 -06:00
..
chatlog add chatlog unittest 2022-06-28 20:46:35 +02:00
config g_free() to auto_gfree, introduce auto_guchar 2023-07-13 17:04:59 +02:00
database Update copyright year 2023-01-10 10:37:25 +01:00
log minor changes 2023-01-18 20:02:46 +01:00
omemo Use our omemo sid/fingerprint in qr code 2022-05-31 15:44:44 +02:00
otr Apply coding style 2020-07-07 14:18:57 +02:00
pgp Add optional pgp public key autoimport 2023-07-02 14:25:55 +02:00
tools Add url support (downloading) to /plugins install 2023-05-16 15:57:07 +02:00
ui Move /os into /privacy os 2023-07-25 16:35:14 +02:00
xmpp fix /reconnect now 2023-05-10 18:12:11 +02:00
helpers.c Refactor tests to use the new cmocka test runner 2023-11-01 18:30:08 -06:00
helpers.h Refactor tests to use the new cmocka test runner 2023-11-01 18:30:08 -06:00
test_autocomplete.c Apply coding style 2020-07-07 14:18:57 +02:00
test_autocomplete.h Apply coding style 2020-07-07 14:18:57 +02:00
test_callbacks.c auto-format 2022-02-01 15:01:28 +01:00
test_callbacks.h Apply coding style 2020-07-07 14:18:57 +02:00
test_chat_session.c Apply coding style 2020-07-07 14:18:57 +02:00
test_chat_session.h Fix: files missing final ending newline 2021-08-26 00:28:49 +00:00
test_cmd_account.c Add sessions_alarm 2023-04-18 14:28:20 +02:00
test_cmd_account.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_alias.c Change char->free to auto_char char for autocleanup 2023-07-11 13:26:37 +02:00
test_cmd_alias.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_bookmark.c Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_bookmark.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_connect.c Add sessions_alarm 2023-04-18 14:28:20 +02:00
test_cmd_connect.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_disconnect.c Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_disconnect.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_join.c Cleanup: gchar as gchar instead of char 2023-05-04 16:15:09 +02:00
test_cmd_join.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_otr.c Cleanup char* to auto_gchar gchar* for prefs_get_string 2023-07-03 16:06:27 +02:00
test_cmd_otr.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_pgp.c Add optional pgp public key autoimport 2023-07-02 14:25:55 +02:00
test_cmd_pgp.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_presence.c Cleanup char* to auto_gchar gchar* for prefs_get_string 2023-07-03 16:06:27 +02:00
test_cmd_presence.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_rooms.c Add sessions_alarm 2023-04-18 14:28:20 +02:00
test_cmd_rooms.h Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_roster.c Add nickname support for /roster remove 2023-04-13 16:41:21 +02:00
test_cmd_roster.h Add nickname support for /roster remove 2023-04-13 16:41:21 +02:00
test_cmd_sub.c Apply coding style 2020-07-07 14:18:57 +02:00
test_cmd_sub.h Apply coding style 2020-07-07 14:18:57 +02:00
test_common.c Cleanup: gchar as gchar instead of char 2023-05-04 16:15:09 +02:00
test_common.h add test-case for #1761 2023-03-11 15:05:03 +01:00
test_contact.c Apply coding style 2020-07-07 14:18:57 +02:00
test_contact.h Apply coding style 2020-07-07 14:18:57 +02:00
test_form.c Apply coding style 2020-07-07 14:18:57 +02:00
test_form.h Apply coding style 2020-07-07 14:18:57 +02:00
test_jid.c Apply coding style 2020-07-07 14:18:57 +02:00
test_jid.h Apply coding style 2020-07-07 14:18:57 +02:00
test_keyhandlers.c Fix: files missing final ending newline 2021-08-26 00:28:49 +00:00
test_keyhandlers.h Fix: files missing final ending newline 2021-08-26 00:28:49 +00:00
test_muc.c Refactor tests to use the new cmocka test runner 2023-11-01 18:30:08 -06:00
test_muc.h Refactor tests to use the new cmocka test runner 2023-11-01 18:30:08 -06:00
test_parser.c Fix typos and update codespell configuration 2023-04-03 13:25:25 +01:00
test_parser.h Apply coding style 2020-07-07 14:18:57 +02:00
test_plugins_disco.c Apply coding style 2020-07-07 14:18:57 +02:00
test_plugins_disco.h Apply coding style 2020-07-07 14:18:57 +02:00
test_preferences.c Cleanup char* to auto_gchar gchar* for prefs_get_string 2023-07-03 16:06:27 +02:00
test_preferences.h Apply coding style 2020-07-07 14:18:57 +02:00
test_roster_list.c Add unit tests for roster_get_display_name 2021-06-30 18:58:07 -04:00
test_roster_list.h Add unit tests for roster_get_display_name 2021-06-30 18:58:07 -04:00
test_server_events.c Apply coding style 2020-07-07 14:18:57 +02:00
test_server_events.h Apply coding style 2020-07-07 14:18:57 +02:00
unittests.c Refactor tests to use the new cmocka test runner 2023-11-01 18:30:08 -06:00