From 8b763fe3e6e184a84c298ca62073023f7273e250 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Mon, 1 Mar 2021 13:17:59 +0100 Subject: Partitions: android: add tests for open_android_modem_partition Libraries typically have a public API and some internal implementation of that API. In libsamsung-ipc, the public API is defined in the include/ directory from the top directory. When compiling and installing libsamsung-ipc, that include/ directory is installed as well. Anything that is not defined in include/ is not part of that public API. However here we need to precisely test functions that are not part of that public API: The open_android_modem_partition function being tested here is only used by the herolte device, and that device doesn't have a battery that is easily replaceable, so most Replicant contributors will not want to get that device. As currently all the non static symbols of libsamsung-ipc are exported and that open_android_modem_partition isn't static, we can simply link to libsamsung-ipc for now and use its internal headers to access the functions to test. If at some point, libsamsung-ipc only exports the symbols defined in include/ we would need to find other ways to run such tests, for instance by using test frameworks that take care of that or by compiling libsamsung-ipc source code into the test programs. Some of the code of the libsamsung-ipc-test utility was adapted from code from the nv_data-md5 utility (which is currently in tools/). Signed-off-by: Denis 'GNUtoo' Carikli --- scripts/guix.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/guix.scm b/scripts/guix.scm index c6e033a..a917a82 100644 --- a/scripts/guix.scm +++ b/scripts/guix.scm @@ -113,7 +113,7 @@ (modify-phases %standard-phases (add-before 'build 'patch-python (lambda _ - (substitute* (find-files "tools" ".*\\.py$") + (substitute* (find-files "." ".*\\.py$") (("/usr/bin/env python") (which "python3"))) #t))))) (synopsis "libsamsung-ipc is a free software implementation of the Samsung IPC modem protocol") @@ -154,7 +154,7 @@ found in many Samsung smartphones and tablets.") (modify-phases %standard-phases (add-before 'build 'patch-python (lambda _ - (substitute* (find-files "tools" ".*\\.py$") + (substitute* (find-files "." ".*\\.py$") (("/usr/bin/env python") (which "python3"))) #t))) #:make-flags (list ,%common-strict-cflags))))) @@ -177,7 +177,7 @@ found in many Samsung smartphones and tablets.") (modify-phases %standard-phases (add-before 'build 'patch-python (lambda _ - (substitute* (find-files "tools" ".*\\.py$") + (substitute* (find-files "." ".*\\.py$") (("/usr/bin/env python") (which "python3"))) #t))) #:make-flags (list ,%common-strict-cflags ,%clang-strict-cflags))))) -- cgit v1.2.3