This file is indexed.

/usr/share/doc/libplplot12/examples/plplot-test.sh is in libplplot-dev 5.10.0-0ubuntu5.

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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
#!/bin/bash
# -*- mode: shell-script -*-
# $Id: plplot-test.sh.in 12725 2013-11-20 22:58:00Z airwin $
#
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009  Alan W. Irwin
# Copyright (C) 2004  Rafael Laboissiere
#
# 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

# test suite for executing all configured demos (either in plplot/tmp
# or else in the install area) capable of file output.  Our ultimate aim
# is to compare the generated files with results generated on a system
# that is known to give good results.  However, single-precision
# contamination (even when double is configured) and the consequent large
# roundoff error is currently hampering our cross-platform comparisons.
# So for now, this is only a test suite in the sense that it checks the
# files corresponding to our demo plots can all be generated.  It is
# up to the user to display those files with the appropriate software
# (e.g., gv for postscript files and kview or a browser for png, gif,
# or jpeg files on Linux systems) to make sure they display properly.

version=5.10.0

EXAMPLES_DIR=${EXAMPLES_DIR:-.}
SRC_EXAMPLES_DIR=${SRC_EXAMPLES_DIR:-.}
OUTPUT_DIR=${OUTPUT_DIR:-.}
device=${DEVICE:-psc}
export EXAMPLES_DIR SRC_EXAMPLES_DIR OUTPUT_DIR device DEBUG_CMD

usage()
{
echo '
Usage: plplot-test.sh [OPTIONS]

Options:
   [--device=DEVICE] (DEVICE = any cmake-enabled device.  psc is the default)
   [--front-end=FE]  (FE = one of c, cxx, f95 java, octave, python, tcl, pdl, ada, ocaml, lua or d)
                     If this option is not specified, then all front-ends will
                     be tested.  More than one front-end may be given, like
                     this --front-end="c cxx"
   [--examples-dir=/path/to/examples/dir]
                     Specify path to the examples directory.  Defaults to "."
   [--src-examples-dir=/path/to/src/examples/dir]
                     Specify path to the src examples directory.  Defaults to "."
   [--output-dir=/path/to/output/dir]
                     Specify location where the resulting files are stored.
                     Defaults to "."
   [--interactive]   Run subset of C examples for interactive devices only.
   [--interactive_octave]   Run interactive octave examples for interactive devices only.
   [--verbose]	     Echo each PLplot example that is executed.
   [--debug="debug command"]         
                     Run examples with given debug command.
   [--debug]         Run examples with default debug command (valgrind).
   [--version]
   [--help]

Environment variables:
   DEVICE, FRONT_END, EXAMPLES_DIR, SRC_EXAMPLES_DIR, and OUTPUT_DIR can be 
   used to specify the devices, front-ends, the examples directory, the
   source examples directory (used for the special case of build-tree checks 
   when that tree is separated from the source tree), and output directory.
   These environment variables are overridden by the options --device,
   --front-end, --examples-dir, --src-examples-dir, and --output-dir.
'
   exit $1
}

# Figure out what script options were specified by the user.

while test $# -gt 0; do
   if [ "ON" = "ON" ] ; then
      case "$1" in
      -*=*) optarg=${1#*=} ;;
      *) optarg= ;;
      esac
   else
      case "$1" in
      -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
      *) optarg= ;;
      esac
   fi

   case $1 in
      --device=*)
         device=$optarg
         ;;
      --interactive)
         interactive=on
         ;;
      --interactive_octave)
         interactive_octave=on
         ;;
      --verbose)
         export verbose_test=on
         ;;
      --version)
         echo $version
	 exit 0
         ;;
      --front-end=*)
         FRONT_END=$optarg
         for i in $FRONT_END ; do
           [ $i = "c"         \
             -o $i = "cxx"    \
             -o $i = "f95"    \
             -o $i = "java"   \
             -o $i = "octave" \
             -o $i = "python" \
             -o $i = "tcl"    \
             -o $i = "pdl"    \
             -o $i = "ada"    \
             -o $i = "ocaml"    \
             -o $i = "lua"    \
             -o $i = "d"    \
           ] \
           || usage 0 1>&2
         done
	 ;;
      --examples-dir=*)
         EXAMPLES_DIR=$optarg
         ;;
      --src-examples-dir=*)
         SRC_EXAMPLES_DIR=$optarg
         ;;
      --output-dir=*)
         OUTPUT_DIR=$optarg
         ;;
      --debug=*)
         DEBUG_CMD=$optarg
         ;;
      --debug)
         DEBUG_CMD="valgrind --leak-check=full --show-reachable=yes --log-file=valgrind.x%q{index}%q{lang}.%q{dsuffix}.log"
         ;;
      --help)
         usage 0 1>&2
         ;;
      *)
         usage 1 1>&2
         ;;
   esac
   shift
done

# This script is only designed to work when EXAMPLES_DIR is a directory
# with a subdirectory called "c".  Check whether this conditions is true.

if [ ! -d "$EXAMPLES_DIR"/c ] ; then
echo '
This script is only designed to work when the EXAMPLES_DIR environment
variable (overridden by option --examples-dir) is a directory with a
subdirectory called "c".  This condition has been violated.
'
exit 1
fi

# Find where the front-end scripts are by looking at the directory name of the
# current script.  

if [ "" = "1" ] ; then
   scripts_dir=${0%/*}
else
   scripts_dir=`echo "$0" | sed 's:/[^/][^/]*$::'`
fi

if [ "$interactive" = "on" -o "$interactive_octave" = "on" ] ; then
    # List of interactive devices for PLplot that _might_ be enabled.
    PLD_aqt=OFF
    PLD_qtwidget=ON
    PLD_gcw=OFF
    PLD_gnome=
    PLD_ntk=ON
    PLD_tk=ON
    PLD_wingcc=OFF
    PLD_wincairo=OFF
    PLD_wxwidgets=ON
    PLD_xcairo=ON
    PLD_xwin=ON

    eval pld_device='$'PLD_$device
    if [ -z "$pld_device" ] ; then
	echo '
Never heard of an interactive device called '"$device"'.  Either this
is not a legitimate interactive device for PLplot or else
plplot-test.sh.cmake needs some maintenance to include this
interactive device in the list of possible PLplot interactive devices.
'
	exit 1
    fi

    if [ ! "$pld_device" = "ON" ] ; then
	echo '
PLD_'"$device"' is defined as '"$pld_device"'.  It must be ON (i.e., enabled
by your cmake configuration and built properly) before you can use this
script with DEVICE='"$device"'.
'
	exit 1
    fi

    status=0
    if [ "$interactive" = "on" ] ; then
	export cdir="$EXAMPLES_DIR"/c
	echo "Testing subset of C examples for device $device"
	script="$scripts_dir"/test_c_interactive.sh
    else
	# This case must be "$interactive_octave" = "on"
	export options=
	export octave=/usr/bin/octave
	export octavedir=\
"$EXAMPLES_DIR"/../bindings/octave:\
"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot:\
"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot/support:\
"$SRC_EXAMPLES_DIR"/../bindings/octave/misc:\
"$SRC_EXAMPLES_DIR"/octave:\
"/usr/share/plplot_octave":\
"/usr/share/plplot_octave"/support:\
"/usr/share/octave/site/m"/PLplot:\
"/usr/lib/x86_64-linux-gnu/octave/site/oct/x86_64-pc-linux-gnu":
	echo "Testing interactive octave examples for device $device"
	script="$scripts_dir"/test_octave_interactive.sh
    fi
    /bin/bash "$script" || status=1

    exit $status
fi

# These variables set by default assuming you are going to run this
# script from the installed demos directory $prefix/lib/plplot$version/examples.
cdir="$EXAMPLES_DIR"/c
cxxdir="$EXAMPLES_DIR"/c++
f95dir="$EXAMPLES_DIR"/f95
pythondir="$SRC_EXAMPLES_DIR"/python
tcldir="$SRC_EXAMPLES_DIR"/tcl
perldir="$SRC_EXAMPLES_DIR"/perl
javadir="$EXAMPLES_DIR"/java
adadir="$EXAMPLES_DIR"/ada
ocamldir="$EXAMPLES_DIR"/ocaml
luadir="$SRC_EXAMPLES_DIR"/lua
ddir="$EXAMPLES_DIR"/d
octave=/usr/bin/octave
octavedir=\
"$EXAMPLES_DIR"/../bindings/octave:\
"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot:\
"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot/support:\
"$SRC_EXAMPLES_DIR"/../bindings/octave/misc:\
"$SRC_EXAMPLES_DIR"/octave:\
"/usr/share/plplot_octave":\
"/usr/share/plplot_octave"/support:\
"/usr/share/octave/site/m"/PLplot:\
"/usr/lib/x86_64-linux-gnu/octave/site/oct/x86_64-pc-linux-gnu":
export cdir cxxdir f95dir pythondir javadir octave octavedir tcldir perldir adadir ocamldir luadir ddir

fe=""

# List of non-interactive (i.e., file) devices for PLplot that 
# _might_ be enabled.  For completeness you may want to specify all devices
# here, but be sure to comment out the interactive ones since they are
# handled by the above --interactive logic.

#interactive PLD_aqt=OFF
PLD_cgm=OFF
PLD_conex=
PLD_dg300=
PLD_epsqt=ON
PLD_pdfqt=ON
#interactive PLD_qtwidget=ON
PLD_bmpqt=ON
PLD_jpgqt=ON
PLD_pngqt=ON
PLD_ppmqt=ON
PLD_tiffqt=ON
PLD_svgqt=ON
#interactive PLD_gcw=OFF
PLD_gif=ON
#interactive PLD_gnome=
PLD_hp7470=
PLD_hp7580=
PLD_imp=
PLD_jpeg=ON
PLD_lj_hpgl=
PLD_ljii=
PLD_ljiip=
#not a file device PLD_mem=ON
#not a file device PLD_memcairo=ON
PLD_mskermit=
#interactive PLD_ntk=ON
PLD_null=ON
PLD_pbm=
PLD_pdf=OFF
PLD_pdfcairo=ON
PLD_plmeta=OFF
PLD_png=ON
PLD_pngcairo=ON
PLD_ps=ON
# special case
PLD_psc=ON
PLD_pscairo=ON
PLD_epscairo=ON
PLD_pstex=OFF
PLD_psttf=OFF
# special case
PLD_psttfc=OFF
PLD_svg=ON
PLD_svgcairo=ON
PLD_tek4010=
PLD_tek4010f=
PLD_tek4107=
PLD_tek4107f=
#interactive PLD_tk=ON
#interactive PLD_tkwin=ON
PLD_versaterm=
PLD_vlt=
#interactive PLD_wincairo=OFF
#interactive PLD_wingcc=OFF
PLD_wxpng=OFF
#interactive PLD_wxwidgets=ON
#interactive PLD_xcairo=ON
PLD_xfig=ON
PLD_xterm=
#interactive PLD_xwin=ON

eval pld_device='$'PLD_$device
if [ -z "$pld_device" ] ; then
echo '
Never heard of a file device called '"$device"'.  Either this is not a
legitimate file (i.e. non-interactive) device for PLplot or else 
plplot-test.sh.cmake needs some maintenance to include this file device in
the list of possible PLplot file devices.
'
exit 1
fi

if [ ! "$pld_device" = "ON" ] ; then
echo '
PLD_'"$device"' is defined as '"$pld_device"'.  It must be ON (i.e., enabled
by your cmake configuration and built properly) before you can use this
script with DEVICE='"$device"'.
'
exit 1
fi

# Some devices require special options others do not.
case "$device" in
   png|pngcairo|epscairo|jpeg|xfig|svg|svgcairo|bmpqt|jpgqt|pngqt|ppmqt|tiffqt|svgqt|epsqt|pdfqt)
      options="-fam -fflen 2"
      ;;
   gif)
   # gif standard is limited to 256 colours so cannot have aliasing turned
   # on (which uses additional colours) for examples which already have
   # a substantial number of colours (such as example 2 with its 116 colours).
      options="-fam -fflen 2 -drvopt smooth=0"
      ;;
   *)
      options=
      ;;
esac
dsuffix=$device
export dsuffix options

# Find out what front-ends have been configured
if [ -z "$FRONT_END" ] ; then
   FRONT_END=c
   test "ON" = "ON" && FRONT_END="$FRONT_END cxx"
   test "ON" = "ON"    && FRONT_END="$FRONT_END f95"
   test "ON" = "ON"   && FRONT_END="$FRONT_END java"
   test "ON" = "ON" && FRONT_END="$FRONT_END octave"
   test "ON" = "ON" && FRONT_END="$FRONT_END python"
   test "ON" = "ON"    && FRONT_END="$FRONT_END tcl"
   test "OFF" = "ON"    && FRONT_END="$FRONT_END pdl"
   test "OFF" = "ON"    && FRONT_END="$FRONT_END ada"
   test "ON" = "ON"  && FRONT_END="$FRONT_END ocaml"
   test "ON" = "ON"  && FRONT_END="$FRONT_END lua"
   test "OFF" = "ON"  && FRONT_END="$FRONT_END d"
fi

# Call the front-end scripts
status=0

if [ "" = "1" ] ; then
 critical_examples="14 17 29"
 exesuffix=".exe"
else
 critical_examples="14 17 29"
 exesuffix= 
fi
export critical_examples exesuffix
for i in $FRONT_END ; do
   case $i in octave)
     echo "Skipping front-end $i"
     continue
   esac
   echo "Testing front-end $i"
   script="$scripts_dir"/test_$i.sh
   /bin/bash "$script" || status=1
done

exit $status