tests: assert mandatory values are present

This adds a couple of string assertions to make sure that
the test run is sane.
This commit is contained in:
Luca BRUNO 2021-12-10 11:29:29 +00:00
parent b56786c415
commit f44eaf7e8c
No known key found for this signature in database
GPG Key ID: A9834A2252078E4E

View File

@ -31,12 +31,14 @@ gboolean
ot_test_run_libtest (const char *cmd, GError **error)
{
const char *srcdir = g_getenv ("G_TEST_SRCDIR");
g_autoptr(GPtrArray) argv = g_ptr_array_new ();
g_autoptr(GString) cmdstr = g_string_new ("");
g_assert (srcdir != NULL);
g_assert (cmd != NULL);
g_autoptr(GPtrArray) argv = g_ptr_array_new ();
g_ptr_array_add (argv, "bash");
g_ptr_array_add (argv, "-c");
g_autoptr(GString) cmdstr = g_string_new ("");
g_string_append (cmdstr, "set -xeuo pipefail; . ");
g_string_append (cmdstr, srcdir);
g_string_append (cmdstr, "/tests/libtest.sh; ");