#!/bin/tcsh
# Verify that "small testfiles" (with pattern x**) generated by rsync 
# transfer test match those in "reference" directory
if ($#argv != 2) then
  echo usage: $0 refdir testdir
  exit 1
endif

set refdir=$1
set testdir=$2

if (! -e $refdir) then
  echo $refdir not found\!
  exit 1
endif

if (! -e $testdir) then
  echo $testdir not found\!
  exit 1
endif

foreach file ($refdir/x*)
  set basename=$file:t
  echo check $basename
  if (! -e $testdir/$basename) then
    echo $testdir/$basename not found\!
  else
    diff $file $testdir/$basename >/dev/null
    if ($status != 0) then
      echo $testdir/$basename differs from reference
    endif
  endif

end


