Disable tests when minimum glib2 requirement is not met

These tests use g_assert_true which is available as of glib2 2.38 only.
This commit is contained in:
Geert Janssens 2017-03-23 17:37:29 +01:00
parent a63a4d5e8a
commit 3f42569541

View File

@ -49,6 +49,9 @@ teardown (Fixture *fixture, gconstpointer pData)
test_clear_error_list();
}
/* The exluded tests all rely on g_assert_true wich was only introduced
* in glib 2.38 */
#ifdef HAVE_GLIB_2_38
static void
test_pending_matches_match_types (Fixture *fixture, gconstpointer pData)
{
@ -111,6 +114,7 @@ test_pending_matches_keeps_count (Fixture *fixture, gconstpointer pData)
gnc_import_PendingMatches_delete (matches);
}
#endif
int
main (int argc, char *argv[])
@ -119,12 +123,16 @@ main (int argc, char *argv[])
qof_init();
g_test_init (&argc, &argv, NULL);
/* The exluded tests all rely on g_assert_true wich was only introduced
* in glib 2.38 */
#ifdef HAVE_GLIB_2_38
GNC_TEST_ADD (suitename, "match_types", Fixture, NULL, setup,
test_pending_matches_match_types, teardown);
GNC_TEST_ADD (suitename, "prefer_manual_match", Fixture, NULL, setup,
test_pending_matches_prefer_manual_match, teardown);
GNC_TEST_ADD (suitename, "keeps_count", Fixture, NULL, setup,
test_pending_matches_keeps_count, teardown);
#endif
result = g_test_run();
qof_close();