summaryrefslogtreecommitdiff
path: root/tests/gremlin.scm
diff options
context:
space:
mode:
authorDion Mendel <guix@dm9.info>2021-04-22 10:32:35 +0800
committerLudovic Courtès <ludo@gnu.org>2021-04-22 14:04:27 +0200
commit1010171280cb34c8dc361644b66fdd1a041d297a (patch)
treeb4b8219c92dfdb9e139b82055eaa870ed4ddc165 /tests/gremlin.scm
parenta24562af52d2f318c9e17be73393ddb4bd9e347c (diff)
downloadguix-1010171280cb34c8dc361644b66fdd1a041d297a.tar.gz
guix-1010171280cb34c8dc361644b66fdd1a041d297a.tar.xz
gremlin: 'elf-dynamic-info' returns a file name rathern than a dynamic entry.
* guix/build/gremlin.scm (elf-dynamic-info): Return the dynamic entry value, not the dynamic entry. * tests/gremlin.scm ("elf-dynamic-info-soname"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/gremlin.scm')
-rw-r--r--tests/gremlin.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/gremlin.scm b/tests/gremlin.scm
index 9ddac14265..f20a79f4d6 100644
--- a/tests/gremlin.scm
+++ b/tests/gremlin.scm
@@ -160,4 +160,22 @@
(close-pipe pipe)
str)))))))
+(unless c-compiler
+ (test-skip 1))
+(test-equal "elf-dynamic-info-soname"
+ "libfoo.so.2"
+ (call-with-temporary-directory
+ (lambda (directory)
+ (with-directory-excursion directory
+ (call-with-output-file "t.c"
+ (lambda (port)
+ (display "// empty file" port)))
+ (invoke c-compiler "t.c"
+ "-shared" "-Wl,-soname,libfoo.so.2")
+ (let* ((dyninfo (elf-dynamic-info
+ (parse-elf (call-with-input-file "a.out"
+ get-bytevector-all))))
+ (soname (elf-dynamic-info-soname dyninfo)))
+ soname)))))
+
(test-end "gremlin")