Re: Easy-bake perlbug email interface

2001-10-27 Thread Robert

When they work, you can CC special addresses in a reply, and things
happen.

For example, if you cc [EMAIL PROTECTED] the ticket will be closed.

I don't remember the exact syntax, but I think
[EMAIL PROTECTED] will close it as notabug.

Other keywords include 'patch' 'note', etc.

Join them with _.

BUGid will come from the subject, unless you specify it in the address.

See here for a little more...
http://bugs.perl.org/perlbug.cgi?req=mailhelp#ADMINISTRATOR

-R


On Thu, 2001-10-25 at 15:51, Michael G Schwern wrote:
> The idea being you see a bug report on p5p and can reply to it *and*
> send commands to perlbug with a single command.  So instead of hitting
> 'g' (group reply in mutt) you might hit 'B' (perlbug) and select from
> a short list ('n'otabug, already 'f'ixed, 't'est, 'p'atch) of what
> you're doing.  Up pops an editor and you do your thing.





Descriptive strings in Test::More ?

2001-06-18 Thread Kirrily Robert

(ergh, let's try this again from the right address)

I'm not sure where's the best place to post this, but I imagine perl-qa
might be a good start.  Please let me know if it's the wrong place.

I've been messing with various testing modules that I learnt about at
YAPC, and I'm unclear about something.

  use Test::More no_plan;
  ok( nonblank("abc") eq "OK" , "Strings aren't blank" );

The above is generated using Pod::Tests and pod2test (yay schwern!).
When I run these tests, I never see the descriptions of the tests (eg
"Strings aren't blank").

I thought those strings were meant to output during the testing, to show
you what it's testing for.  Am I confused?

K.


-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
Real programmers don't bring brown-bag lunches.  If the vending machine 
doesn't sell it, they don't eat it. Vending machines don't sell quiche.



Descriptive strings?

2001-06-18 Thread Kirrily Robert

I'm not sure where's the best place to post this, but I imagine perl-qa
might be a good start.  Please let me know if it's the wrong place.

I've been messing with various testing modules that I learnt about at
YAPC, and I'm unclear about something.

  use Test::More no_plan;
  ok( nonblank("abc") eq "OK" , "Strings aren't blank" );

The above is generated using Pod::Tests and pod2test (yay schwern!).
When I run these tests, I never see the descriptions of the tests (eg
"Strings aren't blank").

I thought those strings were meant to output during the testing, to show
you what it's testing for.  Am I confused?

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"My secret weapon is PMS."  -- Buffy the Vampire Slayer



Re: Docs on testing?

2001-06-20 Thread Kirrily Robert

In lists.projects.perl.perl-qa, you wrote:
>I am not a newcomer to this list, just a squatter and I have been
>programming Perl for about a year now (and lovin' every minute of it). After
>reading all the postings on this list about Test::Simple, etc... I was
>wondering, are there any (or plans to create any) docs that explain how to
>write tests?

I believe I volunteered to do that the other day.  More fool me :)

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
There's nothing wrong with me; therefore, there must be something wrong 
with the universe.



Re: Descriptive strings?

2001-06-20 Thread Kirrily Robert

On Tue, Jun 19, 2001 at 08:42:29PM -0400, Michael G Schwern wrote:
| 
| I assume you're talking about "make test"?  Test::Harness in
| non-verbose mode (ie. "make test") won't display any of that info.  If
| you set $verbose = 1 you'll see all the test output.  For failed tests
| it will just report their numbers.

Where do I set $verbose?

| Currently, Test::Harness is not aware of test names at all.  It just
| ignores the extra info.  I'm not sure what I'm going to do about that.
| As sort of a simple, half-ass solution I'm going to have Test::Harness
| dump its verbose output to a file (test.out?) by default.

Hrm.  What I want is to achieve this:

  # This produces "ok 1 - Hell not yet frozen over" (or not ok)
  ok( get_temperature($hell) > 0, 'Hell not yet frozen over' );

(from the Test::Simple perldoc) when I run "make test".

K.



Re: QA-esque summary of TPC

2001-07-31 Thread Kirrily Robert

Schwern wrote:
>
>Dangermouse
>
>We watched Dangermouse, The Avenging Disco Godfather and probably too
>much Monty Python for our own good.  Put yo' WEIGHT on it!

I can see how Danger Mouse might be considered quality, but Avenging
Disco Godfather?  No way.

>Adam Turoff gave a talk about stealing ideas from LaTeX, XML and SGML
>and incorporating them into POD.  I missed it.  Anyone go?

No, but it's in the proceedings, and I'm kind of familiar with the
topic, so I'll attempt a brief rundown in my own words:

1. These days it's fashionable for markup languages to describe the
content, not the presentation.  This helps computers parse them better.
For instance, Je ne sais quois is less recognisable as
a phrase in a foreign language than Je ne sais
quoi

2. POD, as it currently stands, is almost entirely presentation-based.
For instance, =head1 produces a level one heading but doesn't actually
say much about the structure of the document; B<> says something's bold
but doesn't say why.

3. Adam's proposal is that semantic tags would be useful in POD,
primarily for converting between POD and other semantic markup languages
such as Docbook.  He has invented some new POD-like tags for this:

=chapter
=section
=appendix
=title
=fpara (a formal paragraph, i.e. a para with a title)
=list
=code
em<>
function<>
literal<>

4. This would then make it easy to convert to/from Docbook, another very
common/popular documentation markup language.  This means that you don't
have to know all of Docbook to write Docbook -- you can write in this
cut-down, intermediate level: DocPOD

5. There are some modules for doing the translation etc, see DocPod::*,
presumably on CPAN.

HTH,

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"Be pedantic in what you accept, and arbitrarily brutal in what you
send."  -- Malcolm Ray in a.s.r



Re: Pod::Coverage random silliness

2001-08-29 Thread Kirrily Robert

In perl.qa, you wrote:
>On Tue, Aug 28, 2001 at 07:56:30PM -0400, Kirrily 'Skud' Robert wrote:
>> This script...
>
>Nifty, mind if I assimilate it as an example script?

Not at all.  Credit as Kirrily "Skud" Robert <[EMAIL PROTECTED]> please.

K.


-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
How do I set my LaserPrinter to "Stun"?!



ANNOUNCE: Test::Mail 0.03

2001-09-16 Thread Kirrily Robert

Now winging its way towards CPAN mirrors worldwide.

I've implemented it pretty much as described the other day.

Comments etc welcome.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"Sure, only 2 percent of the Internet population uses lynx, but they're 
the top 2 percent."  -- petro, on a.s.r



Re: Test::Harness::Straps

2001-09-20 Thread Kirrily Robert

In perl.qa, you wrote:
>On Thu, Sep 20, 2001 at 10:35:49AM -0400, Shane Landrum wrote:
>> So, I've just found Test::Harness::Straps--- thanks to Skud
>> for pointing me in the right direction. Anyone else using it?
>> I'm working on using it to write a web-based test summarizer
>> for my users. 
>> 
>> Schwern, do you have plans for releasing T::H 2.00 to CPAN
>> as anything other than an alpha? What do you need to see
>> before you release it?
>
>Hmmm, more people trying it, really, especially on the weird
>platforms.  I rewrote all the test analysis logic and I still afraid I
>broke something.

We're probably going to start using it for e-smith's testing foo.
I've dinked around with it briefly, enough to know that it does roughly
what I want, but I'm not on any kind of unusual platform or anything, so
I don't know if that's at all helpful.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"Make a fist, Benno.  No, that's too big."
-- Renee (from the Netizen quotes file)



Re: Wiki Wiki not Wiki Working

2001-09-19 Thread Kirrily Robert

In perl.qa, you wrote:
>Will do.

No! Read on! It's been done already.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
Any sufficiently fucked-up technology is indistinguishable from magic.



Re: [PATCH] More Test::More stuff

2001-09-24 Thread Kirrily Robert

In perl.qa, you wrote:
>>
>> eval { ...code... };
>> is( $@, '' );
>
>Yeah, except that doesn't print out $@ in case of failure.  If I'm
>checking that no exception occurs I want to know what the exception is
>when it happens.

But it does!  It says something like:

not ok 23
# Failed test 1 (eval.t at line 69)
#  got: 'blah blah blah'
# expected: ''


K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"There are three degrees of being weird. There are: 1) Salvageably weird. 
2) Weird. 3) Irrevocably weird."  -- Carrie Fisher



Re: What tests are failing on VMS?

2001-09-22 Thread Kirrily Robert

In perl.qa, you wrote:
>So like I said, either tests are habitually failing on vmsperl, or
>nobody's compiled Perl on OS/390 in a long time (I wouldn't be
>surprised if that were true).

I assume you mean "MVS"?

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
We have only two things to worry about: either that things will 
never get back to normal, or that they already have.



Re: Wiki Wiki Working

2001-09-17 Thread Kirrily Robert

In perl.qa, you wrote:
>
>If someone would be so kind as to fill in TestTutorial from the latest
>version of Test::Tutorial?

Done.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"Verbogeny is one of the pleasurettes of a creatific thinkerizer."
-- Peter da Silva



Re: FAIL Module-InstalledVersion-0.02 cygwin-multi 1.3.2(0.3932)

2001-09-13 Thread Kirrily Robert

In perl.qa, you wrote:
>On Thu, 13 Sep 2001 19:41:39 -0400
>Kirrily 'Skud' Robert <[EMAIL PROTECTED]> wrote:
>
>> Anyone know what might cause this?  The same reporter also had the same
>> problem with CPAN-Test-Reporter.
>
>His Test::Harness needs upgrade?

Yeah, I guess that'd be it.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
Any sufficiently advanced political correctness is indistinguishable 
from irony.  - Erik Naggum



Re: Test::Harness in Test-SDK conflicts with Perl

2001-10-09 Thread Kirrily Robert

In perl.qa, you wrote:
>On Tue, Oct 09, 2001 at 10:10:33PM +0200, Johan Vromans wrote:
>> Michael G Schwern <[EMAIL PROTECTED]> writes:
>> > Debian has the beginnings of that.  perl-base is the minimum necessary
>> > to have a useful Perl, basically a binary, the perl man page, and a
>> > handful of critical modules ...
>> 
>> Wouldn't it be a good idea to try to define packages like these, so
>> that packagers can all make consistent packages?
>
>Come again?

I think he's trying to say that Perl (i.e. the "Perl community") should
define these things so that different packagers (Debian, Red Hat,
whoever) can have somewhat-consistent packages.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
If it's not broken, break it.



Re: Test::Builder: Multiple test libraries in one test.

2001-12-19 Thread Kirrily Robert

In perl.qa, you wrote:
>Candidates for this sort of thing would be CGI::Test, Test::Cmd,
>Test::Unit, Test::Mail and ExtUtils::TBone.  And, of course, Barrie's
>Test::Differences.

Actually, Test::Mail doesn't work like that.  It's more or less a
wrapper around Test::More that handles incoming email.  Doesn't
implement any of its own ok()-like routines at all, just makes it easy
to use Test::More's routines on incoming email.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
Usenet: open mouth, insert foot, propagate internationally



Re: is() with arbitrary comparisions

2001-12-19 Thread Kirrily Robert

In perl.qa, you wrote:
>I think I have a solution to the rigidity of is().  ie. something with
>the diagnostic output of is(), but the flexibility of ok().

>It all makes sense, so what I really need is a better name.

How about:

compare($foo, "<=", $bar)

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
"Does anyone know my root password?"
--Renee (from the Netizen quotes file)



Re: [perl #15479] perl 5.8.0 segfault

2002-07-31 Thread Robert Spier

>> And where did the p5p FAQ get to?
>MJD said he was taking it off his website... or do you mean the serious one?

Do you mean this?

http://simon-cozens.org/writings/p5p-faq

If someone wants to become a new champion for it, we can keep it on
http://dev.perl.org/perl5.  (Another way to enable that would be to
merge it into the perl5 sources, and then the website can check it out
periodically.)

-R




Re: Why not a smoke db ?

2002-09-23 Thread Robert Spier

Alain Barbet writes:
>> Have you seen http://tinderbox.perl.org ?  I've personally found that
>> useful for monitoring Parrot, though it's not obvious how well it would
>> scale for large numbers of smoke-test configurations.
>
>No I didn't know this, but find some good idea in this system too.
>I will see if it's possible to apply (partial part may be ?) to smoke
>system.

This alternate display is prettier, and scales to N trees (than the
standard tinderbox display a lot better.  IMHO:

http://tinderbox.perl.org/tinderbox/bdshowbuild.cgi?tree=parrot

-R




Re: WWW::Mechanize 0.37 released

2003-03-06 Thread Robert Spier
> Help me out here.  I'm trying to imagine why someone would want 
> WWW::Mechanize without a net connection.  Or are you saying that people 
> will want to use it strictly behind a restrictive firewall where 
> google.com isn't accessible?

Yes.

-R


Re: WWW::Mechanize 0.37 released

2003-03-05 Thread Robert Spier

> There really aren't many tests that are meaningful without that access. 
>   00.load.t, 99.pod and add_header.t are all that seem to be valid 
> without it.

You could allow the user to choose between internal and external
tests, where the internal tests are much simpler, maybe including a
trivial self-contained webserver to make sure everything works.

-R


Re: confused by Devel::Cover

2001-08-06 Thread Kirrily 'Skud&#x27; Robert

| > Can anyone please clarify this a bit? 
| 
| With respect to exercising modules, this should all work.  Did the
| module pass its own tests?  Actually, there's only one test at the
| moment, but it does include a module.  What you did should have worked.
| You should have got a report about t/foobar.t and Foo::Bar.pm.  I've run
| some Gedcom.pm tests, and they seemed to give reasonable results (from
| the point of view of being believable, rather than having good coverage.)

Here's what I got...

tanqueray:~/code/reefknot/Net-ICal/t> perl -MDevel::Cover
embedded-Net-ICal-Component.t

... lots of output, blah blah blah...

1..13
# Looks like you failed 6 tests of 13.
# Looks like your test died just after 13.
-- -- -- -- -- --
File stmt branch   path   cond total
-- -- -- -- -- --
embedded-Net-ICal-Component.t   79.17n/an/a 100.00 79.17
Total   79.17n/an/a 100.00 79.17
-- -- -- -- -- --


As far as I can see, it never got down into the module.  The module's
called like this, from embedded-Net-ICal-Component.t ...

use lib "./lib";
use Net::ICal;

A! *There's* my problem... I was calling it from the wrong place.
When I move back up a directory and run "perl -MDevel::Cover
t/embedded-Net-ICal-Component.t" I get this:

-- -- -- -- -- --
File stmt branch   path   cond  total
-- -- -- -- -- --
lib/Net/ICal/Alarm.pm  100.00n/an/a   9.09  60.00
lib/Net/ICal/Attendee.pm 0.00n/an/a   0.00   0.00
lib/Net/ICal/Calendar.pm 0.00n/an/a   0.00   0.00
lib/Net/ICal/Component.pm   47.44n/an/a   7.32  39.09
lib/Net/ICal/Duration.pm 0.87n/an/a   0.00   0.61
lib/Net/ICal/ETJ.pm  6.45n/an/a   0.00   4.35
lib/Net/ICal/Event.pm0.00n/an/a   0.00   0.00
lib/Net/ICal/Freebusy.pm 7.69n/an/a   0.00   5.88
lib/Net/ICal/Journal.pm  0.00n/an/a   0.00   0.00
lib/Net/ICal/Period.pm   0.00n/an/a   0.00   0.00
lib/Net/ICal/Property.pm45.45n/an/a   0.00  39.22
lib/Net/ICal/Recurrence.pm   0.00n/an/a   0.00   0.00
lib/Net/ICal/Time.pm 3.70n/an/a   0.00   3.45
lib/Net/ICal/Todo.pm21.05n/an/a   0.00  14.29
lib/Net/ICal/Trigger.pm 83.33n/an/a   0.00  58.82
lib/Net/ICal/Util.pm 0.00n/an/a   0.00   0.00
t/embedded-Net-ICal-Component.t100.00n/an/a 100.00 100.00
Total   16.20n/an/a   1.33  12.58
-- -- -- -- -- --


That's *much* more like what I expected :)

Next time I'll just talk to the teddy bear.

K.




Pod::Coverage random silliness

2001-08-28 Thread Kirrily 'Skud&#x27; Robert

This script...

#!/usr/bin/perl -w

use strict;
use Pod::Coverage;
use ExtUtils::Installed;

my $m = ExtUtils::Installed->new;
my @modules = $m->modules();

print "Checking POD coverage...\n";

my %coverage;

foreach my $mod (@modules) {
my $pc = new Pod::Coverage package => $mod;
$coverage{$mod} = $pc->coverage() || 0;
}

foreach my $out (sort by_coverage keys %coverage) {
my $bar = "*" x ($coverage{$out} * 40), "\n";
printf("%30s  %3d%%  %s\n", $out, $coverage{$out}*100, $bar);
}

sub by_coverage {
$coverage{$b} <=> $coverage{$a};
}


... gives us ...


Checking POD coverage...
 Pod::Coverage  100%  
   Digest::MD5   90%  
Pod::Tests   87%  ***
Text::Template   54%  *
   Net::Telnet   38%  ***
  Test::Simple   33%  *
 Test::Harness   33%  *
  Perl0%  
Term::ReadLine0%  
   Data::ShowTable0%  
File::Spec0%  
   Pod::Parser0%  
Msql-Mysql-modules0%  
Devel::Symdump0%  
  CPAN0%  
 Image::Magick0%  
  YAML0%  
 Term::ReadKey0%  




Fwd: FAIL Module-InstalledVersion-0.02 cygwin-multi 1.3.2(0.3932)

2001-09-13 Thread Kirrily 'Skud&#x27; Robert

Anyone know what might cause this?  The same reporter also had the same
problem with CPAN-Test-Reporter.

K.





This distribution has been tested as part of the cpan-testers
effort to test as many new uploads to CPAN as possible.  See
http://testers.cpan.org/

Please cc any replies to [EMAIL PROTECTED] to keep other
test volunteers informed and to prevent any duplicate effort.

-- 

some tests failed:
==
$ make test
PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib
-I/usr/lib/perl5/5.6.1/cygwin-multi -I/usr/lib/perl5/5.6.1 -e 'use
Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/embedded-Module-InstalledVersion.FAILED tests 1-7  
Failed 7/7 tests, 0.00% okay
Failed Test  Status Wstat Total Fail  Failed  List
of
Failed
--
t/embedded-Module-InstalledVersion.t   77 100.00%  1-7
Failed 1/1 test scripts, 0.00% okay. 7/7 subtests failed, 0.00% okay.
make: *** [test_dynamic] Error 255

BUT:


$ perl -Mblib t/*.t
Using /perl/cpantest/Module-InstalledVersion-0.02/blib
ok 1 - use Module::InstalledVersion;
ok 2 - create new object for CPAN
ok 3 - Picked up version of CPAN
ok 4 - create new object for Fcntl
ok 5 - Picked up version of Fcntl
ok 6 - create new object for Text::Wrap
ok 7 - Picked up version of Text::Wrap
1..7

Gerrit
--

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=cygwin, osvers=1.3.2(0.3932), archname=cygwin-multi
uname='cygwin_nt-4.0 loreley 1.3.2(0.3932) 2001-05-20 23:28 i686 unknown '
config_args='-de -Dusemultiplicity'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=define
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing 
-I/usr/local/include',
optimize='-O2',
cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.3-5 (cygwin special)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
ld='ld2', ldflags =' -s -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lgdbm -lcrypt
perllibs=-lcrypt
libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl5_6_1.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s'
cccdlflags=' ', lddlflags=' -s -L/usr/local/lib'





Test::Mail request for comments

2001-09-13 Thread Kirrily 'Skud&#x27; Robert

At work at e-smith, I'm working on an app that sends a lot of email here
and there and everywhere.  It would be *really* handy for me to have a
way to test that the email it's sending is right.  So this morning in
the shower (where I do all my best thinking) I was considering writing
Test::Mail.

Below is some rough pre-documentation for it.  None of it's written yet,
so don't ask me about the details.  However, I wanted to throw it out to
this list to say "I'm working on it" and also "Do you think I'm heading
in the right direction?"

Comments welcome.

K.


NAME
Test::Mail - Test framework for email applications

SYNOPSIS
use Test::Mail log => $logfile;
sub first_test { }
sub second_test { }
...

DESCRIPTION
Test::Mail provides a framework for testing applications which send and
receive email.

A typical example of an email application might send a notification to a
certain email address, setting certain headers in certain ways and
having certain content in the body of the email. It would be nice to be
able to test these things automatically, however most email applications
are currently tested by visual inspection of the email received.

Test::Mail allows you to automate the testing of email applications by
piping any relevant email through a Test::Mail script.

"Relevant" email is identified by the presence of an X-Test-Mail:
header. You should set this email in your application or whatever you
use to generate the mail.

X-Test-Mail: birthday_notification

The value of that header is the name of a subroutine which exists in
your Test::Mail script. The subroutine contains Test::More tests to run
on the email:

sub birthday_notification {
is($header->get("From:"), '[EMAIL PROTECTED]', "From address check");
like($body, qr/Today's Birthdays/, "Email body check");
}

This allows you to have tests for multiple different kinds of email in
one script.

Note that $header and $body are set by Test::Mail for your convenience.
$header is a Mail::Header object. $body is the body of the email as a
single string. MIME attachments etc are not supported (yet).

The results of the tests run are output to the logfile you specify, and
look something like this:

# test results for birthday_notification for <[EMAIL PROTECTED]>
ok 1 - From address check
ok 2 - Email body check
   
# test results for support_request for <[EMAIL PROTECTED]>
ok 1 - To address check
not ok 2 - Subject line
not ok 3 - Included ticket number
ok 4 - Body contains plain text

Note that while these are roughly similar to normal CPAN test output
conventions, counting only occurs on a per-email basis

  Sending incoming mail to Test::Mail

To call Test::Mail, simply put a suitable filter in your .procmailrc,
Mail::Audit script, or whatever you use to filter your email. Here's how
I'd do it with Mail::Audit:

if ($mail->{obj}->head->get("X-Test-Mail")) {
$mail->pipe("testmail.pl");
}

If for some reason you want to test mail that doesn't already have an
X-Test-Mail: header, you could do something like:

if ($mail->{subject} =~ /test/i) {
$mail->{obj}->head->add("X-Test-Mail", "subject_auto");
$mail->pipe("testmail.pl");
}

  Unaddressed issues

The above is a rough outline of version 1. There are several issues I
don't yet know how to deal with, which I'm listing here just in case
anyone has any good ideas:

*   Sending output somewhere more useful than a logfile

*   Integrating into a real "test suite" that's friendly to
Test::Harness

*   Handling MIME in a suitable way

SEE ALSO
the Test::More manpage, the Mail::Header manpage, the Mail::Audit
manpage

AUTHOR
Kirrily "Skud" Robert <[EMAIL PROTECTED]>





testing web foo with Test::More

2001-10-07 Thread Kirrily 'Skud&#x27; Robert

OK, I've been putting off figuring this out for ages, but here it is:

#!/usr/bin/perl -w

use strict;
use Inline 'WebChat';
use Test::More 'no_plan';

ok(google(), "Can get google");

__END__

__WebChat__

sub google {
GET http://google.com/
EXPECT OK && /google/i
}

That's it.  Easy.

I'm updating the Test::FAQ on the Wiki to show this.

K.





Test::More and WWW::Chat fighting over fail()

2001-10-07 Thread Kirrily 'Skud&#x27; Robert

Both Test::More and WWW::Chat export a routine called fail().  This
makes it rather hard to write tests for web stuff using both these
modules.

Since WWW::Chat's fail() is only used internally, could I possibly
request that it be changed to not export, and/or rename it _fail, or
whatever.  Anything.

Also, there's some weirdness with webchatpp's generated code if your
WWW::Chat script was inside subroutines (or presumably other blocks).
Here's a real life example:

#!/usr/bin/perl -w

use strict;
use Inline 'WebChat';
use Test::More 'no_plan';

ok(manager(), "Manager is running and requires login");
ok(manager_admin_login(), "Can login to manager as admin");

__END__

__WebChat__

sub manager {
GET http://192.168.1.1:980/
EXPECT 401
}

sub manager_admin_login {
$ua->credentials(
"192.168.1.1:980", 
"March Networks SME Server manager", 
"admin", 
$password
);
GET http://192.168.1.1:980/
EXPECT OK && /March Networks Server manager/
}

If you run that through webchatpp you'll see that there are evals that 
cross over between subs, like this:

sub foo {
eval {
blah blah
}

sub bar {
blah blah
more blah
} # end eval here, WRONG
}

It would be nice if we could get this to work ;)  But as a workaround, I 
can live with one sub per script for now, I guess :-/

K.




Test::Harness in Test-SDK conflicts with Perl

2001-10-07 Thread Kirrily 'Skud&#x27; Robert

I've built an RPM of Test-SDK using cpan2rpm, and when I try to install
it on a Red Hat system it says:

[root@e-smith skud]# rpm -Uvh perl-Test-SDK-0.04-1.i386.rpm 
Preparing...### [100%]
file /usr/lib/perl5/5.6.0/Test/Harness.pm from install of perl-Test-SDK-0.04-1 
conflicts with file from package perl-5.6.0-12
file /usr/share/man/man3/Test::Harness.3pm.gz from install of perl-Test-SDK-0.04-1 
conflicts with file from package perl-5.6.0-12


Not sure what to do about this.  Suggestions welcome.  I'm going to
forward this to our internal e-smith RPM weenies, who might have some
ideas, but I thought I'd raise it on perl-qa too, in case anyone else
had thoughts.

K.



Re: testing web foo with Test::More

2001-10-09 Thread Kirrily 'Skud&#x27; Robert

On Tue, Oct 09, 2001 at 09:17:06AM -0400, Shane Landrum wrote:
| On Sun, Oct 07, 2001 at 03:30:58PM -0400, Kirrily 'Skud' Robert ([EMAIL PROTECTED]) 
|wrote:
| > OK, I've been putting off figuring this out for ages, but here it is:
| 
| 
| 
| Another way to accomplish the same thing, that I hacked up to
| test an internal password-protected web gadget:

Well, WWW::Chat just gets pre-processed into LWP code.  But I like it
because it's at least an order of magnitude less LOC for anything more
than:

ok(LWP::Simple::get($url), "Get $url");

For instance, if you want to get a page, fill in a form, look at the
results, WWW::Chat is *definitely* your friend.  I'm about to start
using it with FormMagick.

K.




Re: is() with arbitrary comparisions

2001-12-19 Thread Kirrily 'Skud&#x27; Robert

On Wed, Dec 19, 2001 at 03:50:12PM -0500, Michael G Schwern wrote:
> On Tue, Dec 11, 2001 at 01:52:12PM -0500, Kirrily Robert wrote:
> 
> Are we doing the time warp again, or are the Huskies just tired of
> pulling the packets across the border?
> 
> 
> > How about:
> > 
> > compare($foo, "<=", $bar)
> 
> cmp_ok().  Close.

My mail server got all confused and constipated for a few days.  Sorry
for the old email suddenly appearing today :)

K.




Interactive tests?

2002-02-13 Thread Kirrily 'Skud&#x27; Robert

Using Test::More, how can I intersperse stuff for user interaction?  For
instance:

print "Please enter the hostname/ip for the server [localhost]: ";
my $host = ;
print "Please enter the admin password [default]: ";
my $password = ;
$agent = esmith::FormMagick::Tester->new(host => $host, password => $password);
isa_ok($agent, 'esmith::FormMagick::Tester');
is($agent->{password}, $password || 'default', "Set password correctly");

Test::More takes control of so much stuff that my user prompts are never
printed.

K.