]> granicus.if.org Git - postgis/commitdiff
Works for MinGW now
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 31 May 2012 22:16:02 +0000 (22:16 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 31 May 2012 22:16:02 +0000 (22:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9846 b70326c6-7e19-0410-871a-916f4a2858ee

regress/run_test.pl

index 5361f058d324857ceb9cee0f9fefe0b283df8a10..1b2c1ff7663c39d7a36c9b11c3d002b01d397282 100755 (executable)
@@ -4,8 +4,7 @@ use File::Basename;
 use File::Temp 'tempdir';
 #use File::Which;
 use File::Copy;
-use File::Path 'make_path';
-use File::Path 'remove_tree';
+use File::Path;
 use Cwd 'abs_path';
 use Getopt::Long;
 
@@ -324,7 +323,7 @@ print "Failed: $FAIL\n";
 
 if ( $OPT_CLEAN )
 {
-       remove_tree($TMPDIR);
+       rmtree($TMPDIR);
 }
 
 if ( ! ($OPT_NODROP || $OPT_NOCREATE) )
@@ -528,7 +527,7 @@ sub run_simple_test
        my $tmpfile = sprintf("%s/test_%s_tmp", $betmpdir, $RUN);
        my $diffile = sprintf("%s/test_%s_diff", $TMPDIR, $RUN);
 
-       make_path($betmpdir);
+       mkpath($betmpdir);
 
        my $cmd = "psql -v \"VERBOSITY=terse\" -v \"tmpfile='$tmpfile'\" -tXA $DB < $sql > $outfile 2>&1";
        my $rv = system($cmd);
@@ -1173,13 +1172,14 @@ sub diff
 
        open(OBT, $obtained_file) || die "Cannot open $obtained_file\n";
        open(EXP, $expected_file) || die "Cannot open $expected_file\n";
-       $lineno=0;
+       my $lineno=0;
        while (!eof(OBT) or !eof(EXP)) {
                # TODO: check for premature end of one or the other ?
-               $obtline=<OBT>;
-               $expline=<EXP>;
-               chop($obtline); chop($expline);
-               ++$lineno;
+               my $obtline=<OBT>;
+               my $expline=<EXP>;
+               $obtline =~ s/(\r\n|\n)$//;
+               $expline =~ s/(\r\n|\n)$//;
+               $lineno++;
                if ( $obtline ne $expline ) {
                        my $diffln .= "$lineno.OBT: $obtline\n";
                        $diffln .= "$lineno.EXP: $expline\n";