[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: run_tests.sh



  User: danmc   
  Date: 07/04/21 17:05:04

  Modified:    .        run_tests.sh
  Log:
  - top_srcdir is not passed in the environment by default plus we don't
  
  need it so don't refer to it.
  
  
  
  - point to the correct directory for the gnetlist binary (not by way of
  
  top_srcdir)
  
  
  
  - don't need perl so don't bother with setting PERL
  
  
  
  - avoid the use of "diff -I".  Solaris doesn't support that.
  
  
  
  - avoid the return code being set to " ".
  
  
  
  
  Revision  Changes    Path
  1.3       +20 -20    eda/geda/gaf/gnetlist/tests/spice-sdb/run_tests.sh
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: run_tests.sh
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gnetlist/tests/spice-sdb/run_tests.sh,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- run_tests.sh	21 Apr 2007 19:13:40 -0000	1.2
  +++ run_tests.sh	21 Apr 2007 21:05:00 -0000	1.3
  @@ -73,11 +73,7 @@
   srcdir=${srcdir:-$here}
   srcdir=`cd $srcdir && pwd`
   
  -top_srcdir=${top_srcdir:-$here/../..}
  -top_srcdir=`cd $top_srcdir && pwd`
  -
  -# the perl program
  -PERL=${PERL:-perl}
  +GNETLIST=../../../src/gnetlist
   
   rundir=${here}/run
   
  @@ -110,9 +106,9 @@
   
   Starting tests in $here
   srcdir:     $srcdir
  -top_srcdir: $top_srcdir
   INPUT_DIR:  ${INPUT_DIR}
   GOLDEN_DIR: ${GOLDEN_DIR}
  +GNETLIST:   ${GNETLIST}
   all_tests:
   
   ${all_tests}
  @@ -131,13 +127,13 @@
       schematics=`grep "^[ \t]*${t}[ \t]*|" $TESTLIST | awk 'BEGIN{FS="|"} {print $2}'`
       auxfiles=`grep "^[ \t]*${t}[ \t]*|" $TESTLIST | awk 'BEGIN{FS="|"} {print $3}'`
       args=`grep "^[ \t]*${t}[ \t]*|" $TESTLIST | awk 'BEGIN{FS="|"} {print $4}'`
  -    code=`grep "^[ \t]*${t}[ \t]*|" $TESTLIST | awk 'BEGIN{FS="|"} {print $5}'`
  -    echo Schematics to copy = $schematics
  -    echo Args to copy = $args
  -    echo Return codes to copy = $code
  +    code=`grep "^[ \t]*${t}[ \t]*|" $TESTLIST | awk 'BEGIN{FS="|"} {print $5}' | sed 's; ;;g'`
       if test "X$code" = "X" ; then
   	code=0
       fi
  +    echo "Schematics to copy   = $schematics"
  +    echo "Args to copy         = $args"
  +    echo "Expected return code = \"$code\""
   
   
       tot=`expr $tot + 1`
  @@ -155,21 +151,23 @@
       if test ! -z "$schematics" ; then
   	echo "Copying over schematics to run dir"
   	for f in $schematics ; do
  -	    echo cp ${INPUT_DIR}/${f} ${rundir}/${f}
  +	    echo "cp ${INPUT_DIR}/${f} ${rundir}/${f}"
   	    cp ${INPUT_DIR}/${f} ${rundir}/${f}
  +	    chmod 644 ${rundir}/${f}
   	done
       fi
       if test ! -z "$auxfiles" ; then
   	echo "Copying over aux files to run dir"
   	for f in $auxfiles ; do
  -	    echo cp ${INPUT_DIR}/${f} ${rundir}/${f}
  +	    echo "cp ${INPUT_DIR}/${f} ${rundir}/${f}"
   	    cp ${INPUT_DIR}/${f} ${rundir}/${f}
  +	    chmod 644 ${rundir}/${f}
   	done
       fi
       
       # run gnetlist -g spice-sdb
  -    echo "${top_srcdir}/src/gnetlist -g spice-sdb $args $schematics"
  -    cd ${rundir} && ${top_srcdir}/src/gnetlist -g spice-sdb $args $schematics 
  +    echo "${GNETLIST} -g spice-sdb $args $schematics"
  +    cd ${rundir} && ${GNETLIST} -g spice-sdb $args $schematics 
       rc=$?
       if test $rc -ne $code ; then
   	echo "FAILED:  gnetlist -g spice-sdb returned $rc which did not match the expected $code"
  @@ -190,19 +188,20 @@
   	echo "Regenerated ${ref}"
       elif test -f ${ref} ; then
   
  -	# The -I "gnetlist -g" is in there to ignore the command line 
  -	# output in the spice-sdb netlist.
  -	if diff -I "gnetlist -g" -w ${ref} ${out} >/dev/null ; then
  +	sed '/gnetlist -g/d' ${ref} > ${out}.tmp1
  +	sed '/gnetlist -g/d' ${out} > ${out}.tmp2
  +
  +	if diff -w ${out}.tmp1 ${out}.tmp2 >/dev/null ; then
   	    echo "PASS"
   	else
   	    echo "FAILED:  See diff -w ${ref} ${out}"
   	    fail=`expr $fail + 1`
  -	    bad=1
   	    good=0
  +	    bad=1
   	fi
       else
   	echo "No reference file.  Skipping"
  -	skip=`expr $skip + 1`
  +	good=0
   	soso=1
       fi
   
  @@ -230,3 +229,4 @@
   fi
   
   exit $rc
  +
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs