From: Sandro Santilli Date: Sat, 25 May 2013 18:10:59 +0000 (+0000) Subject: Use system diff when available (my implementation is horrible) X-Git-Tag: 2.1.0beta3~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4ac8262d6984b5270a54db62e535838d63bb8c8;p=postgis Use system diff when available (my implementation is horrible) git-svn-id: http://svn.osgeo.org/postgis/trunk@11500 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/regress/run_test.pl b/regress/run_test.pl index 2d4186a66..99e803f86 100755 --- a/regress/run_test.pl +++ b/regress/run_test.pl @@ -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;