unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#29030] [PATCH] perl-sys-cpu: Mark cpu_type and cpu_clock tests as TODO.
@ 2017-10-27 20:40 Eric Bavier
  2017-10-28  7:51 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Bavier @ 2017-10-27 20:40 UTC (permalink / raw)
  To: 29030

[-- Attachment #1: Type: text/plain, Size: 479 bytes --]

Hello Guix,

On my system, perl-sys-cpu's tests fail because of differences in the information available in /proc/cpuinfo.

Debian's patch for this perl module seemed nice: rather than trying to fix the related functions, just concede that the module is mostly used just to read the number of available processors and mark the other tests as "TODO".

This patch replaces the test file with debian's using an origin snippet.

Eric Bavier, Scientific Libraries, Cray Inc.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: guix-perl-sys-cpu-tests.patch --]
[-- Type: text/x-patch; name="guix-perl-sys-cpu-tests.patch", Size: 2040 bytes --]

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 815a212..7d1fda7 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2015, 2016, 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Jochem Raat <jchmrt@riseup.net>
@@ -6665,7 +6665,34 @@ statements: @code{switch} and @code{case}.")
                                   "Sys-CPU-" version ".tar.gz"))
               (sha256
                (base32
-                "1r6976bs86j7zp51m5vh42xlyah951jgdlkimv202413kjvqc2i5"))))
+                "1r6976bs86j7zp51m5vh42xlyah951jgdlkimv202413kjvqc2i5"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Replace test with one that marks cpu_clock and cpu_type
+                  ;; as TODO.  Borrowed from Debian.
+                  (call-with-output-file "t/Sys-CPU.t"
+                    (lambda (port)
+                      (format port "#!/usr/bin/perl
+
+use Test::More tests => 4;
+
+BEGIN { use_ok('Sys::CPU'); }
+
+$number = &Sys::CPU::cpu_count();
+ok( defined($number), \"CPU Count: $number\" );
+
+TODO: {
+    local $TODO = \"/proc/cpuinfo doesn't always report 'cpu MHz' or 'clock' or 'bogomips' ...\";
+    $speed = &Sys::CPU::cpu_clock();
+    ok( defined($speed), \"CPU Speed: $speed\" );
+}
+
+TODO: {
+    local $TODO = \"/proc/cpuinfo doesn't always report 'model name' or 'machine' ...\";
+    $type = &Sys::CPU::cpu_type();
+    ok( defined($type), \"CPU Type:  $type\" );
+}~%")))))))
     (build-system perl-build-system)
     (synopsis "Perl extension for getting CPU information")
     (description

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#29030] [PATCH] perl-sys-cpu: Mark cpu_type and cpu_clock tests as TODO.
  2017-10-27 20:40 [bug#29030] [PATCH] perl-sys-cpu: Mark cpu_type and cpu_clock tests as TODO Eric Bavier
@ 2017-10-28  7:51 ` Ludovic Courtès
  2017-10-28 23:29   ` bug#29030: " Eric Bavier
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2017-10-28  7:51 UTC (permalink / raw)
  To: Eric Bavier; +Cc: 29030

Hi Eric,

Eric Bavier <bavier@cray.com> skribis:

> On my system, perl-sys-cpu's tests fail because of differences in the information available in /proc/cpuinfo.
>
> Debian's patch for this perl module seemed nice: rather than trying to fix the related functions, just concede that the module is mostly used just to read the number of available processors and mark the other tests as "TODO".

[...]

> +              (snippet
> +               '(begin
> +                  ;; Replace test with one that marks cpu_clock and cpu_type
> +                  ;; as TODO.  Borrowed from Debian.

Perhaps make it clear in the comment that we do this because the
contents of /proc/cpuinfo differ based on different factors.

Otherwise LGTM, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29030: [PATCH] perl-sys-cpu: Mark cpu_type and cpu_clock tests as TODO.
  2017-10-28  7:51 ` Ludovic Courtès
@ 2017-10-28 23:29   ` Eric Bavier
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Bavier @ 2017-10-28 23:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 29030-done

On Sat, 28 Oct 2017 09:51:24 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Hi Eric,
> 
> Eric Bavier <bavier@cray.com> skribis:
> 
> > On my system, perl-sys-cpu's tests fail because of differences in the information available in /proc/cpuinfo.
> >
> > Debian's patch for this perl module seemed nice: rather than trying to fix the related functions, just concede that the module is mostly used just to read the number of available processors and mark the other tests as "TODO".  
> 
> [...]
> 
> > +              (snippet
> > +               '(begin
> > +                  ;; Replace test with one that marks cpu_clock and cpu_type
> > +                  ;; as TODO.  Borrowed from Debian.  
> 
> Perhaps make it clear in the comment that we do this because the
> contents of /proc/cpuinfo differ based on different factors.

OK.

> Otherwise LGTM, thanks!

Thanks, pushed in 9de52b56438674c0d0f92be34cebf5f1a38a6bfa.

`~Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-29  4:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-27 20:40 [bug#29030] [PATCH] perl-sys-cpu: Mark cpu_type and cpu_clock tests as TODO Eric Bavier
2017-10-28  7:51 ` Ludovic Courtès
2017-10-28 23:29   ` bug#29030: " Eric Bavier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).