/usr/share/doc/libplplot12/examples/test_diff.sh is in libplplot-dev 5.10.0+dfsg2-0.1ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | #!/bin/bash
# Test suite to compare C examples with other language bindings
#
# Copyright (C) 2008 Andrew Ross
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PLplot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
ret=0
# Comparison C results have no xsuffix.
xsuffix_c=
# Compare C results with c++, f95, java, octave, python, tcl, perl,
# ada, ocaml, lua and d results
for lang in c++ f95 java octave python tcl perl ada adathick ocaml lua d; do
# Check which suffix is used for this binding
case $lang in
c++)
xsuffix=
suffix=cxx
;;
f95)
xsuffix=
suffix=f95
;;
java)
xsuffix=
suffix=j
;;
octave)
xsuffix=
suffix=o
;;
python)
xsuffix=
suffix=p
;;
tcl)
xsuffix=
suffix=t
;;
perl)
xsuffix=
suffix=pdl
;;
ada)
xsuffix=
suffix=a
;;
adathick)
xsuffix=thick
suffix=a
;;
ocaml)
xsuffix=
suffix=ocaml
;;
lua)
xsuffix=
suffix=lua
;;
d)
xsuffix=
suffix=d
;;
esac
missing=""
different=""
diffstdout=""
missingstdout=""
# List of standard examples
INDEX_LIST="00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 14a 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33"
# Check if any examples exist for this language.
EXAMPLES_EXIST="no"
for index in ${INDEX_LIST} ; do
if [ -f x${xsuffix}${index}${suffix}.psc ] ; then
EXAMPLES_EXIST="yes"
break
fi
done
if [ "$EXAMPLES_EXIST" = "yes" ] ; then
for index in ${INDEX_LIST} ; do
if [ ! -f x${xsuffix_c}${index}c.psc ] ; then
echo "C example ${index} is missing"
else
if [ ! -f x${xsuffix}${index}${suffix}.psc ] ; then
missing="${missing} ${index}"
else
if [ "ON" = "ON" ] ; then
# Skip first 190 bytes of comparison to ignore date stamp.
/usr/bin/cmp -s -i 190 x${xsuffix_c}${index}c.psc x${xsuffix}${index}${suffix}.psc
if [ $? != 0 ] ; then
different="${different} ${index}"
fi
else
# Drop first 8 lines from comparison to ignore date stamp.
/usr/bin/tail -n +9 x${xsuffix_c}${index}c.psc > test1.psc
/usr/bin/tail -n +9 x${xsuffix}${index}${suffix}.psc > test2.psc
/usr/bin/diff -q test1.psc test2.psc 2>&1 > /dev/null
if [ $? != 0 ] ; then
different="${different} ${index}"
fi
fi
if [ "$index" != "14a" ] ; then
if [ -f x${xsuffix}${index}${suffix}_psc.txt ] ; then
/usr/bin/diff -q x${xsuffix_c}${index}c_psc.txt x${xsuffix}${index}${suffix}_psc.txt 2>&1 > /dev/null
if [ $? != 0 ] ; then
diffstdout="${diffstdout} ${index}"
fi
else
missingstdout="${missingstdout} ${index}"
fi
fi
fi
fi
done
echo "${lang}"
echo " Missing examples : ${missing}"
echo " Differing postscript output : ${different}"
echo " Missing stdout : ${missingstdout}"
echo " Differing stdout : ${diffstdout}"
if [ "${different}" != "" -o "${diffstdout}" != "" ] ; then
ret=1
fi
fi
done
if [ "${ret}" != "0" ] ; then
echo "WARNING: Some PostScript or stdout results were different"
fi
|