hi my program
#!/usr/bin/perl-w use Test; my $iswin32; BEGIN{ $|=1; if ($] < 5.003) { eval("require Win32"); $iswin32 = ! $@; } else { $iswin32 = $^O eq "MSWin32"; } plan tests => 12, onfail => sub { $? = 1 if $ENV{AEGIS_TEST} } } END {print "not ok 1\n" unless $loaded;} use Test::Cmd; $loaded = 1; ok(1); my($test, $ret, $wdir, $wdir_file2, $wdir_foo_file1); my @lines; $test = Test::Cmd->new(workdir => '', subdir => 'foo'); ok($test); $wdir = $test->workdir; ok($wdir); $int=$test->prog("t.pl"); print"hi\n"; $a=$test->run(args => '-x type.pl',chdir=>$int,interpreter=>'$^X'); if ($? == 0) { print "ok \n"; } else { print "not ok \n"; }; #$test->stdout($test->run(args => '-x t.pl',chdir=>$int,interpreter=>' +$^X')); ok($a);
gives me o/p
1..12 # Running under perl version 5.006 for linux # Current time local: Wed Jun 23 16:25:14 2004 # Current time GMT: Wed Jun 23 10:55:14 2004 # Using Test.pm version 1.25 ok 1 ok 2 ok 3 hi ok not ok 4 # Failed test 4 in new.pl at line 34 # new.pl line 34 is: ok($a);
i.e if i print below run(), i get output as ok but elsewise not ok. how can i see the actual ouput of the prog with run() instead of using directly ' $^X' script . Regards

Edited by Chady -- more code tags.

Edited by BazB: retitle from "Query"


In reply to How to get output from Test::run() by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.