mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 02:28:05 +00:00
debian/patches: Use assets from correct paths
This commit is contained in:
Vendored
+1
@@ -0,0 +1 @@
|
||||
tests-Use-native-GTest-utils-to-generate-assets-names.patch
|
||||
@@ -0,0 +1,77 @@
|
||||
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
|
||||
Date: Thu, 17 Aug 2023 21:17:26 +0200
|
||||
Subject: tests: Use native GTest utils to generate assets names
|
||||
|
||||
---
|
||||
tests/meson.build | 14 +++++++++-----
|
||||
tests/test-fpi-assembling.c | 4 +---
|
||||
2 files changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/tests/meson.build b/tests/meson.build
|
||||
index 5058ae3..2832158 100644
|
||||
--- a/tests/meson.build
|
||||
+++ b/tests/meson.build
|
||||
@@ -6,6 +6,8 @@ envs.set('G_MESSAGES_DEBUG', 'all')
|
||||
# Setup paths
|
||||
envs.set('MESON_SOURCE_ROOT', meson.project_source_root())
|
||||
envs.set('MESON_BUILD_ROOT', meson.project_build_root())
|
||||
+envs.set('G_TEST_SRCDIR', meson.current_source_dir())
|
||||
+envs.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
||||
envs.prepend('LD_LIBRARY_PATH', meson.project_build_root() / 'libfprint')
|
||||
|
||||
# Set FP_DEVICE_EMULATION so that drivers can adapt (e.g. to use fixed
|
||||
@@ -71,6 +73,12 @@ envs_str = run_command(python3, '-c', env_parser_cmd,
|
||||
env: envs,
|
||||
check: installed_tests).stdout().strip()
|
||||
|
||||
+envs_str = ' '.join([
|
||||
+ envs_str,
|
||||
+ 'G_TEST_SRCDIR=' + installed_tests_testdir,
|
||||
+ 'G_TEST_BUILDDIR=' + installed_tests_execdir,
|
||||
+])
|
||||
+
|
||||
if get_option('introspection')
|
||||
envs.prepend('GI_TYPELIB_PATH', meson.project_build_root() / 'libfprint')
|
||||
virtual_devices_tests = [
|
||||
@@ -247,10 +255,6 @@ endif
|
||||
|
||||
unit_tests_deps = { 'fpi-assembling' : [cairo_dep] }
|
||||
|
||||
-test_config = configuration_data()
|
||||
-test_config.set_quoted('SOURCE_ROOT', meson.project_source_root())
|
||||
-test_config_h = configure_file(output: 'test-config.h', configuration: test_config)
|
||||
-
|
||||
foreach test_name: unit_tests
|
||||
if unit_tests_deps.has_key(test_name)
|
||||
missing_deps = false
|
||||
@@ -278,7 +282,7 @@ foreach test_name: unit_tests
|
||||
|
||||
basename = 'test-' + test_name
|
||||
test_exe = executable(basename,
|
||||
- sources: [basename + '.c', test_config_h],
|
||||
+ sources: basename + '.c',
|
||||
dependencies: [ libfprint_private_dep ] + extra_deps,
|
||||
c_args: common_cflags,
|
||||
link_whole: test_utils,
|
||||
diff --git a/tests/test-fpi-assembling.c b/tests/test-fpi-assembling.c
|
||||
index 94b8fe5..c6dae6f 100644
|
||||
--- a/tests/test-fpi-assembling.c
|
||||
+++ b/tests/test-fpi-assembling.c
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <cairo.h>
|
||||
#include "fpi-assembling.h"
|
||||
#include "fpi-image.h"
|
||||
-#include "test-config.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -67,8 +66,7 @@ test_frame_assembling (void)
|
||||
g_autoptr(FpImage) fp_img = NULL;
|
||||
GSList *frames = NULL;
|
||||
|
||||
- g_assert_false (SOURCE_ROOT == NULL);
|
||||
- path = g_build_path (G_DIR_SEPARATOR_S, SOURCE_ROOT, "tests", "vfs5011", "capture.png", NULL);
|
||||
+ path = g_test_build_filename (G_TEST_DIST, "vfs5011", "capture.png", NULL);
|
||||
|
||||
img = cairo_image_surface_create_from_png (path);
|
||||
data = cairo_image_surface_get_data (img);
|
||||
Reference in New Issue
Block a user