File: 0004-test_speed.patch

package info (click to toggle)
pyxplot 0.9.2-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,312 kB
  • sloc: ansic: 50,373; xml: 1,339; python: 570; sh: 318; makefile: 90
file content (181 lines) | stat: -rw-r--r-- 7,338 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
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
From: Dominic Ford <coders@pyxplot.org.uk>
Date: Wed, 19 Feb 2020 13:36:39 +1100
Subject: Skip slow tests and make output unbuffered

Origin: Upstream
---
 doc/Makefile          | 37 ++++++-------------------------------
 doc/examples.testlist | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 doc/makeFigureEps.py  | 27 +++++++++++++++++----------
 3 files changed, 71 insertions(+), 41 deletions(-)
 create mode 100644 doc/examples.testlist

diff --git a/doc/Makefile b/doc/Makefile
index 5a69cce..880d113 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -5,7 +5,7 @@
 #
 # Copyright (C) 2006-2012 Dominic Ford <coders@pyxplot.org.uk>
 #
-# $Id: Makefile 1289 2012-08-11 16:06:49Z dcf21 $
+# $Id: Makefile 1316 2012-12-16 17:50:57Z dcf21 $
 #
 # Pyxplot is free software; you can redistribute it and/or modify it under the
 # terms of the GNU General Public License as published by the Free Software
@@ -29,6 +29,7 @@ EX_FRAGDIR = $(FRAGDIR)/tex
 FIGFILES   = $(wildcard $(EXAMPLEDIR)/*.ppl)
 FRAGFILES  = $(wildcard $(FRAGDIR)/*.ppl)
 SOURCES    = $(wildcard *.tex)
+PYTHON     = python
 
 all: $(EX_EPSDIR)/timestamp $(EX_TEXDIR)/timestamp $(EX_FRAGDIR)/timestamp \
      pyxplot-plain.ps pyxplot-plain.pdf pyxplot.pdf
@@ -76,36 +77,10 @@ pyxplot-plain.dvi: $(SOURCES) $(EX_EPSDIR)/timestamp $(EX_TEXDIR)/timestamp $(EX
 	makeindex pyxplot-plain.idx
 	latex pyxplot-plain.tex
 
-EPSTESTFILES = $(EX_EPSDIR)/ex_3d_helix.eps $(EX_EPSDIR)/ex_apachelog.eps $(EX_EPSDIR)/ex_axisatzero2.eps \
-$(EX_EPSDIR)/ex_axisatzero3.eps $(EX_EPSDIR)/ex_axisatzero.eps $(EX_EPSDIR)/ex_axislabs.eps \
-$(EX_EPSDIR)/ex_axistics2.eps $(EX_EPSDIR)/ex_axistics.eps $(EX_EPSDIR)/ex_axisunits.eps \
-$(EX_EPSDIR)/ex_barchart1.eps $(EX_EPSDIR)/ex_barchart2.eps $(EX_EPSDIR)/ex_branch_cuts.eps \
-$(EX_EPSDIR)/ex_cmbrtemp.eps $(EX_EPSDIR)/ex_colgradient.eps $(EX_EPSDIR)/ex_col_vs_mono.eps \
-$(EX_EPSDIR)/ex_contourmap.eps $(EX_EPSDIR)/ex_cover.eps $(EX_EPSDIR)/ex_datagrid.eps \
-$(EX_EPSDIR)/ex_ellipse.eps $(EX_EPSDIR)/ex_eqnsolve.eps $(EX_EPSDIR)/ex_euclid_I_47.eps \
-$(EX_EPSDIR)/ex_fft2.eps $(EX_EPSDIR)/ex_fft.eps $(EX_EPSDIR)/ex_fitting.eps \
-$(EX_EPSDIR)/ex_funcsplice2.eps $(EX_EPSDIR)/ex_funcsplice.eps $(EX_EPSDIR)/ex_gallery.eps \
-$(EX_EPSDIR)/ex_hlines.eps $(EX_EPSDIR)/ex_hrdiagram.eps $(EX_EPSDIR)/ex_integration.eps \
-$(EX_EPSDIR)/ex_interpolation.eps $(EX_EPSDIR)/ex_intro_bessel.eps $(EX_EPSDIR)/ex_intro_func.eps \
-$(EX_EPSDIR)/ex_intro_func_splice.eps $(EX_EPSDIR)/ex_intro_legendre.eps $(EX_EPSDIR)/ex_intro_sine.eps \
-$(EX_EPSDIR)/ex_lenses.eps $(EX_EPSDIR)/ex_linestyles2.eps $(EX_EPSDIR)/ex_linestyles3.eps \
-$(EX_EPSDIR)/ex_linestyles.eps $(EX_EPSDIR)/ex_lowerlimit.eps $(EX_EPSDIR)/ex_mandelbrot.eps \
-$(EX_EPSDIR)/ex_map.eps $(EX_EPSDIR)/ex_multiaxes.eps $(EX_EPSDIR)/ex_nanotubes.eps \
-$(EX_EPSDIR)/ex_newton.eps $(EX_EPSDIR)/ex_noentry.eps $(EX_EPSDIR)/ex_notice.eps \
-$(EX_EPSDIR)/ex_palettelist.eps $(EX_EPSDIR)/ex_pendulum2.eps $(EX_EPSDIR)/ex_pendulum.eps \
-$(EX_EPSDIR)/ex_piechart2.eps $(EX_EPSDIR)/ex_piechart.eps $(EX_EPSDIR)/ex_pi_estimation.eps \
-$(EX_EPSDIR)/ex_plotstyletab.eps $(EX_EPSDIR)/ex_polygon1.eps $(EX_EPSDIR)/ex_polygon2.eps \
-$(EX_EPSDIR)/ex_quadrupole.eps $(EX_EPSDIR)/ex_set_terminal.eps $(EX_EPSDIR)/ex_spectrum_1.eps \
-$(EX_EPSDIR)/ex_spectrum_bbcol.eps $(EX_EPSDIR)/ex_spectrum_biref.eps $(EX_EPSDIR)/ex_spectrum_colmix1.eps \
-$(EX_EPSDIR)/ex_spectrum_colmix2.eps $(EX_EPSDIR)/ex_spirograph.eps $(EX_EPSDIR)/ex_surface_log.eps \
-$(EX_EPSDIR)/ex_surface_polynomial.eps $(EX_EPSDIR)/ex_surface_sinc.eps $(EX_EPSDIR)/ex_tempscale.eps \
-$(EX_EPSDIR)/ex_text1.eps $(EX_EPSDIR)/ex_text2.eps $(EX_EPSDIR)/ex_torus.eps \
-$(EX_EPSDIR)/ex_trajectories.eps $(EX_EPSDIR)/ex_trefoil.eps $(EX_EPSDIR)/ex_triangle.eps \
-$(EX_EPSDIR)/ex_upperlimit.eps $(EX_EPSDIR)/ex_vortex.eps $(EX_EPSDIR)/ex_windowfuncs.eps \
-$(EX_EPSDIR)/ex_zeta_arg.eps
-
-test-examples: $(EX_EPSDIR)/timestamp
-	for e in $(EPSTESTFILES); do \
+test-examples:
+	$(PYTHON) -u makeFigureEps.py $(PYXPLOT) test
+	for item in `cat examples.testlist`; do \
+	   export e=$(EX_EPSDIR)/$${item}.eps; \
 	   ls -l $$e; \
 	   if [ ! -s "$$e" ]; then \
 			echo "$$e has zero length; tests failed"; exit 2; \
diff --git a/doc/examples.testlist b/doc/examples.testlist
new file mode 100644
index 0000000..7126c75
--- /dev/null
+++ b/doc/examples.testlist
@@ -0,0 +1,48 @@
+ex_3d_helix
+ex_axisatzero
+ex_axislabs
+ex_axistics2
+ex_axistics
+ex_axisunits
+ex_barchart1
+ex_barchart2
+ex_col_vs_mono
+ex_contourmap
+ex_cover
+ex_datagrid
+ex_ellipse
+ex_eqnsolve
+ex_euclid_I_47
+ex_fft
+ex_fitting
+ex_funcsplice2
+ex_funcsplice
+ex_gallery
+ex_hlines
+ex_integration
+ex_interpolation
+ex_intro_bessel
+ex_intro_func
+ex_intro_func_splice
+ex_intro_legendre
+ex_lenses
+ex_linestyles
+ex_multiaxes
+ex_noentry
+ex_notice
+ex_palettelist
+ex_piechart
+ex_polygon1
+ex_set_terminal
+ex_spectrum_1
+ex_spirograph
+ex_surface_log
+ex_surface_polynomial
+ex_tempscale
+ex_text1
+ex_text2
+ex_torus
+ex_trajectories
+ex_triangle
+ex_vortex
+ex_windowfuncs
diff --git a/doc/makeFigureEps.py b/doc/makeFigureEps.py
index bc5f21a..1039ead 100644
--- a/doc/makeFigureEps.py
+++ b/doc/makeFigureEps.py
@@ -5,7 +5,7 @@
 #
 # Copyright (C) 2006-2012 Dominic Ford <coders@pyxplot.org.uk>
 #
-# $Id: makeFigureEps.py 1281 2012-07-29 18:33:42Z dcf21 $
+# $Id: makeFigureEps.py 1316 2012-12-16 17:50:57Z dcf21 $
 #
 # PyXPlot is free software; you can redistribute it and/or modify it under the
 # terms of the GNU General Public License as published by the Free Software
@@ -25,23 +25,30 @@ import glob,os,sys,re
 if len(sys.argv)>=2: pyxplot = sys.argv[1]
 else               : pyxplot = "../bin/pyxplot"
 
+if (len(sys.argv)>=3) and (sys.argv[2]=="test"): testing = True
+else                                           : testing = False
+
 os.system("rm -Rf examples/eps")
 os.system("mkdir  examples/eps")
 
-files = glob.glob("examples/ex_*.ppl")
+if testing: files = ["examples/%s.ppl"%i.strip() for i in open("examples.testlist")]
+else      : files = glob.glob("examples/ex_*.ppl")
+
 files.sort()
+
 for fname in files:
   print "Working on example <%s>..."%os.path.split(fname)[1]
   status = os.system("%s %s"%(pyxplot,fname))
   if (status): raise RuntimeError("pyxplot failed")
 
 # Make pdf and png versions of all figures
-files = glob.glob("examples/eps/*.eps")
-files.sort()
-for eps in files:
-  print "Converting example <%s> to pdf..."%os.path.split(eps)[1]
-  pdf = re.sub(r"\.eps",".pdf",eps)
-  #png = re.sub(r"\.eps",".png",eps)
-  os.system("gs -dQUIET -dSAFER -P- -dBATCH -dNOPAUSE -dEPSCrop -sDEVICE=pdfwrite -sOutputFile=%s %s"%(pdf,eps))
-  #os.system("gs -dQUIET -dSAFER -P- -dBATCH -dNOPAUSE -dEPSCrop -sDEVICE=png16m -r72 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=%s %s"%(png,eps))
+if not testing:
+  files = glob.glob("examples/eps/*.eps")
+  files.sort()
+  for eps in files:
+    print "Converting example <%s> to pdf..."%os.path.split(eps)[1]
+    pdf = re.sub(r"\.eps",".pdf",eps)
+    #png = re.sub(r"\.eps",".png",eps)
+    os.system("gs -dQUIET -dSAFER -P- -dBATCH -dNOPAUSE -dEPSCrop -sDEVICE=pdfwrite -sOutputFile=%s %s"%(pdf,eps))
+    #os.system("gs -dQUIET -dSAFER -P- -dBATCH -dNOPAUSE -dEPSCrop -sDEVICE=png16m -r72 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=%s %s"%(png,eps))