tests: Add umockdev based tests for leds

This ensures we can probe the different led types correctly

The umockdev data was recoreded on an Librem 5 and Librem 14
This commit is contained in:
Guido Günther
2024-05-17 06:24:50 +00:00
committed by Guido Günther
parent 2db8e8f820
commit d5b0f30205
7 changed files with 277 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2024 The Phosh Developers
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <glib.h>
#include <umockdev.h>
#pragma once
G_BEGIN_DECLS
typedef struct _FbdUdevMockFixture {
UMockdevTestbed *testbed;
} FbdUmockdevFixture;
void fbd_test_umockdev_setup (FbdUmockdevFixture *fixture, gconstpointer mockname);
void fbd_test_umockdev_teardown (FbdUmockdevFixture *fixture, gconstpointer unused);
#define FBD_UMOCKDEV_TEST_ADD(name, func, f) g_test_add ((name), FbdUmockdevFixture, (f), \
(gpointer)fbd_test_umockdev_setup, \
(gpointer)(func), \
(gpointer)fbd_test_umockdev_teardown)
G_END_DECLS