Commit ba19b180 authored by Mario Limonciello's avatar Mario Limonciello Committed by Richard Hughes
Browse files

thunderbolt: move test for mock environment (Closes #280)

umockdev 0.9.4 changed how to test for running in mock and this
causes the assumptions on mock testing at init to fail.

Move the test for this to after the environment has been set up.
parent 7217086d
......@@ -479,7 +479,7 @@ sync_device_added (FuPlugin *plugin, FuDevice *device, gpointer user_data)
target = (MockTree *) mock_tree_find_uuid (tree, uuid);
if (target == NULL) {
g_warning ("Got device that could not be matched: %s", uuid);
g_critical ("Got device that could not be matched: %s", uuid);
return;
}
......@@ -906,6 +906,12 @@ test_set_up (ThunderboltTest *tt, gconstpointer params)
g_assert_nonnull (tt->tree);
}
if (!umockdev_in_mock_environment ()) {
g_warning ("Need to run within umockdev wrapper (umockdev-wrapper %s)!",
program_invocation_short_name);
return;
}
if (flags & TEST_ATTACH_AND_COLDPLUG) {
g_assert_true (flags & TEST_INITIALIZE_TREE);
......@@ -1267,11 +1273,6 @@ main (int argc, char **argv)
g_test_init (&argc, &argv, NULL);
g_log_set_fatal_mask (NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
if (!umockdev_in_mock_environment ()) {
g_warning ("Need to run within umockdev wrapper (umockdev-wrapper %s)!",
program_invocation_short_name);
return EXIT_FAILURE;
}
g_test_add ("/thunderbolt/basic",
ThunderboltTest,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment