X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=build%2Ftester;h=73794d9396b818711c0e70854d627ab16b31e848;hb=bced8a6555af8e0c34d8eb852a2b5ffa33f9006a;hp=a9bdfd60f7de2f2c350942917361814b7e605dd0;hpb=45272d09316ecfba01f10e1968bd6f9a921909d2;p=libucw.git diff --git a/build/tester b/build/tester index a9bdfd60..73794d93 100755 --- a/build/tester +++ b/build/tester @@ -1,6 +1,7 @@ #!/usr/bin/perl # A simple unit testing script # (c) 2004 Martin Mares +# (c) 2007 Pavel Charvat my @tests = (); my $tt; @@ -36,8 +37,8 @@ foreach $tt (@tests) { $prev_run = $run; my ($ifi, $ofi); if (defined $tt->{'In'}) { - $ifi = "run/tmp/test$i.in"; - open X, ">$ifi" or die "Unable to create $ifi"; + $ifi = "tmp/test$i.in"; + open X, ">run/$ifi" or die "Unable to create $ifi"; print X $tt->{'In'}, "\n"; close X; $run .= " <$ifi"; @@ -45,20 +46,20 @@ foreach $tt (@tests) { $run .= " {'Out'}) { - $ofi = "run/tmp/test$i.out"; - unlink $ofi; + $ofi = "tmp/test$i.out"; + unlink "run/$ofi"; $run .= " >$ofi"; } else { $run .= " >/dev/null"; } - `$run`; + system "cd run && ( $run )"; if ($?) { print "FAILED with exit code $?\n"; $errors++; next; } if (defined $tt->{'Out'}) { - open X, "<$ofi" or die "Unable to read $ofi"; + open X, "