Front page | perl.qa |
Postings from February 2009
Re: Have Harness Run App With No Files?
Thread Previous
|
Thread Next
From:
David E. Wheeler
Date:
February 19, 2009 13:29
Subject:
Re: Have Harness Run App With No Files?
Message ID:
E303A6C5-3B0E-4D7D-9116-E5335BB1CD6E@kineticode.com
On Jan 26, 2009, at 10:54 PM, David E. Wheeler wrote:
> TAP::Harness->new({
> verbosity => $opts->{verbose} || $ENV{TEST_VERBOSE},
> timer => $opts->{timer},
> color => $opts->{color},
> exec => ['psql', '-c' 'SELECT * FROM tap.runtest()'],
> })->runtests();
>
> The issue with this is that, currently, no tests will be run because
> nothing is passed to runtests()! Is there something I could pass
> that runtest() wouldn't stat or parse but would run the `exec`
> command anyway?
I can almost do it like this:
TAP::Harness->new({
verbosity => $opts->{verbose} || $ENV{TEST_VERBOSE},
timer => $opts->{timer},
color => $opts->{color},
exec => ['psql', '-c'],
})->runtests('SELECT * FROM tap.runtest()');
However, TAP::Parser only wants raw TAP or a file name. If it's not a
file name, it says "No such file or directory." I really want to avoid
this. Andy, is there no way to specify that a test isn't a file? Or
for me to use
exec => ['psql', '-c' 'SELECT * FROM tap.runtest()'],
and then call runtests() with no arguments, and have it call that
script once?
Thanks,
David
Thread Previous
|
Thread Next