regina 7.3.1__cp312-cp312-macosx_11_0_arm64.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.

Potentially problematic release.


This version of regina might be problematic. Click here for more details.

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