2
# Test suite to compare C examples with other language bindings
4
# Copyright (C) 2008 Andrew Ross
6
# This file is part of PLplot.
8
# PLplot is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU Library General Public License as published
10
# by the Free Software Foundation; either version 2 of the License, or
11
# (at your option) any later version.
13
# PLplot is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Library General Public License for more details.
18
# You should have received a copy of the GNU Library General Public License
19
# along with PLplot; if not, write to the Free Software
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24
# Comparison C results have no xsuffix.
27
# Compare C results with c++, f77, f95, java, octave, python, tcl, perl,
28
# ada, ocaml, lua and d results
29
for lang in c++ f77 f95 java octave python tcl perl ada adathick ocaml lua d; do
31
# Check which suffix is used for this binding
92
# List of standard examples
93
INDEX_LIST="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"
94
# Check if any examples exist for this language.
96
for index in ${INDEX_LIST} ; do
97
if [ -f x${xsuffix}${index}${suffix}.psc ] ; then
102
if [ "$EXAMPLES_EXIST" = "yes" ] ; then
103
for index in ${INDEX_LIST} ; do
104
if [ ! -f x${xsuffix_c}${index}c.psc ] ; then
105
echo "C example ${index} is missing"
107
if [ ! -f x${xsuffix}${index}${suffix}.psc ] ; then
108
missing="${missing} ${index}"
110
if [ "ON" = "ON" ] ; then
111
# Skip first 190 bytes of comparison to ignore date stamp.
112
/usr/bin/cmp -s -i 190 x${xsuffix_c}${index}c.psc x${xsuffix}${index}${suffix}.psc
113
if [ $? != 0 ] ; then
114
different="${different} ${index}"
117
# Drop first 8 lines from comparison to ignore date stamp.
118
/usr/bin/tail -n +9 x${xsuffix_c}${index}c.psc > test1.psc
119
/usr/bin/tail -n +9 x${xsuffix}${index}${suffix}.psc > test2.psc
120
/usr/bin/diff -q test1.psc test2.psc 2>&1 > /dev/null
121
if [ $? != 0 ] ; then
122
different="${different} ${index}"
125
if [ "$index" != "14a" ] ; then
126
if [ -f x${xsuffix}${index}${suffix}_psc.txt ] ; then
127
/usr/bin/diff -q x${xsuffix_c}${index}c_psc.txt x${xsuffix}${index}${suffix}_psc.txt 2>&1 > /dev/null
128
if [ $? != 0 ] ; then
129
diffstdout="${diffstdout} ${index}"
132
missingstdout="${missingstdout} ${index}"
139
echo " Missing examples : ${missing}"
140
echo " Differing postscript output : ${different}"
141
echo " Missing stdout : ${missingstdout}"
142
echo " Differing stdout : ${diffstdout}"
143
if [ "${different}" != "" -o "${diffstdout}" != "" ] ; then
149
if [ "${ret}" != "0" ] ; then
150
echo "WARNING: Some PostScript or stdout results were different"