Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Saturday January 06, 2007
12:02 PM

Testing Perl, Ruby, and URLs in one go!

[ #32092 ]

$ runtests --execrc my_execrc t/ -q - < test_urls.txt
t/10-stuff.....Failed 1/6 tests
        (less 2 skipped tests: 3 okay)
        (1 test unexpectedly succeeded)
t/ruby.........ok
http://www.google.com/....ok
http://www.yahoo.co m/.....ok

Test Summary Report
-------------------
t/10-stuff.t (Wstat: 256 Tests: 6 Failed: 1)
  Failed tests:  2
  TODO passed:   6
  Tests skipped: 3-4
Files=4, Tests=10,  2 wallclock secs ( 0.92 cusr +  0.23 csys =  1.15 CPU)

t/10-stuff.t is a normal Perl test.

t/ruby.t is a test written in Ruby (I did not include a shebang line in the Ruby test to demonstrate that you can run it anyway).

The two URLs are brand new tests that show we can even test the web with this new test framework. This is driven by the execrc file, though naturally this is for advanced users.

# This is the default for all files
'/usr/bin/perl -wT' => '*'

# whoops!  Looks like a ruby test got in there
'/usr/bin/ruby' => 't/ruby.t'

# let's see if we can test fetching web pages!
'/usr/bin/perl -w test_html.pl' => 'http://www.google.com/'
'/usr/bin/perl -w test_html.pl' => 'http://www.yahoo.com/'

Eventually I'd like to add regex support, but for the time being, this will have to do.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Is there support for something like variant testing? That is run the same test with different command lines, e.g. 'perl' and 'perl -w' or 'plumhead --variant=phc' and 'plumhead --variant=antlr3'.
    --
    /* Bernhard.Schmalhofer@gmx.de */
    • No, nothing like that had occurred to me.

    • I agree this would be useful. In particular, historically, there have been quite a few perl bugs with taint mode where taint-safe code behaved differently when run in taint mode than when run without tainting. So, running a taint-safe test both with and without taint mode seems like a valuable, dare I say routine, test to perform.

      --
      /-\