Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
gives me o/p#!/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);
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 . Regards1..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);
Edited by Chady -- more code tags.
Edited by BazB: retitle from "Query"
|
|---|