Skip Menu |

This queue is for tickets about the XML-DB CPAN distribution.

Report information
The Basics
Id: 35111
Status: new
Priority: 0/
Queue: XML-DB

People
Owner: Nobody in particular
Requestors: imacat [...] mail.imacat.idv.tw
Cc:
AdminCc:

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



Subject: Use prompt() in test.pl to Allow Automated Tests
Dear Graham Seaman, Hi. This is imacat from Taiwan. I found that the test.pl of your XML-DB goes into an infinite loop if nothing is read from keyboard. I would suggest that you use prompt() instead of directly obtain input from the STDIN, as suggested in the ExtUtils::MakeMaker document, so that the it won't go into an infinite loop. <<ExtUtils::MakeMaker>> Other Handy Functions http://search.cpan.org/perldoc?ExtUtils::MakeMaker#Other_Handy_Functions I made a simple patch against XML-DB, in the hope that it helps. Please tell me if you have any question, or if I could be of any help. Thank you.
Subject: XML-DB-prompt.diff
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 diff -u -r XML-DB.orig/test.pl XML-DB/test.pl - --- XML-DB.orig/test.pl 2002-08-12 07:13:31.000000000 +0800 +++ XML-DB/test.pl 2008-04-16 16:47:03.000000000 +0800 @@ -1,6 +1,7 @@ #!/usr/bin/perl -Ilib use strict; use Test::Harness; +use ExtUtils::MakeMaker; # $ENV{'HARNESS_PERL_SWITCHES'} = '-d'; my %drivers = (1 => 'Xindice', @@ -21,9 +22,11 @@ print "$_ $drivers{$_}\n"; } print "Note that (apart from File) the database must be running to use the tests\n"; - - print "Driver number: "; - - my $no = <STDIN>; - - chomp $no; + my $no = prompt("Driver number:"); + if (!$no) { + print "Cannot continue without the driver number\n"; + exit 0; + } if (defined $drivers{$no}){ $driver = $drivers{$no}; } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkgFvRUACgkQi9gubzC5S1x3DACfYXCMFfjCh98TCmLPjrLjM3gW TOoAoINI133oH6PWHzbP86g9IvijIrpf =d/WK -----END PGP SIGNATURE-----