regina 7.4.1__cp314-cp314-macosx_10_13_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- regina/.dylibs/libgmp.10.dylib +0 -0
- regina/.dylibs/libgmpxx.4.dylib +0 -0
- regina/__init__.py +192 -0
- regina/engine.cpython-314-darwin.so +0 -0
- regina/plainCompleter.py +221 -0
- regina/pyCensus/__init__.py +14 -0
- regina/pyCensus/christy-knots-links.tdb +0 -0
- regina/pyCensus/closed-hyp-census-full.tdb +0 -0
- regina/pyCensus/closed-nor-census-11.tdb +0 -0
- regina/pyCensus/closed-or-census-11.tdb +0 -0
- regina/pyCensus/cusped-hyp-nor-census-9.tdb +0 -0
- regina/pyCensus/cusped-hyp-or-census-9.tdb +0 -0
- regina/sageRegina/__init__.py +2 -0
- regina/sageRegina/config.py +9 -0
- regina/sageRegina/test.py +131 -0
- regina/sageRegina/testsuite/CMakeLists.txt +64 -0
- regina/sageRegina/testsuite/O2_1.rga +15 -0
- regina/sageRegina/testsuite/O2_1.tri +28 -0
- regina/sageRegina/testsuite/README.txt +21 -0
- regina/sageRegina/testsuite/alltypes-exc.out +698 -0
- regina/sageRegina/testsuite/alltypes-exc.test +92 -0
- regina/sageRegina/testsuite/alltypes-noexc.out +698 -0
- regina/sageRegina/testsuite/alltypes-noexc.test +85 -0
- regina/sageRegina/testsuite/alltypes.out +698 -0
- regina/sageRegina/testsuite/alltypes.test +85 -0
- regina/sageRegina/testsuite/angles.out +102 -0
- regina/sageRegina/testsuite/angles.test +70 -0
- regina/sageRegina/testsuite/arrow.out +86 -0
- regina/sageRegina/testsuite/arrow.test +224 -0
- regina/sageRegina/testsuite/base64.out +2 -0
- regina/sageRegina/testsuite/base64.test +37 -0
- regina/sageRegina/testsuite/basic_callback.out +124 -0
- regina/sageRegina/testsuite/basic_sub.out +7 -0
- regina/sageRegina/testsuite/binom.out +14 -0
- regina/sageRegina/testsuite/binom.test +69 -0
- regina/sageRegina/testsuite/bool.out +6 -0
- regina/sageRegina/testsuite/bool.test +62 -0
- regina/sageRegina/testsuite/bytes.out +17 -0
- regina/sageRegina/testsuite/bytes.test +76 -0
- regina/sageRegina/testsuite/callbacks.out +515 -0
- regina/sageRegina/testsuite/callbacks.test +279 -0
- regina/sageRegina/testsuite/census.out +120 -0
- regina/sageRegina/testsuite/census.test +156 -0
- regina/sageRegina/testsuite/clone.out +18 -0
- regina/sageRegina/testsuite/clone.test +99 -0
- regina/sageRegina/testsuite/comparison.out +41 -0
- regina/sageRegina/testsuite/comparison.test +47 -0
- regina/sageRegina/testsuite/construction.out +120 -0
- regina/sageRegina/testsuite/construction.test +63 -0
- regina/sageRegina/testsuite/constructors.out +14 -0
- regina/sageRegina/testsuite/constructors.test +95 -0
- regina/sageRegina/testsuite/cube.orb +87 -0
- regina/sageRegina/testsuite/discs.out +3 -0
- regina/sageRegina/testsuite/discs.test +38 -0
- regina/sageRegina/testsuite/docstrings.filter +22 -0
- regina/sageRegina/testsuite/docstrings.out +802 -0
- regina/sageRegina/testsuite/docstrings.out.v2 +799 -0
- regina/sageRegina/testsuite/docstrings.test +55 -0
- regina/sageRegina/testsuite/dodec.orb +309 -0
- regina/sageRegina/testsuite/embeddings.out +23 -0
- regina/sageRegina/testsuite/embeddings.test +87 -0
- regina/sageRegina/testsuite/enumerate.out +62 -0
- regina/sageRegina/testsuite/enumerate.test +80 -0
- regina/sageRegina/testsuite/equality.out +112 -0
- regina/sageRegina/testsuite/equality.test +308 -0
- regina/sageRegina/testsuite/euler.out +15 -0
- regina/sageRegina/testsuite/euler.test +93 -0
- regina/sageRegina/testsuite/exception.out +7 -0
- regina/sageRegina/testsuite/exception.test +98 -0
- regina/sageRegina/testsuite/facenumbering.out +546 -0
- regina/sageRegina/testsuite/facenumbering.test +72 -0
- regina/sageRegina/testsuite/faces.out +40 -0
- regina/sageRegina/testsuite/faces.test +70 -0
- regina/sageRegina/testsuite/file.out +1229 -0
- regina/sageRegina/testsuite/file.test +68 -0
- regina/sageRegina/testsuite/file1.rga +0 -0
- regina/sageRegina/testsuite/file2.rga +0 -0
- regina/sageRegina/testsuite/file3.rga +119 -0
- regina/sageRegina/testsuite/flags.out +38 -0
- regina/sageRegina/testsuite/flags.out.v2 +38 -0
- regina/sageRegina/testsuite/flags.test +81 -0
- regina/sageRegina/testsuite/flype.out +37 -0
- regina/sageRegina/testsuite/flype.test +48 -0
- regina/sageRegina/testsuite/generic.out +116 -0
- regina/sageRegina/testsuite/generic.test +74 -0
- regina/sageRegina/testsuite/groups.out +70 -0
- regina/sageRegina/testsuite/groups.test +115 -0
- regina/sageRegina/testsuite/hash.out +66 -0
- regina/sageRegina/testsuite/hash.test +84 -0
- regina/sageRegina/testsuite/hypersurfaces.out +681 -0
- regina/sageRegina/testsuite/hypersurfaces.test +89 -0
- regina/sageRegina/testsuite/i18n-latin1.rga +8 -0
- regina/sageRegina/testsuite/i18n-utf8.rga +8 -0
- regina/sageRegina/testsuite/i18n.out +6 -0
- regina/sageRegina/testsuite/i18n.test +89 -0
- regina/sageRegina/testsuite/id.out +2 -0
- regina/sageRegina/testsuite/id.test +45 -0
- regina/sageRegina/testsuite/index.out +2 -0
- regina/sageRegina/testsuite/index.test +41 -0
- regina/sageRegina/testsuite/integer.out +74 -0
- regina/sageRegina/testsuite/integer.test +54 -0
- regina/sageRegina/testsuite/italian.orb +90 -0
- regina/sageRegina/testsuite/iterators.out +118 -0
- regina/sageRegina/testsuite/iterators.test +126 -0
- regina/sageRegina/testsuite/knotted-Y.orb +47 -0
- regina/sageRegina/testsuite/listener.out +43 -0
- regina/sageRegina/testsuite/listener.test +99 -0
- regina/sageRegina/testsuite/listview.out +416 -0
- regina/sageRegina/testsuite/listview.test +251 -0
- regina/sageRegina/testsuite/lookup.out +13 -0
- regina/sageRegina/testsuite/lookup.test +42 -0
- regina/sageRegina/testsuite/lst.out +844 -0
- regina/sageRegina/testsuite/lst.test +195 -0
- regina/sageRegina/testsuite/memory1.out +62 -0
- regina/sageRegina/testsuite/memory1.test +152 -0
- regina/sageRegina/testsuite/memory2.out +62 -0
- regina/sageRegina/testsuite/memory2.test +122 -0
- regina/sageRegina/testsuite/memory3.out +92 -0
- regina/sageRegina/testsuite/memory3.test +214 -0
- regina/sageRegina/testsuite/misc.out +7 -0
- regina/sageRegina/testsuite/misc.test +54 -0
- regina/sageRegina/testsuite/operators.out +129 -0
- regina/sageRegina/testsuite/operators.test +59 -0
- regina/sageRegina/testsuite/orb.out +441 -0
- regina/sageRegina/testsuite/orb.test +47 -0
- regina/sageRegina/testsuite/pdf.out +4 -0
- regina/sageRegina/testsuite/pdf.test +47 -0
- regina/sageRegina/testsuite/perm.out +36 -0
- regina/sageRegina/testsuite/perm.test +74 -0
- regina/sageRegina/testsuite/plantri.out +12 -0
- regina/sageRegina/testsuite/plantri.test +58 -0
- regina/sageRegina/testsuite/poincare.tri +55 -0
- regina/sageRegina/testsuite/presentations.out +11 -0
- regina/sageRegina/testsuite/presentations.test +59 -0
- regina/sageRegina/testsuite/refs.out +51 -0
- regina/sageRegina/testsuite/refs.test +126 -0
- regina/sageRegina/testsuite/repr.out +951 -0
- regina/sageRegina/testsuite/repr.out.v2 +951 -0
- regina/sageRegina/testsuite/repr.test +546 -0
- regina/sageRegina/testsuite/runbasic.in +75 -0
- regina/sageRegina/testsuite/safeheldtype_basic.out +17 -0
- regina/sageRegina/testsuite/safeheldtype_basic.test +111 -0
- regina/sageRegina/testsuite/safeheldtype_packet.out +58 -0
- regina/sageRegina/testsuite/safeheldtype_packet.test +179 -0
- regina/sageRegina/testsuite/sample.pdf +0 -0
- regina/sageRegina/testsuite/sets.out +7 -0
- regina/sageRegina/testsuite/sets.test +42 -0
- regina/sageRegina/testsuite/skeleton.out +308 -0
- regina/sageRegina/testsuite/skeleton.test +52 -0
- regina/sageRegina/testsuite/snappea.out +90 -0
- regina/sageRegina/testsuite/snappea.test +133 -0
- regina/sageRegina/testsuite/snapshot.out +15 -0
- regina/sageRegina/testsuite/snapshot.test +76 -0
- regina/sageRegina/testsuite/sort.out +78 -0
- regina/sageRegina/testsuite/sort.test +58 -0
- regina/sageRegina/testsuite/special.out +4 -0
- regina/sageRegina/testsuite/special.test +45 -0
- regina/sageRegina/testsuite/standardtri.out +12101 -0
- regina/sageRegina/testsuite/standardtri.test +453 -0
- regina/sageRegina/testsuite/surfaces.out +2133 -0
- regina/sageRegina/testsuite/surfaces.test +112 -0
- regina/sageRegina/testsuite/swapping.out +25 -0
- regina/sageRegina/testsuite/swapping.test +86 -0
- regina/sageRegina/testsuite/testall.in +174 -0
- regina/sageRegina/testsuite/testbasic.in +277 -0
- regina/sageRegina/testsuite/testcallback.in +148 -0
- regina/sageRegina/testsuite/testsub.in +148 -0
- regina/sageRegina/testsuite/theta_in_solid_torus.orb +65 -0
- regina/sageRegina/testsuite/tightencode.out +40 -0
- regina/sageRegina/testsuite/tightencode.test +106 -0
- regina/sageRegina/testsuite/treedecomp.out +135 -0
- regina/sageRegina/testsuite/treedecomp.test +64 -0
- regina/sageRegina/testsuite/treetraversal.out +52 -0
- regina/sageRegina/testsuite/treetraversal.test +188 -0
- regina/sageRegina/testsuite/trigeneral.out +1251 -0
- regina/sageRegina/testsuite/trigeneral.test +153 -0
- regina/sageRegina/testsuite/utf8.out +42 -0
- regina/sageRegina/testsuite/utf8.test +92 -0
- regina/sageRegina/testsuite/whitehead.tri +47 -0
- regina/sageRegina/version.py +5 -0
- regina/sageSetup.py +41 -0
- regina/test.py +6 -0
- regina-7.4.1.dist-info/METADATA +109 -0
- regina-7.4.1.dist-info/RECORD +186 -0
- regina-7.4.1.dist-info/WHEEL +6 -0
- regina-7.4.1.dist-info/top_level.txt +4 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Regina - A Normal Surface Theory Calculator
|
|
2
|
+
# Python Test Suite Component
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2007-2025, Ben Burton
|
|
5
|
+
# For further details contact Ben Burton (bab@debian.org).
|
|
6
|
+
#
|
|
7
|
+
# Provides various tests for normal surface enumeration.
|
|
8
|
+
#
|
|
9
|
+
# This file is a single component of Regina's python test suite. To run
|
|
10
|
+
# the python test suite, move to the main python directory in the source
|
|
11
|
+
# tree and run "make check".
|
|
12
|
+
#
|
|
13
|
+
# This program is free software; you can redistribute it and/or
|
|
14
|
+
# modify it under the terms of the GNU General Public License as
|
|
15
|
+
# published by the Free Software Foundation; either version 2 of the
|
|
16
|
+
# License, or (at your option) any later version.
|
|
17
|
+
#
|
|
18
|
+
# As an exception, when this program is distributed through (i) the
|
|
19
|
+
# App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
|
|
20
|
+
# (iii) Google Play by Google Inc., then that store may impose any
|
|
21
|
+
# digital rights management, device limits and/or redistribution
|
|
22
|
+
# restrictions that are required by its terms of service.
|
|
23
|
+
#
|
|
24
|
+
# This program is distributed in the hope that it will be useful, but
|
|
25
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
26
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
27
|
+
# General Public License for more details.
|
|
28
|
+
#
|
|
29
|
+
# You should have received a copy of the GNU General Public License
|
|
30
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
31
|
+
|
|
32
|
+
def dumpSurfaces(name, tri, triName, coords = regina.NormalCoords.Standard, which = regina.NormalList.Default):
|
|
33
|
+
try:
|
|
34
|
+
slist = regina.NormalSurfaces(tri, coords, which)
|
|
35
|
+
except:
|
|
36
|
+
print("-------------------------------")
|
|
37
|
+
print(name)
|
|
38
|
+
print('ENUMERATION FAILED')
|
|
39
|
+
print("-------------------------------")
|
|
40
|
+
print()
|
|
41
|
+
return
|
|
42
|
+
|
|
43
|
+
print("-------------------------------")
|
|
44
|
+
print(triName)
|
|
45
|
+
print(name)
|
|
46
|
+
print("-------------------------------")
|
|
47
|
+
print()
|
|
48
|
+
|
|
49
|
+
# Dump the surfaces in sort order, since we don't really mind if the
|
|
50
|
+
# ordering changes between releases.
|
|
51
|
+
surfaces = slist.detail().split('\n')
|
|
52
|
+
surfaces.sort()
|
|
53
|
+
# Let the text headers appear up top.
|
|
54
|
+
surfaces.reverse()
|
|
55
|
+
for s in surfaces:
|
|
56
|
+
print(s)
|
|
57
|
+
|
|
58
|
+
# Nothing else to say.
|
|
59
|
+
print()
|
|
60
|
+
|
|
61
|
+
def surfaceStats(tri, triName):
|
|
62
|
+
dumpSurfaces('Vertex surfaces (std)',
|
|
63
|
+
tri, triName, regina.NormalCoords.Standard)
|
|
64
|
+
dumpSurfaces('Vertex surfaces (quad)',
|
|
65
|
+
tri, triName, regina.NormalCoords.Quad)
|
|
66
|
+
dumpSurfaces('Vertex surfaces (std almost normal)',
|
|
67
|
+
tri, triName, regina.NormalCoords.AlmostNormal)
|
|
68
|
+
dumpSurfaces('Vertex surfaces (quad-oct almost normal)',
|
|
69
|
+
tri, triName, regina.NormalCoords.QuadOct)
|
|
70
|
+
dumpSurfaces('Vertex surfaces (closed quad)',
|
|
71
|
+
tri, triName, regina.NormalCoords.QuadClosed)
|
|
72
|
+
dumpSurfaces('Vertex surfaces (closed quad-oct)',
|
|
73
|
+
tri, triName, regina.NormalCoords.QuadOctClosed)
|
|
74
|
+
dumpSurfaces('Fundamental surfaces (std)',
|
|
75
|
+
tri, triName, regina.NormalCoords.Standard, regina.NormalList.Fundamental)
|
|
76
|
+
dumpSurfaces('Fundamental surfaces (quad)',
|
|
77
|
+
tri, triName, regina.NormalCoords.Quad, regina.NormalList.Fundamental)
|
|
78
|
+
dumpSurfaces('Fundamental surfaces (std almost normal)',
|
|
79
|
+
tri, triName, regina.NormalCoords.AlmostNormal, regina.NormalList.Fundamental)
|
|
80
|
+
dumpSurfaces('Fundamental surfaces (quad-oct almost normal)',
|
|
81
|
+
tri, triName, regina.NormalCoords.QuadOct, regina.NormalList.Fundamental)
|
|
82
|
+
dumpSurfaces('Fundamental surfaces (closed quad)',
|
|
83
|
+
tri, triName, regina.NormalCoords.QuadClosed, regina.NormalList.Fundamental)
|
|
84
|
+
dumpSurfaces('Fundamental surfaces (closed quad-oct)',
|
|
85
|
+
tri, triName, regina.NormalCoords.QuadOctClosed, regina.NormalList.Fundamental)
|
|
86
|
+
|
|
87
|
+
# Start with the tables of constants for disc types.
|
|
88
|
+
print(quadSeparating)
|
|
89
|
+
print(quadMeeting)
|
|
90
|
+
print(quadDefn)
|
|
91
|
+
print(quadPartner)
|
|
92
|
+
print(quadString)
|
|
93
|
+
print(triDiscArcs)
|
|
94
|
+
print(quadDiscArcs)
|
|
95
|
+
print(octDiscArcs)
|
|
96
|
+
print()
|
|
97
|
+
|
|
98
|
+
t = regina.Triangulation3()
|
|
99
|
+
surfaceStats(t, 'Empty triangulation')
|
|
100
|
+
|
|
101
|
+
surfaceStats(regina.Example3.threeSphere(), '3-sphere')
|
|
102
|
+
surfaceStats(regina.Example3.s2xs1(), 'S2 x S1')
|
|
103
|
+
surfaceStats(regina.Example3.rp2xs1(), 'RP2 x S1')
|
|
104
|
+
surfaceStats(regina.Example3.rp3rp3(), 'RP3 # RP3')
|
|
105
|
+
surfaceStats(regina.Example3.lens(8,3), 'L(8,3)')
|
|
106
|
+
surfaceStats(regina.Example3.poincare(), 'Poincare homology sphere')
|
|
107
|
+
surfaceStats(regina.Example3.lst(3,4), 'LST(3,4,7)')
|
|
108
|
+
surfaceStats(regina.Example3.solidKleinBottle(), 'Solid Klein bottle')
|
|
109
|
+
surfaceStats(regina.Example3.figureEight(), 'Figure eight knot complement')
|
|
110
|
+
surfaceStats(regina.Example3.whiteheadLink(), 'Whitehead link complement')
|
|
111
|
+
surfaceStats(regina.Example3.gieseking(), 'Gieseking manifold')
|
|
112
|
+
surfaceStats(regina.Example3.trefoil(), 'Trefoil knot complement')
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
3 4 | -x^8 + x^6 + x^2 | x^4 - x^2 + 1 - x^-2 + x^-4
|
|
2
|
+
4 3 | x^4 - x^2 + 1 - x^-2 + x^-4 | -x^8 + x^6 + x^2
|
|
3
|
+
3 4 | -x^8 + x^6 + x^2 | x^4 - x^2 + 1 - x^-2 + x^-4
|
|
4
|
+
|
|
5
|
+
2 1 | 0 | Z
|
|
6
|
+
1 2 | Z | 0
|
|
7
|
+
2 1 | 0 | Z
|
|
8
|
+
|
|
9
|
+
23 2 | 3 Z_5 | Z
|
|
10
|
+
2 23 | Z | 3 Z_5
|
|
11
|
+
23 2 | 3 Z_5 | Z
|
|
12
|
+
|
|
13
|
+
1 2 | 2.0299 | 3.6639
|
|
14
|
+
2 1 | 3.6639 | 2.0299
|
|
15
|
+
1 2 | 2.0299 | 3.6639
|
|
16
|
+
|
|
17
|
+
2 4 False
|
|
18
|
+
0 2 True
|
|
19
|
+
|
|
20
|
+
2 4 False
|
|
21
|
+
0 2 True
|
|
22
|
+
|
|
23
|
+
2 4 False
|
|
24
|
+
0 2 True
|
|
25
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Regina - A Normal Surface Theory Calculator
|
|
2
|
+
# Python Test Suite Component
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2007-2025, Ben Burton
|
|
5
|
+
# For further details contact Ben Burton (bab@debian.org).
|
|
6
|
+
#
|
|
7
|
+
# Provides detailed tests for C++ Swappable types.
|
|
8
|
+
#
|
|
9
|
+
# This file is a single component of Regina's python test suite. To run
|
|
10
|
+
# the python test suite, move to the main python directory in the source
|
|
11
|
+
# tree and run "make check".
|
|
12
|
+
#
|
|
13
|
+
# This program is free software; you can redistribute it and/or
|
|
14
|
+
# modify it under the terms of the GNU General Public License as
|
|
15
|
+
# published by the Free Software Foundation; either version 2 of the
|
|
16
|
+
# License, or (at your option) any later version.
|
|
17
|
+
#
|
|
18
|
+
# As an exception, when this program is distributed through (i) the
|
|
19
|
+
# App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
|
|
20
|
+
# (iii) Google Play by Google Inc., then that store may impose any
|
|
21
|
+
# digital rights management, device limits and/or redistribution
|
|
22
|
+
# restrictions that are required by its terms of service.
|
|
23
|
+
#
|
|
24
|
+
# This program is distributed in the hope that it will be useful, but
|
|
25
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
26
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
27
|
+
# General Public License for more details.
|
|
28
|
+
#
|
|
29
|
+
# You should have received a copy of the GNU General Public License
|
|
30
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
31
|
+
|
|
32
|
+
a = ExampleLink.trefoil(); b = ExampleLink.figureEight()
|
|
33
|
+
print(a.size(), b.size(), '|', a.jones(), '|', b.jones())
|
|
34
|
+
swap(a, b)
|
|
35
|
+
print(a.size(), b.size(), '|', a.jones(), '|', b.jones())
|
|
36
|
+
a.swap(b)
|
|
37
|
+
print(a.size(), b.size(), '|', a.jones(), '|', b.jones())
|
|
38
|
+
print()
|
|
39
|
+
|
|
40
|
+
a = Example5.sphere(); b = Example5.ballBundle()
|
|
41
|
+
print(a.size(), b.size(), '|', a.homology(), '|', b.homology())
|
|
42
|
+
swap(a, b)
|
|
43
|
+
print(a.size(), b.size(), '|', a.homology(), '|', b.homology())
|
|
44
|
+
a.swap(b)
|
|
45
|
+
print(a.size(), b.size(), '|', a.homology(), '|', b.homology())
|
|
46
|
+
print()
|
|
47
|
+
|
|
48
|
+
a = Example3.weberSeifert(); b = Example3.figureEight()
|
|
49
|
+
print(a.size(), b.size(), '|', a.homology(), '|', b.homology())
|
|
50
|
+
swap(a, b)
|
|
51
|
+
print(a.size(), b.size(), '|', a.homology(), '|', b.homology())
|
|
52
|
+
a.swap(b)
|
|
53
|
+
print(a.size(), b.size(), '|', a.homology(), '|', b.homology())
|
|
54
|
+
print()
|
|
55
|
+
|
|
56
|
+
a = ExampleSnapPea.figureEight(); b = ExampleSnapPea.whiteheadLink()
|
|
57
|
+
print(a.countCusps(), b.countCusps(), '|', '%.4f'%a.volume(), '|', '%.4f'%b.volume())
|
|
58
|
+
swap(a, b)
|
|
59
|
+
print(a.countCusps(), b.countCusps(), '|', '%.4f'%a.volume(), '|', '%.4f'%b.volume())
|
|
60
|
+
a.swap(b)
|
|
61
|
+
print(a.countCusps(), b.countCusps(), '|', '%.4f'%a.volume(), '|', '%.4f'%b.volume())
|
|
62
|
+
print()
|
|
63
|
+
|
|
64
|
+
# The following examples should all nullify the SnapPea triangulation,
|
|
65
|
+
# since they will fall back to the Triangulation<3> swap function.
|
|
66
|
+
|
|
67
|
+
a = ExampleSnapPea.figureEight(); b = Example3.whiteheadLink()
|
|
68
|
+
print(a.size(), b.size(), a.isNull())
|
|
69
|
+
swap(a, b)
|
|
70
|
+
print(a.size(), b.size(), a.isNull())
|
|
71
|
+
print()
|
|
72
|
+
|
|
73
|
+
a = ExampleSnapPea.figureEight(); b = Example3.whiteheadLink()
|
|
74
|
+
print(a.size(), b.size(), a.isNull())
|
|
75
|
+
swap(b, a)
|
|
76
|
+
print(a.size(), b.size(), a.isNull())
|
|
77
|
+
print()
|
|
78
|
+
|
|
79
|
+
a = ExampleSnapPea.figureEight(); b = Example3.whiteheadLink()
|
|
80
|
+
print(a.size(), b.size(), a.isNull())
|
|
81
|
+
# Note: a.swap(b) is not recognised by python, since it seems that
|
|
82
|
+
# SnapPeaTriangulation's swap() member hides Triangulation<3>'s swap() member.
|
|
83
|
+
b.swap(a)
|
|
84
|
+
print(a.size(), b.size(), a.isNull())
|
|
85
|
+
print()
|
|
86
|
+
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Regina - A Normal Surface Theory Calculator
|
|
4
|
+
# Python Test Suite Runner
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2007-2025, Ben Burton
|
|
7
|
+
# For further details contact Ben Burton (bab@debian.org).
|
|
8
|
+
#
|
|
9
|
+
# Usage: testall
|
|
10
|
+
#
|
|
11
|
+
# Runs the entire Python test suite. This script searches for files
|
|
12
|
+
# named *.test in or beneath the current directory, runs them through
|
|
13
|
+
# regina-python, and compares the results byte-by-byte with the
|
|
14
|
+
# corresponding *.out files. Any mismatches are considered to be test
|
|
15
|
+
# failures.
|
|
16
|
+
#
|
|
17
|
+
# If the output is expected to differ between pybind11 2.x.y (used with
|
|
18
|
+
# Python 3.11 and earlier) vs pybind11 3.x.y (used with Python 3.12 and
|
|
19
|
+
# later), there should instead be two output files: *.out.v2 and *.out.v3.
|
|
20
|
+
# If *.out is present, this will take priority over *.out.v2 and/or *.out.v3.
|
|
21
|
+
#
|
|
22
|
+
# This script MUST be run from the python/testsuite directory in the
|
|
23
|
+
# build tree. It runs regina-python directly out of the build tree.
|
|
24
|
+
# It does not require regina to be installed on the system (and indeed
|
|
25
|
+
# it ignores any installation that it might find).
|
|
26
|
+
#
|
|
27
|
+
# Because tests might need to access other files within the source tree
|
|
28
|
+
# (which might not be the same as the build tree), the corresponding
|
|
29
|
+
# python/testsuite directory within the source tree will be passed as an
|
|
30
|
+
# argument to each test script.
|
|
31
|
+
#
|
|
32
|
+
# This program is free software; you can redistribute it and/or
|
|
33
|
+
# modify it under the terms of the GNU General Public License as
|
|
34
|
+
# published by the Free Software Foundation; either version 2 of the
|
|
35
|
+
# License, or (at your option) any later version.
|
|
36
|
+
#
|
|
37
|
+
# As an exception, when this program is distributed through (i) the
|
|
38
|
+
# App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
|
|
39
|
+
# (iii) Google Play by Google Inc., then that store may impose any
|
|
40
|
+
# digital rights management, device limits and/or redistribution
|
|
41
|
+
# restrictions that are required by its terms of service.
|
|
42
|
+
#
|
|
43
|
+
# This program is distributed in the hope that it will be useful, but
|
|
44
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
45
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
46
|
+
# General Public License for more details.
|
|
47
|
+
#
|
|
48
|
+
# You should have received a copy of the GNU General Public License
|
|
49
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
50
|
+
|
|
51
|
+
set -e
|
|
52
|
+
|
|
53
|
+
# To see the output, you need to run:
|
|
54
|
+
# make test ARGS="-V"
|
|
55
|
+
|
|
56
|
+
executable=../regina-python
|
|
57
|
+
testdir='@BASH_CMAKE_SOURCE_DIR@/python/testsuite'
|
|
58
|
+
testoutdir=`mktemp -d -t regina.XXX`
|
|
59
|
+
pybind11_version='@REGINA_PYBIND11_VERSION@'
|
|
60
|
+
|
|
61
|
+
echo "---------------------------------------"
|
|
62
|
+
echo "Test suite for Regina's python bindings"
|
|
63
|
+
echo "---------------------------------------"
|
|
64
|
+
echo
|
|
65
|
+
|
|
66
|
+
if ! test -f ../../CMakeCache.txt -a -f "$executable"; then
|
|
67
|
+
echo "ERROR: You do not appear to be within the python/testsuite directory"
|
|
68
|
+
echo " in the build tree. This script must be run from directly"
|
|
69
|
+
echo " within the build tree (where you ran cmake)."
|
|
70
|
+
echo " Please change into the python/testsuite directory in the"
|
|
71
|
+
echo " build tree and try again."
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
# Clobber environment variables that the user might already have set.
|
|
76
|
+
export REGINA_VERBOSITY=
|
|
77
|
+
export REGINA_PYLIBDIR=
|
|
78
|
+
export REGINA_HOME=
|
|
79
|
+
|
|
80
|
+
broken=
|
|
81
|
+
found=
|
|
82
|
+
|
|
83
|
+
# We need to loop through all files $testdir/*.test .
|
|
84
|
+
# Because $testdir may contain spaces, we use a slightly tortured loop
|
|
85
|
+
# with the source 'find' statement at the end (not the beginning).
|
|
86
|
+
# See http://mywiki.wooledge.org/BashFAQ/020 for details.
|
|
87
|
+
#
|
|
88
|
+
# Note that both "find -print0" and "sort -z" (which are part of our machinery
|
|
89
|
+
# to handle spaces correctly) are implemented in both GNU and BSD utilities.
|
|
90
|
+
#
|
|
91
|
+
while IFS= read -r -d $'\0' i; do
|
|
92
|
+
found=1
|
|
93
|
+
testname=`basename "$i"`
|
|
94
|
+
expected="${i/.test/.out}"
|
|
95
|
+
if [ ! -e "$expected" ]; then
|
|
96
|
+
expected="$expected.v$pybind11_version"
|
|
97
|
+
fi
|
|
98
|
+
observed="$testoutdir/${testname/.test/.out}"
|
|
99
|
+
filter="$testdir/${testname/.test/.filter}"
|
|
100
|
+
|
|
101
|
+
# Run the test.
|
|
102
|
+
#
|
|
103
|
+
# Since we have "set -e", we need "&& dummy=" to prevent this line to just
|
|
104
|
+
# exit the bash script when the test has non-zero exit code.
|
|
105
|
+
# We use && as opposed to || in order to preserve the exit code from
|
|
106
|
+
# the first command.
|
|
107
|
+
#
|
|
108
|
+
# The code that unsets TERM fixes an issue seen some years ago on
|
|
109
|
+
# Fedora, where (as a result of a more exotic TERM setting) unprintable
|
|
110
|
+
# characters were being dumped at the beginning of the python output.
|
|
111
|
+
#
|
|
112
|
+
if [ -e "$filter" ]; then
|
|
113
|
+
echo -n "Running $testname (with filter) ... "
|
|
114
|
+
TERM= PYTHONIOENCODING=utf8 \
|
|
115
|
+
"$executable" "$i" "$testdir" | "$filter" > "$observed" 2>&1 && dummy=
|
|
116
|
+
else
|
|
117
|
+
echo -n "Running $testname ... "
|
|
118
|
+
TERM= PYTHONIOENCODING=utf8 \
|
|
119
|
+
"$executable" "$i" "$testdir" > "$observed" 2>&1 && dummy=
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
# Catch exitcode.
|
|
123
|
+
exitcode=$?
|
|
124
|
+
|
|
125
|
+
# Branch based on exit code.
|
|
126
|
+
if [ "$exitcode" -ne 0 ]; then
|
|
127
|
+
echo "FAILED (exit code $exitcode)"
|
|
128
|
+
echo " Output was:"
|
|
129
|
+
echo " ..."
|
|
130
|
+
tail -n 5 $observed | sed -e 's/^/ /'
|
|
131
|
+
broken=1
|
|
132
|
+
else
|
|
133
|
+
if ! ( diff --strip-trailing-cr "$expected" "$observed" > /dev/null ); then
|
|
134
|
+
echo "FAILED (output differs from expected)"
|
|
135
|
+
echo " Diff was:"
|
|
136
|
+
diff --strip-trailing-cr -u \
|
|
137
|
+
--label 'Expected output' --label 'Actual output' \
|
|
138
|
+
"$expected" "$observed" | head -n200 | sed -e 's/^/ /'
|
|
139
|
+
echo " ..."
|
|
140
|
+
broken=1
|
|
141
|
+
else
|
|
142
|
+
echo "ok"
|
|
143
|
+
rm -f "$observed"
|
|
144
|
+
fi
|
|
145
|
+
fi
|
|
146
|
+
done < <(find "$testdir" -name "*.test" -print0 | sort -z)
|
|
147
|
+
|
|
148
|
+
if ! test -n "$found"; then
|
|
149
|
+
echo "ERROR: No tests were found!"
|
|
150
|
+
echo
|
|
151
|
+
echo " Please check your installation, and please ensure that"
|
|
152
|
+
echo " you are running this script from within the python/testsuite"
|
|
153
|
+
echo " directory of the build tree."
|
|
154
|
+
echo
|
|
155
|
+
echo " Note that the build tree might not be the same as the source"
|
|
156
|
+
echo " tree. The build tree is where you ran the configure script."
|
|
157
|
+
exit 1
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
if test -n "$broken"; then
|
|
161
|
+
echo
|
|
162
|
+
echo "One or more tests failed."
|
|
163
|
+
echo "Please see the list above for details."
|
|
164
|
+
echo
|
|
165
|
+
echo "The full output file(s) produced by Regina are in the directory:"
|
|
166
|
+
echo " $testoutdir"
|
|
167
|
+
exit 1
|
|
168
|
+
else
|
|
169
|
+
rmdir "$testoutdir"
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
echo
|
|
173
|
+
echo "All tests passed!"
|
|
174
|
+
exit 0
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Regina - A Normal Surface Theory Calculator
|
|
4
|
+
# Python Test Suite Runner
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2007-2025, Ben Burton
|
|
7
|
+
# For further details contact Ben Burton (bab@debian.org).
|
|
8
|
+
#
|
|
9
|
+
# Usage: testbasic
|
|
10
|
+
#
|
|
11
|
+
# Runs most but not all of the Python test suite using a basic C++ executable
|
|
12
|
+
# with an embedded Python interpreter and an in-built timeout feature.
|
|
13
|
+
#
|
|
14
|
+
# Like testall, this script works through all *.test files in or beneath
|
|
15
|
+
# the current directory; however, unlike testall it skips those tests
|
|
16
|
+
# whose names are in a hard-coded blacklist. Similar to testall, this
|
|
17
|
+
# script runs each test through the basic embedded Python interpreter and
|
|
18
|
+
# compares the results byte-by-byte with the corresponding *.out files
|
|
19
|
+
# (or, if the output differs between pybind11 versions, *.out.v2 and *.out.v3).
|
|
20
|
+
# Any mismatches or timeouts are considered to be test failures.
|
|
21
|
+
#
|
|
22
|
+
# This script MUST be run from the python/testsuite directory in the
|
|
23
|
+
# build tree. It runs everything directly out of the build tree.
|
|
24
|
+
# It does not require regina to be installed on the system (and indeed
|
|
25
|
+
# it ignores any installation that it might find).
|
|
26
|
+
#
|
|
27
|
+
# Unlike testall, the corresponding python/testsuite directory will *not*
|
|
28
|
+
# be passed to the test scripts. Any scripts that require this information
|
|
29
|
+
# should not be used with testbasic.
|
|
30
|
+
#
|
|
31
|
+
# This program is free software; you can redistribute it and/or
|
|
32
|
+
# modify it under the terms of the GNU General Public License as
|
|
33
|
+
# published by the Free Software Foundation; either version 2 of the
|
|
34
|
+
# License, or (at your option) any later version.
|
|
35
|
+
#
|
|
36
|
+
# As an exception, when this program is distributed through (i) the
|
|
37
|
+
# App Store by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or
|
|
38
|
+
# (iii) Google Play by Google Inc., then that store may impose any
|
|
39
|
+
# digital rights management, device limits and/or redistribution
|
|
40
|
+
# restrictions that are required by its terms of service.
|
|
41
|
+
#
|
|
42
|
+
# This program is distributed in the hope that it will be useful, but
|
|
43
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
44
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
45
|
+
# General Public License for more details.
|
|
46
|
+
#
|
|
47
|
+
# You should have received a copy of the GNU General Public License
|
|
48
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
49
|
+
|
|
50
|
+
set -e
|
|
51
|
+
|
|
52
|
+
# To see the output, you need to run:
|
|
53
|
+
# make test ARGS="-V"
|
|
54
|
+
|
|
55
|
+
executable=./basic
|
|
56
|
+
testdir='@BASH_CMAKE_SOURCE_DIR@/python/testsuite'
|
|
57
|
+
testoutdir=`mktemp -d -t regina.XXX`
|
|
58
|
+
pybind11_version='@REGINA_PYBIND11_VERSION@'
|
|
59
|
+
|
|
60
|
+
# REGINA_HOME can be deduced from the executable path, but on Windows this
|
|
61
|
+
# deduction gives the wrong style of path (windows vs unix style) for use
|
|
62
|
+
# with the embedded basic Python interpreter. Fix it explicitly here.
|
|
63
|
+
export REGINA_HOME=../../engine
|
|
64
|
+
|
|
65
|
+
# Cases that expect the python/testsuite directory as an argument:
|
|
66
|
+
blacklist="file i18n memory1 orb pdf repr snappea"
|
|
67
|
+
|
|
68
|
+
# The following cases implicitly import the threading module, which leads to a
|
|
69
|
+
# harmless but noisy ignored exception upon shutdown under python 3.12 and
|
|
70
|
+
# above. See: https://github.com/pybind/pybind11/issues/2197
|
|
71
|
+
blacklist="$blacklist docstrings"
|
|
72
|
+
|
|
73
|
+
echo "----------------------------------------------------------------"
|
|
74
|
+
echo "Test suite for python bindings with a basic embedded interpreter"
|
|
75
|
+
echo "----------------------------------------------------------------"
|
|
76
|
+
echo
|
|
77
|
+
|
|
78
|
+
if ! test -f ../../CMakeCache.txt -a -f "$executable"; then
|
|
79
|
+
echo "ERROR: You do not appear to be within the python/testsuite directory"
|
|
80
|
+
echo " in the build tree. This script must be run from directly"
|
|
81
|
+
echo " within the build tree (where you ran cmake)."
|
|
82
|
+
echo " Please change into the python/testsuite directory in the"
|
|
83
|
+
echo " build tree and try again."
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# Make sure Python will be able to import regina.
|
|
88
|
+
os='@CMAKE_SYSTEM_NAME@'
|
|
89
|
+
case "$os" in
|
|
90
|
+
Darwin )
|
|
91
|
+
export DYLD_LIBRARY_PATH="../../engine:$DYLD_LIBRARY_PATH"
|
|
92
|
+
export PYTHONPATH="..:$PYTHONPATH"
|
|
93
|
+
;;
|
|
94
|
+
Windows )
|
|
95
|
+
# The PYTHONHOME directory is incorrectly hard-coded in msys2.
|
|
96
|
+
# Work out the correct value by asking the python interpreter directly.
|
|
97
|
+
PYTHON='@BASH_Python_EXECUTABLE@'
|
|
98
|
+
if [ ! -e "$PYTHON" ]; then
|
|
99
|
+
echo "ERROR: Python interpreter not found: $PYTHON"
|
|
100
|
+
exit 1
|
|
101
|
+
fi
|
|
102
|
+
export PYTHONHOME="`"$PYTHON" -c 'import sys; print(sys.prefix)'`"
|
|
103
|
+
if [ ! -d "$PYTHONHOME" ]; then
|
|
104
|
+
echo "ERROR: Python home not found: $PYTHONHOME"
|
|
105
|
+
exit 1
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
export PATH="../../engine:$PATH"
|
|
109
|
+
export PYTHONPATH="..;$PYTHONPATH"
|
|
110
|
+
;;
|
|
111
|
+
* )
|
|
112
|
+
export LD_LIBRARY_PATH="../../engine:$LD_LIBRARY_PATH"
|
|
113
|
+
export PYTHONPATH="..:$PYTHONPATH"
|
|
114
|
+
;;
|
|
115
|
+
esac
|
|
116
|
+
|
|
117
|
+
# Python 3.10.[0-2] cannot process several of our test scripts due to a
|
|
118
|
+
# breakage in the line-by-line compilation (this was fixed with the
|
|
119
|
+
# introduction of the constant PyCF_ALLOW_INCOMPLETE_INPUT in Python 3.10.3).
|
|
120
|
+
# Note: these *are* still tested with testall (which runs within a normal python
|
|
121
|
+
# interpreter); just not testbasic (which embeds python in a C++ program).
|
|
122
|
+
pyver=`"$executable" -v`
|
|
123
|
+
case "$pyver" in
|
|
124
|
+
3.10.[0-2]*)
|
|
125
|
+
echo "WARNING: Skipping several tests due to broken line-by-line"
|
|
126
|
+
echo " compilation in embedded python 3.10.[0-2]."
|
|
127
|
+
echo
|
|
128
|
+
blacklist="$blacklist embeddings faces flype groups hypersurfaces"
|
|
129
|
+
blacklist="$blacklist iterators listview presentations refs skeleton"
|
|
130
|
+
blacklist="$blacklist standardtri"
|
|
131
|
+
;;
|
|
132
|
+
*)
|
|
133
|
+
;;
|
|
134
|
+
esac
|
|
135
|
+
|
|
136
|
+
found=
|
|
137
|
+
broken=
|
|
138
|
+
|
|
139
|
+
# Decide on a suitable timeout (measured in seconds) for our tests.
|
|
140
|
+
case "$os" in
|
|
141
|
+
Windows )
|
|
142
|
+
# The Windows simulator is *enormously* slow.
|
|
143
|
+
# Give it half an hour (gulp).
|
|
144
|
+
timeout=1800
|
|
145
|
+
;;
|
|
146
|
+
* )
|
|
147
|
+
# Linux builds may also be running under hardware emulation.
|
|
148
|
+
# Give each test ten minutes, which is *way* more than it should need.
|
|
149
|
+
timeout=600
|
|
150
|
+
;;
|
|
151
|
+
esac
|
|
152
|
+
|
|
153
|
+
# We need to loop through all files $testdir/*.test .
|
|
154
|
+
# Because $testdir may contain spaces, we use a slightly tortured loop
|
|
155
|
+
# with the source 'find' statement at the end (not the beginning).
|
|
156
|
+
# See http://mywiki.wooledge.org/BashFAQ/020 for details.
|
|
157
|
+
#
|
|
158
|
+
# Note that both "find -print0" and "sort -z" (which are part of our machinery
|
|
159
|
+
# to handle spaces correctly) are implemented in both GNU and BSD utilities.
|
|
160
|
+
#
|
|
161
|
+
while IFS= read -r -d $'\0' i; do
|
|
162
|
+
found=1
|
|
163
|
+
testname=`basename "$i"`
|
|
164
|
+
expected="${i/.test/.out}"
|
|
165
|
+
if [ ! -e "$expected" ]; then
|
|
166
|
+
expected="$expected.v$pybind11_version"
|
|
167
|
+
fi
|
|
168
|
+
observed="$testoutdir/${testname/.test/.out}"
|
|
169
|
+
filter="$testdir/${testname/.test/.filter}"
|
|
170
|
+
|
|
171
|
+
blacklisted=0
|
|
172
|
+
for b in $blacklist; do
|
|
173
|
+
if [ "$testname" = "$b.test" ]; then
|
|
174
|
+
blacklisted=1
|
|
175
|
+
break
|
|
176
|
+
fi
|
|
177
|
+
done
|
|
178
|
+
if [ "$blacklisted" = 1 ]; then
|
|
179
|
+
echo "Skipping $testname"
|
|
180
|
+
continue
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
# We do not test with a separate execution thread for now, since the
|
|
184
|
+
# current implementation of PythonInterpreter requires code to be executed
|
|
185
|
+
# from the same thread that created the interpreter.
|
|
186
|
+
#
|
|
187
|
+
# for multithreading in 0 1; do
|
|
188
|
+
for multithreading in 0; do
|
|
189
|
+
# Run the test.
|
|
190
|
+
#
|
|
191
|
+
# Since we have "set -e", we need "&& dummy=" to prevent this line to
|
|
192
|
+
# just exit the bash script when the test has non-zero exit code.
|
|
193
|
+
# We use && as opposed to || in order to preserve the exit code from
|
|
194
|
+
# the first command.
|
|
195
|
+
#
|
|
196
|
+
# The code that unsets TERM fixes an issue seen some years ago on
|
|
197
|
+
# Fedora, where (as a result of a more exotic TERM setting) unprintable
|
|
198
|
+
# characters were being dumped at the beginning of the python output.
|
|
199
|
+
#
|
|
200
|
+
if [ -e "$filter" ]; then
|
|
201
|
+
if [ "$multithreading" = 0 ]; then
|
|
202
|
+
# echo -n "Running $testname (with filter, main thread) ... "
|
|
203
|
+
echo -n "Running $testname (with filter) ... "
|
|
204
|
+
TERM= PYTHONIOENCODING=utf8 \
|
|
205
|
+
"$executable" -t "$timeout" "$i" | "$filter" > "$observed" 2>&1 && dummy=
|
|
206
|
+
else
|
|
207
|
+
echo -n "Running $testname (with filter, separate thread) ... "
|
|
208
|
+
TERM= PYTHONIOENCODING=utf8 \
|
|
209
|
+
"$executable" -m -t "$timeout" "$i" | "$filter" > "$observed" 2>&1 && dummy=
|
|
210
|
+
fi
|
|
211
|
+
else
|
|
212
|
+
if [ "$multithreading" = 0 ]; then
|
|
213
|
+
# echo -n "Running $testname (main thread) ... "
|
|
214
|
+
echo -n "Running $testname ... "
|
|
215
|
+
TERM= PYTHONIOENCODING=utf8 \
|
|
216
|
+
"$executable" -t "$timeout" "$i" > "$observed" 2>&1 && dummy=
|
|
217
|
+
else
|
|
218
|
+
echo -n "Running $testname (separate thread) ... "
|
|
219
|
+
TERM= PYTHONIOENCODING=utf8 \
|
|
220
|
+
"$executable" -m -t "$timeout" "$i" > "$observed" 2>&1 && dummy=
|
|
221
|
+
fi
|
|
222
|
+
fi
|
|
223
|
+
|
|
224
|
+
# Catch exitcode.
|
|
225
|
+
exitcode=$?
|
|
226
|
+
|
|
227
|
+
# Branch based on exit code.
|
|
228
|
+
if [ "$exitcode" -ne 0 ]; then
|
|
229
|
+
echo "FAILED (exit code $exitcode)"
|
|
230
|
+
echo " Output was:"
|
|
231
|
+
echo " ..."
|
|
232
|
+
tail -n 5 $observed | sed -e 's/^/ /'
|
|
233
|
+
broken=1
|
|
234
|
+
else
|
|
235
|
+
if ! ( diff --strip-trailing-cr "$expected" "$observed" > /dev/null ); then
|
|
236
|
+
echo "FAILED (output differs from expected)"
|
|
237
|
+
echo " Diff was:"
|
|
238
|
+
diff --strip-trailing-cr -u \
|
|
239
|
+
--label 'Expected output' --label 'Actual output' \
|
|
240
|
+
"$expected" "$observed" | head -n200 | sed -e 's/^/ /'
|
|
241
|
+
echo " ..."
|
|
242
|
+
broken=1
|
|
243
|
+
else
|
|
244
|
+
echo "ok"
|
|
245
|
+
rm -f "$observed"
|
|
246
|
+
fi
|
|
247
|
+
fi
|
|
248
|
+
done
|
|
249
|
+
done < <(find "$testdir" -name "*.test" -print0 | sort -z)
|
|
250
|
+
|
|
251
|
+
if ! test -n "$found"; then
|
|
252
|
+
echo "ERROR: No tests were found!"
|
|
253
|
+
echo
|
|
254
|
+
echo " Please check your installation, and please ensure that"
|
|
255
|
+
echo " you are running this script from within the python/testsuite"
|
|
256
|
+
echo " directory of the build tree."
|
|
257
|
+
echo
|
|
258
|
+
echo " Note that the build tree might not be the same as the source"
|
|
259
|
+
echo " tree. The build tree is where you ran the configure script."
|
|
260
|
+
exit 1
|
|
261
|
+
fi
|
|
262
|
+
|
|
263
|
+
if test -n "$broken"; then
|
|
264
|
+
echo
|
|
265
|
+
echo "One or more tests failed."
|
|
266
|
+
echo "Please see the list above for details."
|
|
267
|
+
echo
|
|
268
|
+
echo "The full output file(s) produced by Regina are in the directory:"
|
|
269
|
+
echo " $testoutdir"
|
|
270
|
+
exit 1
|
|
271
|
+
else
|
|
272
|
+
rmdir "$testoutdir"
|
|
273
|
+
fi
|
|
274
|
+
|
|
275
|
+
echo
|
|
276
|
+
echo "All tests passed!"
|
|
277
|
+
exit 0
|