tests: Get tod driver name from env variable

This commit is contained in:
Marco Trevisan (Treviño)
2020-12-04 02:06:54 +01:00
parent 1613c0de43
commit 7b0df77c49
4 changed files with 11 additions and 5 deletions
+4 -1
View File
@@ -28,11 +28,14 @@ fpt_context_new_with_fake_dev (void)
{
FptContext *tctx;
GPtrArray *devices;
const char *tod_name;
unsigned int i;
tctx = fpt_context_new ();
devices = fp_context_get_devices (tctx->fp_context);
tod_name = g_getenv ("FP_TOD_TEST_DRIVER_NAME");
g_assert_nonnull (tod_name);
g_assert_nonnull (devices);
g_assert_cmpuint (devices->len, ==, 1);
@@ -40,7 +43,7 @@ fpt_context_new_with_fake_dev (void)
{
FpDevice *device = devices->pdata[i];
if (g_strcmp0 (fp_device_get_driver (device), "fake_test_dev_tod") == 0)
if (g_strcmp0 (fp_device_get_driver (device), tod_name) == 0)
{
tctx->device = device;
break;