[bug#33322] gnu: maxima: Fix tests on i686 and x86_64.

Message ID 20181108222717.10007-1-kkebreau@posteo.net
State Accepted
Commit 1472d19abf49352c404c285546526457898de113
Headers show
Series [bug#33322] gnu: maxima: Fix tests on i686 and x86_64. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied

Commit Message

Kei Kebreau Nov. 8, 2018, 10:27 p.m. UTC
* gnu/packages/maths.scm (maxima)[arguments]: Replace check phase.
---
 gnu/packages/maths.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Ludovic Courtès Nov. 16, 2018, 9:44 p.m. UTC | #1
Hello,

Kei Kebreau <kkebreau@posteo.net> skribis:

> * gnu/packages/maths.scm (maxima)[arguments]: Replace check phase.

[...]

> +             ;; This is derived from the testing code in the "debian/rules" file
> +             ;; of Debian's Maxima package.
> +             ;; If Maxima can successfully run this, the binary to be installed
> +             ;; should be fine.
> +             (zero?
> +              (system
> +               (string-append "./maxima-local "
> +                              "--lisp=gcl "
> +                              "--batch-string=\"run_testsuite();\" "
> +                              "| grep -q \"No unexpected errors found\"")))))

So the exit code without grep isn’t good enough, right?

If it has to be this way, so be it!

Thanks,
Ludo’.
Kei Kebreau Nov. 18, 2018, 5:03 p.m. UTC | #2
ludo@gnu.org (Ludovic Courtès) writes:

> Hello,
>
> Kei Kebreau <kkebreau@posteo.net> skribis:
>
>> * gnu/packages/maths.scm (maxima)[arguments]: Replace check phase.
>
> [...]
>
>> + ;; This is derived from the testing code in the "debian/rules"
>> file
>> +             ;; of Debian's Maxima package.
>> + ;; If Maxima can successfully run this, the binary to be installed
>> +             ;; should be fine.
>> +             (zero?
>> +              (system
>> +               (string-append "./maxima-local "
>> +                              "--lisp=gcl "
>> +                              "--batch-string=\"run_testsuite();\" "
>> +                              "| grep -q \"No unexpected errors found\"")))))
>
> So the exit code without grep isn’t good enough, right?
>
> If it has to be this way, so be it!
>

Yes, because I think that Maxima returns successfully as long as it
exits without the underlying Lisp implementation crashing.

> Thanks,
> Ludo’.

Thank you for the review!

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 808ab5345..389343051 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2716,6 +2716,18 @@  to BMP, JPEG or PNG image formats.")
            (lambda _
              (chmod "src/maxima" #o555)
              #t))
+         (replace 'check
+           (lambda _
+             ;; This is derived from the testing code in the "debian/rules" file
+             ;; of Debian's Maxima package.
+             ;; If Maxima can successfully run this, the binary to be installed
+             ;; should be fine.
+             (zero?
+              (system
+               (string-append "./maxima-local "
+                              "--lisp=gcl "
+                              "--batch-string=\"run_testsuite();\" "
+                              "| grep -q \"No unexpected errors found\"")))))
          ;; Make sure the doc and emacs files are found in the
          ;; standard location.  Also configure maxima to find gnuplot
          ;; without having it on the PATH.