Skip Menu |

This queue is for tickets about the Test-Smoke CPAN distribution.

Report information
The Basics
Id: 14544
Status: resolved
Priority: 0/
Queue: Test-Smoke

People
Owner: abeltje [...] cpan.org
Requestors: RURBAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Windows fallback on ncpu failure
Windows requires a fallback on ncpu failure. See attached patch. Mysteriously Win32-TieRegistry-0.24 returns no keys for LMachine HARDWARE DESCRIPTION System CentralProcessor With this patch all tests pass.
2005-09-10 20:47:58 rurban@cpan.org * Windows: fallback on ncpu failure --- Test-Smoke-1.19/lib/Test/Smoke/SysInfo.pm.orig 2004-07-24 16:26:25.000000000 +0000 +++ Test-Smoke-1.19/lib/Test/Smoke/SysInfo.pm 2005-09-10 18:46:28.413250000 +0000 @@ -528,6 +528,7 @@ hex $Win32::TieRegistry::Registry->{ $mhzkey }; $cpu = $cpustr; $ncpu = keys %{ $Win32::TieRegistry::Registry->{ $basekey } }; + $ncpu = $ENV{NUMBER_OF_PROCESSORS} unless $ncpu; ($cpu_type) = $Win32::TieRegistry::Registry->{ $idkey } =~ /^(\S+)/; }
[RURBAN - Sat Sep 10 14:52:52 2005]: Show quoted text
> Windows requires a fallback on ncpu failure. See attached patch. > > Mysteriously Win32-TieRegistry-0.24 returns no keys for LMachine > HARDWARE DESCRIPTION System CentralProcessor > > With this patch all tests pass.
I am confused. scalar keys() cannot return 0 for \\LMachine\Hardware\Description\System\CentralProcessor when it returns values for keys under subkey '0'. My cygwin (1.5.10 on W2k) just works fine. I have applied the following patch to the development tree: [ 911] By: abeltje on 2005-09-11 00:48:21 +0200 Log: * [CHANGE] thanks to reini urban * use the Windows environment variables always as fallback Url: http://source.Test-Smoke.org/svn/Test-Smoke ! /Test-Smoke/lib/Test/Smoke/SysInfo.pm Index: lib/Test/Smoke/SysInfo.pm ========================================================= ========== --- lib/Test/Smoke/SysInfo.pm (revision 910) +++ lib/Test/Smoke/SysInfo.pm (revision 911) @@ -3,7 +3,7 @@ # $Id$ use vars qw( $VERSION @EXPORT_OK ); -$VERSION = '0.026'; +$VERSION = '0.027'; use base 'Exporter'; @EXPORT_OK = qw( &sysinfo &tsuname ); @@ -551,10 +551,8 @@ =cut sub Windows { + my( $cpu_type, $cpu, $ncpu ); - my $cpu_type = $ENV{PROCESSOR_ARCHITECTURE}; - my $cpu = $ENV{PROCESSOR_IDENTIFIER}; - my $ncpu = $ENV{NUMBER_OF_PROCESSORS}; eval { require Win32::TieRegistry }; unless ( $@ ) { Win32::TieRegistry->import(); @@ -574,9 +572,9 @@ } return { - _cpu_type => $cpu_type, - _cpu => $cpu, - _ncpu => $ncpu, + _cpu_type => ( $cpu_type || $ENV{PROCESSOR_ARCHITECTURE} ), + _cpu => ( $cpu || $ENV{PROCESSOR_IDENTIFIER} ), + _ncpu => ( $ncpu || $ENV{NUMBER_OF_PROCESSORS} ), _host => __get_hostname(), _os => __get_os(), }; -- Generated by 'svnchanges' (0.013) --