File: test_octave_interactive.sh.in

package info (click to toggle)
plplot 5.15.0%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,312 kB
  • sloc: ansic: 79,707; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 50; sed: 34; fortran: 5
file content (116 lines) | stat: -rwxr-xr-x 4,227 bytes parent folder | download | duplicates (4)
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
#!@SH_EXECUTABLE@
# Test suite for interactive ("p??") octave examples.
#
# Copyright (C) 2004-2010  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

# This is called from plplot-test.sh with $octave, $octavedir, $options,
# and $device defined.

# The following is only need for the build tree!  It should has no effect
# when this script is launched from the install tree.
lang="o"
export lang

# Launch an Octave script that exercises all the demos
$octave -f -q  <<EOF 2> octave_interactive_${device}_test.error

# Disable warnings about shadowed functions - PLplot is _supposed_ to shadow the core functions
warning("off","Octave:shadowed-function");

addpath(getenv("octavedir"));

# Check verbose_test variable
if (strcmp(getenv("verbose_test"),"on") == 1)
    verbose_test = 1;
else
    verbose_test = 0;
endif

plplot_stub;
t = char(strsplit("$options", "-"));
if (t)
    t(1,:)="";
    for i=1:rows(t)
        tt = deblank (t(i,:)); len = length(tt);
        ix = index(tt," ");
        if (ix == 0); ix = len; len = 0; endif
        plsetopt(tt(1:ix), tt(ix+1:len));
    endfor
endif

# -dev wxwidgets will work on one at a time, but segfaults
# for multiple examples.

# -dev xcairo very slow on all of these (the well-known interactive
# slowness issue with that device).
# 17 - the selection rectangle is not drawn because xcairo does not support xor mode.

# The following comments are for -dev qtwidget.
# 14 - looks pretty to start but then segfaults on some systems (octave 3.0?);
#    - with octave 3.2 the animation does not work correctly (as with xwin / tk )
# 17 - the selection rectangle is not drawn because qtwidget does not support xor mode.

# -dev wxwidgets had similar issues except possibly for examples 18
# and 19 which seemed fine, but there is no way to tell for sure with
# second wxwidgets example (no matter what) always segfaulting.

# -dev xwin and -dev tk worked for all examples and Octave-3.0.  For
# Octave-3.2 the animation for p14 does not work correctly with these devices.

# Later information for Octave-3.8.2.
# (1) It has been discovered that most interactive devices currently
# have stunted interactive capabilities compared to xwin or tk so
# don't bother to exercise this example other than for -dev xwin or
# tk.

# (2) Segfaults: Remove p4, p5, p6, p7, p10, and p11.  Explanation:
# these examples sometimes segfault. I discovered these segfault
# issues for the xwin device and octave 3.8.2-4 from Debian jessie.
# The frequency of segfaults appears to depend on whether p3 is
# included or not, but they persist (just not as often) even if p3 is
# dropped so don't drop that example and instead drop the problematic
# ones.  Compile flags that I set which may affect whether this can be
# reproduced later are
# CXXFLAGS=-g
# CFLAGS=-g

# Remove combined example p20.  Explanation: this example includes p1
# through p15 and p17.  Thus, the "triggering" p3 example and the
# occasionally segfaulting examples are included which makes this
# combined demo quite problematic for now until the segfault issues
# are all fixed.

plsetopt("dev","$device");
for i=[1:3 8:9 12:19 21];
  if (verbose_test)
      printf("p%d\n",i);
  endif
  #figure(i,"$device",sprintf("${OUTPUT_DIR}/p%d%%n.$dsuffix",i));
  figure(i,"$device");
  plsetopt("dev","$device");
  feval(sprintf("p%d",i))
  closefig
endfor
EOF
status_code=$?
cat octave_interactive_${device}_test.error
if [ "$status_code" -ne 0 ] ; then
    exit $status_code
fi