diff options
| author | Dion Mendel <guix@dm9.info> | 2021-04-22 10:32:35 +0800 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2021-04-22 14:04:27 +0200 |
| commit | 1010171280cb34c8dc361644b66fdd1a041d297a (patch) | |
| tree | b4b8219c92dfdb9e139b82055eaa870ed4ddc165 /tests/gremlin.scm | |
| parent | a24562af52d2f318c9e17be73393ddb4bd9e347c (diff) | |
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.scm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/gremlin.scm b/tests/gremlin.scm index 9ddac14265f..f20a79f4d6c 100644 --- a/tests/gremlin.scm +++ b/tests/gremlin.scm | |||
| @@ -160,4 +160,22 @@ | |||
| 160 | (close-pipe pipe) | 160 | (close-pipe pipe) |
| 161 | str))))))) | 161 | str))))))) |
| 162 | 162 | ||
| 163 | (unless c-compiler | ||
| 164 | (test-skip 1)) | ||
| 165 | (test-equal "elf-dynamic-info-soname" | ||
| 166 | "libfoo.so.2" | ||
| 167 | (call-with-temporary-directory | ||
| 168 | (lambda (directory) | ||
| 169 | (with-directory-excursion directory | ||
| 170 | (call-with-output-file "t.c" | ||
| 171 | (lambda (port) | ||
| 172 | (display "// empty file" port))) | ||
| 173 | (invoke c-compiler "t.c" | ||
| 174 | "-shared" "-Wl,-soname,libfoo.so.2") | ||
| 175 | (let* ((dyninfo (elf-dynamic-info | ||
| 176 | (parse-elf (call-with-input-file "a.out" | ||
| 177 | get-bytevector-all)))) | ||
| 178 | (soname (elf-dynamic-info-soname dyninfo))) | ||
| 179 | soname))))) | ||
| 180 | |||
| 163 | (test-end "gremlin") | 181 | (test-end "gremlin") |
