]> granicus.if.org Git - postgis/commitdiff
Use system diff when available (my implementation is horrible)
authorSandro Santilli <strk@keybit.net>
Sat, 25 May 2013 18:10:59 +0000 (18:10 +0000)
committerSandro Santilli <strk@keybit.net>
Sat, 25 May 2013 18:10:59 +0000 (18:10 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11500 b70326c6-7e19-0410-871a-916f4a2858ee

regress/run_test.pl

index 2d4186a66507be3830ab1d1418f1d7442fa3e7fd..99e803f8675fe695c92401b4480fcf6ab74ba14f 100755 (executable)
@@ -35,7 +35,7 @@ our $REGDIR = abs_path(dirname($0));
 our $SHP2PGSQL = $REGDIR . "/../loader/shp2pgsql";
 our $PGSQL2SHP = $REGDIR . "/../loader/pgsql2shp";
 our $RASTER2PGSQL = $REGDIR . "/../raster/loader/raster2pgsql";
-
+our $sysdiff = `which diff 2>/dev/null`;
 
 ##################################################################
 # Parse command line opts
@@ -1194,6 +1194,11 @@ sub diff
        my ($expected_file, $obtained_file) = @_;
        my $diffstr = '';
 
+       if ( $sysdiff ) {
+               $diffstr = `diff -u $expected_file $obtained_file`;
+               return $diffstr;
+       }
+
        open(OBT, $obtained_file) || die "Cannot open $obtained_file\n";
        open(EXP, $expected_file) || die "Cannot open $expected_file\n";
        my $lineno = 0;