~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/plplot_test/test_f77.sh.in

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!@SH_EXECUTABLE@
 
2
# Test suite for f77 examples.
 
3
#
 
4
# Copyright (C) 2004  Alan W. Irwin
 
5
# Copyright (C) 2004  Andrew Ross
 
6
#
 
7
# This file is part of PLplot.
 
8
#
 
9
# PLplot is free software; you can redistribute it and/or modify
 
10
# it under the terms of the GNU Library General Public License as published
 
11
# by the Free Software Foundation; either version 2 of the License, or
 
12
# (at your option) any later version.
 
13
#
 
14
# PLplot is distributed in the hope that it will be useful,
 
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
# GNU Library General Public License for more details.
 
18
#
 
19
# You should have received a copy of the GNU Library General Public License
 
20
# along with PLplot; if not, write to the Free Software
 
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
22
 
 
23
# This is called from plplot-test.sh with $f77dir, $device, $dsuffix,
 
24
# $options, and possibly $verbose_test defined.
 
25
 
 
26
# To build the f77 examples before running this script do the following:
 
27
# pushd $f77dir; make; popd
 
28
 
 
29
lang="f"
 
30
export index lang 
 
31
if [ "yes@HAVE_F77PARSE_CL_TRUE@" = "yes" ] ; then
 
32
# This stanza only works if fortran has command-line parsing capability.
 
33
# However, this is the preferred method because it allows access to
 
34
# command-line parsing of the $options (e.g., familying options for png
 
35
# and jpeg devices) that have been passed from plplot-test.sh
 
36
 
 
37
# Do non-standard example 16a because it illustrates plshade functionality
 
38
# with cmap1 (and also because the result looks nice.)
 
39
    if [ "$verbose_test" ] ; then
 
40
        echo "x16af"
 
41
    fi
 
42
    index="16a"
 
43
    $DEBUG_CMD "$f77dir"/x16af -dev $device -o "${OUTPUT_DIR}"/x16af%n.$dsuffix $options 2> test.error
 
44
    status_code=$?
 
45
    cat test.error
 
46
    if [ "$status_code" -ne 0 ] ; then
 
47
        exit $status_code
 
48
    fi
 
49
  # Look for any PLPLOT ERROR messages from plwarn that do not result in an
 
50
  # exit code.
 
51
    is_error=`grep -l 'PLPLOT ERROR' test.error`
 
52
    if [ -n "$is_error" ] ; then
 
53
        exit 1
 
54
    fi
 
55
 
 
56
# Do the standard non-interactive examples.
 
57
    for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 ; do
 
58
        if [ "$verbose_test" ] ; then
 
59
            echo "x${index}f"
 
60
        fi
 
61
        if [ "${index}" = "14" ] ; then
 
62
            echo "${OUTPUT_DIR}"/x${index}a${lang}%n.$dsuffix | \
 
63
            $DEBUG_CMD "$f77dir"/x${index}${lang} -dev $device -o "${OUTPUT_DIR}"/x${index}${lang}%n.$dsuffix \
 
64
            $options 2> test.error >| "${OUTPUT_DIR}"/x${index}${lang}_${dsuffix}.txt
 
65
      status_code=$?
 
66
        else
 
67
            $DEBUG_CMD "$f77dir"/x${index}f -dev $device -o "${OUTPUT_DIR}"/x${index}f%n.$dsuffix $options 2> test.error >| "${OUTPUT_DIR}"/x${index}${lang}_${dsuffix}.txt
 
68
            status_code=$?
 
69
        fi
 
70
        cat test.error
 
71
        if [ "$status_code" -ne 0 ] ; then
 
72
            exit $status_code
 
73
        fi
 
74
    # Look for any PLPLOT ERROR messages from plwarn that do not result in an
 
75
    # exit code.
 
76
        is_error=`grep -l 'PLPLOT ERROR' test.error`
 
77
        if [ -n "$is_error" ] ; then
 
78
            exit 1
 
79
        fi
 
80
 
 
81
    done
 
82
else
 
83
# Fall back to this method if this fortran platform does not have
 
84
# command-line parsing capability.  Command-line $options must be ignored
 
85
# for this method.
 
86
# Do non-standard example 16a because it illustrates plshade functionality
 
87
# with cmap1 (and also because the result looks nice.)
 
88
    if [ "$verbose_test" ] ; then
 
89
        echo "x16af"
 
90
    fi
 
91
    $DEBUG_CMD "$f77dir"/x16af <<EOF 2> test.error >| "${OUTPUT_DIR}"/x${index}${lang}_${dsuffix}.txt
 
92
$device
 
93
"${OUTPUT_DIR}"/x16af%n.$dsuffix 
 
94
EOF
 
95
  status_code=$?
 
96
  cat test.error
 
97
  if [ "$status_code" -ne 0 ] ; then
 
98
      exit $status_code
 
99
  fi
 
100
  # Look for any PLPLOT ERROR messages from plwarn that do not result in an
 
101
  # exit code.
 
102
  is_error=`grep -l 'PLPLOT ERROR' test.error`
 
103
  if [ -n "$is_error" ] ; then
 
104
      exit 1
 
105
  fi
 
106
 
 
107
# Do the standard non-interactive examples.
 
108
# skip 17 because it is interactive.
 
109
  for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 ; do
 
110
      if [ "$verbose_test" ] ; then
 
111
          echo "x${index}f"
 
112
      fi
 
113
      if [ "$index" = "14" ] ; then
 
114
          $DEBUG_CMD "$f77dir"/x${index}f <<EOF 2> test.error >| "${OUTPUT_DIR}"/x${index}${lang}_${dsuffix}.txt
 
115
$device
 
116
"${OUTPUT_DIR}"/x${index}f%n.$dsuffix
 
117
$device
 
118
"${OUTPUT_DIR}"/x${index}af%n.$dsuffix
 
119
EOF
 
120
          status_code=$?
 
121
      else
 
122
          $DEBUG_CMD "$f77dir"/x${index}f <<EOF 2> test.error >| "${OUTPUT_DIR}"/x${index}${lang}_${dsuffix}.txt
 
123
$device
 
124
"${OUTPUT_DIR}"/x${index}f%n.$dsuffix
 
125
EOF
 
126
          status_code=$?
 
127
      fi
 
128
      cat test.error
 
129
      if [ "$status_code" -ne 0 ] ; then
 
130
          exit $status_code
 
131
      fi
 
132
  # Look for any PLPLOT ERROR messages from plwarn that do not result in an
 
133
  # exit code.
 
134
      is_error=`grep -l 'PLPLOT ERROR' test.error`
 
135
      if [ -n "$is_error" ] ; then
 
136
          exit 1
 
137
      fi
 
138
 
 
139
  done
 
140
fi