> This message is in MIME format. Since your mail reader does not understand > this format, some or all of this message may not be legible. > > > I tried modifying the script, but it still did not work: > > main.pl > ~~~~~~~ > use vars qw/ $foo /; #So does our $foo > $foo = 2; > runtests @tests; > > t\1.t > ~~~~~ > print "1..1\n"; > > my $bar = $main::foo; > print $bar == 2 ? "ok 2\n" : "not ok 2\n"; > ------------------------------ > Fails with message: > > Running tests... > t\0....ok > t\1....FAILED tests 1-2 > Failed 2/1 tests, -100.00% okay > Failed Test Stat Wstat Total Fail Failed List of Failed > ---------------------------------------------------------------------------- > --- > t\1.t 1 2 200.00% 1-2 >
Ok I think I was confused about what you were doing earlier. In general the test harness runs the individual test files in a piped open call which runs as a separate process, so the test scripts can't (and probably shouldn't) rely on code in the main testing script. Any code that needs to be shared between the two is usually added to a separate testing library that can then be included across multiple testing files. At least I imagine. I am fairly new to the whole Perl test harness world, so maybe there is a better way but I couldn't think of one off hand... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]