This is an automated email from the git hooks/post-receive script.

guix_mirror_bot pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 79dcb79e1f tests: New ld-wrapper test.
79dcb79e1f is described below

commit 79dcb79e1f36a87550d6f00a66343dd024d14ef3
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Mon Oct 20 22:36:44 2025 +0900

    tests: New ld-wrapper test.
    
    * tests/ld-wrapper.scm: New file.
    * Makefile.am (SCM_TESTS): Register it.
    
    Change-Id: I3cef5ff363226a3ceee2599d4906f107d6ae7151
    Reviewed-by: Ludovic Courtès <[email protected]>
---
 Makefile.am          |  3 ++-
 tests/ld-wrapper.scm | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index e0db4c9412..a4e7277d6d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,7 +14,7 @@
 # Copyright © 2018 Oleg Pykhalov <[email protected]>
 # Copyright © 2018 Alex Vong <[email protected]>
 # Copyright © 2019, 2023 Efraim Flashner <[email protected]>
-# Copyright © 2020, 2021, 2023 Maxim Cournoyer <[email protected]>
+# Copyright © 2020, 2021, 2023, 2025 Maxim Cournoyer <[email protected]>
 # Copyright © 2021 Chris Marusich <[email protected]>
 # Copyright © 2021 Andrew Tropin <[email protected]>
 # Copyright © 2023 Clément Lassieur <[email protected]>
@@ -590,6 +590,7 @@ SCM_TESTS =                                 \
   tests/http-client.scm                                \
   tests/inferior.scm                           \
   tests/ipfs.scm                               \
+  tests/ld-wrapper.scm                         \
   tests/lint.scm                               \
   tests/modules.scm                            \
   tests/monads.scm                             \
diff --git a/tests/ld-wrapper.scm b/tests/ld-wrapper.scm
new file mode 100644
index 0000000000..58958a8d0c
--- /dev/null
+++ b/tests/ld-wrapper.scm
@@ -0,0 +1,56 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2025 Maxim Cournoyer <[email protected]>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(use-modules (guix tests)
+             (srfi srfi-26)
+             (srfi srfi-64))
+
+(define %project-root
+  (dirname (dirname (canonicalize-path (or (current-filename))))))
+
+;;; Load the ld-wrapper module and expose some internals, for white-box
+;;; testing.
+(load (string-append %project-root "/gnu/packages/ld-wrapper.in"))
+(define ld-wrapper-module (resolve-module '(gnu build-support ld-wrapper)))
+(define library-files-linked (module-ref ld-wrapper-module 
'library-files-linked))
+
+(define %dummy-library-prefix "/gnu/store/...-dummy-0.0.0/lib")
+
+(test-begin "ld-wrapper")
+
+(define lugaru-link-arguments
+  '("-Wall" "-Wextra" "-Wno-parentheses" "-pedantic" "--std=gnu++11" "-O2" "-g"
+    "-DNDEBUG" "-rdynamic" "-Wl,--dependency-file=CMakeFiles/lugaru.dir/link.d"
+    "CMakeFiles/lugaru.dir/Source/main.cpp.o"
+    "CMakeFiles/lugaru.dir/Source/Animation/Animation.cpp.o"
+    "-o" "lugaru" "-lopenal" "-lpng" "-ljpeg" "-lz" "-lSDL2"
+    "-lGL" "-lGLU" "-lvorbisfile" "-logg"))
+
+(define lugaru-link-libraries
+  (map (cut string-append "lib" <> ".so")
+       '("openal" "png" "jpeg" "z" "SDL2" "GL" "GLU" "vorbisfile" "ogg")))
+
+(test-equal "library files linked"
+  (map (cut string-append %dummy-library-prefix "/" <>)
+       lugaru-link-libraries)
+  (mock ((guile) search-path
+         (lambda (_ library)
+           (string-append %dummy-library-prefix "/" library)))
+        (library-files-linked lugaru-link-arguments "dummy:library:path")))
+
+(test-end)

Reply via email to