GNU bug report logs -
#74670
[PATCH] tests: pack: Fix AppImage tests.
Previous Next
Reported by: Noé Lopez <noe <at> xn--no-cja.eu>
Date: Tue, 3 Dec 2024 15:13:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #43 received at 74670-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
Noé Lopez <noe <at> noé.eu> skribis:
> Here is a working version of the tests, though I don’t really understand why
> the tests are GEXPs?
The tests build derivations, each of which runs Guile code; that Guile
code is represented as gexps because it is staged to be executed when
those derivations get built.
> What is the point of using #$output and checking outside of the gexp instead
> of just using assert? And why do I need to use #$output in order for the test
> to run?
If you do (gexp->derivation "foo" #~(display "hi!")), you end up with a
derivation with zero outputs. In that case, its builder is never
executed because we know in advance that it won’t produce anything.
If you do (gexp->derivation "bar" #~(pk #$output)), then the resulting
derivation has one output, “out”.
> pack: Support localstatedir in AppImage format.
> tests: pack: Improve AppImage tests.
Applied with the cosmetic change below.
Thanks!
Ludo’.
[Message part 2 (text/x-patch, inline)]
diff --git a/tests/pack.scm b/tests/pack.scm
index 1651fa4440..9c7e0a50ba 100644
--- a/tests/pack.scm
+++ b/tests/pack.scm
@@ -393,7 +393,6 @@ (define rpm-for-tests
(check (gexp->derivation
"check-appimage-with-localstatedir"
#~(begin
- (use-modules (rnrs base))
(system* #$image "--appimage-extract-and-run" "-c"
(object->string
`(call-with-output-file #$output
@@ -401,7 +400,7 @@ (define rpm-for-tests
(display "Hello from Guile!\n"
port)))))
(system* #$image "--appimage-extract")
- (assert (file-exists? "squashfs-root/var/guix/db/db.sqlite"))))))
+ (exit (file-exists? "squashfs-root/var/guix/db/db.sqlite"))))))
(mbegin %store-monad
(built-derivations (list (pk 'APPIMAGE-drv check)))
(return (string=? (call-with-input-file (derivation->output-path check)
This bug report was last modified 115 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.