Skip to content
Snippets Groups Projects
Commit 277ede4b authored by Simon McVittie's avatar Simon McVittie
Browse files

tests: Assert that test_missing_arch gives a useful diagnostic


The message is actually something like

    /path/to/hal9000-linux-gnu-inspect-library not found

but I don't want to hard-code that, so just assert that the name of the
executable is mentioned.

This clarifies why we don't get an exit status: we never get as far as
actually running anything.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 8c80bd02
No related branches found
No related tags found
1 merge request!89tests: Assert that test_missing_arch gives a useful diagnostic
Pipeline #2101 passed
...@@ -731,6 +731,7 @@ test_missing_arch (Fixture *f, ...@@ -731,6 +731,7 @@ test_missing_arch (Fixture *f,
const char * const *missing_symbols; const char * const *missing_symbols;
const char * const *misversioned_symbols; const char * const *misversioned_symbols;
const char * const *dependencies; const char * const *dependencies;
const char *messages;
issues = srt_check_library_presence ("libz.so.1", issues = srt_check_library_presence ("libz.so.1",
"hal9000-linux-gnu", "hal9000-linux-gnu",
...@@ -741,8 +742,16 @@ test_missing_arch (Fixture *f, ...@@ -741,8 +742,16 @@ test_missing_arch (Fixture *f,
(SRT_LIBRARY_ISSUES_CANNOT_LOAD | (SRT_LIBRARY_ISSUES_CANNOT_LOAD |
SRT_LIBRARY_ISSUES_UNKNOWN_EXPECTATIONS)); SRT_LIBRARY_ISSUES_UNKNOWN_EXPECTATIONS));
g_assert_cmpstr (srt_library_get_absolute_path (library), ==, NULL); g_assert_cmpstr (srt_library_get_absolute_path (library), ==, NULL);
/* Because we can't find the hal9000-linux-gnu-inspect-library helper,
* we never even get as far as running a command, so no exit status or
* terminating signal is reported. */
g_assert_cmpint (srt_library_get_exit_status (library), ==, -1); g_assert_cmpint (srt_library_get_exit_status (library), ==, -1);
g_assert_cmpint (srt_library_get_terminating_signal (library), ==, 0); g_assert_cmpint (srt_library_get_terminating_signal (library), ==, 0);
/* We mention the missing helper in the diagnostic messages. */
messages = srt_library_get_messages (library);
g_assert_nonnull (messages);
g_test_message ("%s", messages);
g_assert_nonnull (strstr (messages, "hal9000-linux-gnu-inspect-library"));
missing_symbols = srt_library_get_missing_symbols (library); missing_symbols = srt_library_get_missing_symbols (library);
g_assert_nonnull (missing_symbols); g_assert_nonnull (missing_symbols);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment