unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Bavier <bavier@cray.com>
To: 29030@debbugs.gnu.org
Subject: [bug#29030] [PATCH] perl-sys-cpu: Mark cpu_type and cpu_clock tests as TODO.
Date: Fri, 27 Oct 2017 20:40:12 +0000	[thread overview]
Message-ID: <CY4PR11MB1718DEC796149A5DE28DC5F1B75A0@CY4PR11MB1718.namprd11.prod.outlook.com> (raw)

[-- 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

             reply	other threads:[~2017-10-27 20:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27 20:40 Eric Bavier [this message]
2017-10-28  7:51 ` [bug#29030] [PATCH] perl-sys-cpu: Mark cpu_type and cpu_clock tests as TODO Ludovic Courtès
2017-10-28 23:29   ` bug#29030: " Eric Bavier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR11MB1718DEC796149A5DE28DC5F1B75A0@CY4PR11MB1718.namprd11.prod.outlook.com \
    --to=bavier@cray.com \
    --cc=29030@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).