Skip Menu |

This queue is for tickets about the WebService-GoogleHack CPAN distribution.

Report information
The Basics
Id: 8417
Status: open
Priority: 0/
Queue: WebService-GoogleHack

People
Owner: Nobody in particular
Requestors: corion [...] cpan.org
Cc: imacat [...] cpan.org
AdminCc:

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



Subject: Test requires interaction
The distribution WebService::GoogleHack cannot be tested automatically by the CPAN testers, because it enters an infinite loop if the test is run unattended. Please either remove the interaction, or check if there is a terminal connected (C<-t STDIN>) before looping again. Skipping the test(s) that require the interaction is the best course of action. -max
Subject: Use prompt() in GoogleHack/t/1.t to Allow Automated Tests
Dear Pratheepan Raveendranathan, Hi. This is imacat from Taiwan. I found that the GoogleHack/t/1.t of WebService-GoogleHack-0.15 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 to WebService-GoogleHack-0.15, in the hope that it helps. Please tell me if you have any question, or if I could be of any help. Thank you.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 diff -u -r WebService.orig/GoogleHack/t/1.t WebService/GoogleHack/t/1.t - --- WebService.orig/GoogleHack/t/1.t 2005-01-06 15:32:15.000000000 +0800 +++ WebService/GoogleHack/t/1.t 2008-04-16 10:27:15.000000000 +0800 @@ -11,6 +11,7 @@ use constant TMPFILE => "../Datafiles/initconfig.txt"; use Test::More tests => 2; +use ExtUtils::MakeMaker; BEGIN { use_ok('WebService::GoogleHack') }; ######################### @@ -20,6 +21,7 @@ #Trying to make sure that i get the right key +SKIP: while (($ans ne "y") && ($ans ne "yes") ) { $flag="false"; @@ -33,8 +35,7 @@ diag("\n"."Please Enter your Google API key here:\n"); - -$key = <STDIN>; - -chomp $key; +$key = prompt(""); #print $key; @@ -45,24 +46,21 @@ diag("\n". "Please Enter the Entire Path to the wsdl File, \n EG, /home/public/GoogleSearch.wsdl". "\n"); - -$wsdl = <STDIN>; - -chomp $wsdl; +$wsdl = prompt(""); diag("\n". "This is the path to the WSDL file: $wsdl, Thanks". "\n"); diag("\n". "Please Enter path to the directory in which the untarred GoogleHack resides , \n EG, /home/username/WebService/GoogleHack/". "\n"); - -$basedir = <STDIN>; - -chomp $basedir; +$basedir = prompt(""); diag("\n". "This is the path to the Google Hack directory: $basedir, Thanks". "\n"); diag("\n". "Please Enter path to the directory in which the Brill Tagger executable, \n EG, /home/username/RULE_BASED_TAGGER_V1.14/Bin_and_Data/". "\n"); - -$tagger = <STDIN>; - -chomp $tagger; +$tagger = prompt(""); diag("\n". "This is the path to the tagger executable: $tagger, Thanks". "\n"); @@ -70,8 +68,11 @@ diag("\n". "Is the above information accurate y-yes, n-no". "\n"); - -$ans = <STDIN>; - -chomp $ans; +$tagger = prompt(""); +if (!$target) { + skip "Cannot continue", 1; + exit 0; +} $ans=lc($ans); -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkgFZGIACgkQi9gubzC5S1yN8gCffbOgiESeuVAgZyaPboIRKe8j GiAAniei15tm5YAAuera1TiUCsSnfXVm =N0Q2 -----END PGP SIGNATURE-----