develooper Front page | perl.qa | Postings from February 2009

Re: Have Harness Run App With No Files?

Thread Previous
From:
David E. Wheeler
Date:
February 19, 2009 15:53
Subject:
Re: Have Harness Run App With No Files?
Message ID:
3839225B-5FEE-4FB0-BBA3-C6BE541F0D95@kineticode.com
On Feb 19, 2009, at 1:29 PM, David E. Wheeler wrote:

> 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?

Ooh, I figured it out! You can ignore this thread now, but for  
posterity, the above example is actually what works. Because I'm  
passing `exec`, it doesn't check for the presence of the file, it just  
runs the test. :-)

Thanks,

David

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About