Skip to content

Commit 7b9fc7e

Browse files
committed
Update HPy inlined files: 33c8692
1 parent a65d9e7 commit 7b9fc7e

File tree

10 files changed

+357
-330
lines changed

10 files changed

+357
-330
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
// automatically generated by setup.py:get_scm_config()
3-
#define HPY_VERSION "0.0.3.dev317+ng8fe1487"
4-
#define HPY_GIT_REVISION "8fe1487"
3+
#define HPY_VERSION "0.0.3"
4+
#define HPY_GIT_REVISION "33c8692"

graalpython/lib-graalpython/modules/hpy/devel/src/runtime/argparse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@
126126
* used as the error message instead of the default error message. : and ;
127127
* are mutually exclusive and whichever occurs first takes precedence.
128128
*
129-
* API
130-
* ---
129+
* Argument Parsing API
130+
* --------------------
131131
*
132132
*/
133133

graalpython/lib-graalpython/modules/hpy/devel/src/runtime/helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* These are not part of the HPy context or ABI, but are available for
55
* HPy extensions to incorporate at compile time.
66
*
7-
* API
8-
* ---
7+
* Runtime Helpers API
8+
* -------------------
99
*
1010
*/
1111

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
# automatically generated by setup.py:get_scm_config()
3-
__version__ = "0.0.3.dev317+ng8fe1487"
4-
__git_revision__ = "8fe1487"
3+
__version__ = "0.0.3"
4+
__git_revision__ = "33c8692"

graalpython/lib-graalpython/modules/hpy/test/check_py27_compat.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@
1515
import py
1616

1717
ROOT = py.path.local(__file__).join('..', '..')
18+
TEST_DIRS = [ROOT / 'test', ROOT / 'test' / 'debug']
19+
20+
# PyPy does NOT import these files using py2
21+
PY3_ONLY = ['test_support.py', 'test_handles.py']
1822

1923
def try_import(name):
2024
try:
21-
print('Trying to import %s... ' % name, end='')
22-
__import__(name)
25+
if isinstance(name, py.path.local):
26+
print('Trying to import %s... ' % ROOT.bestrelpath(name), end='')
27+
name.pyimport()
28+
else:
29+
print('Trying to import %s... ' % name, end='')
30+
__import__(name)
2331
except:
2432
print('ERROR!')
2533
print()
@@ -48,15 +56,17 @@ def try_import_hpy_devel():
4856
init_py.remove()
4957
return failed
5058

51-
def try_import_tests():
59+
def try_import_tests(dirs):
5260
failed = 0
53-
for t in ROOT.join('test').listdir('test_*.py'):
54-
if t.purebasename == 'test_support':
55-
continue
56-
if not try_import('test.%s' % t.purebasename):
57-
failed += 1
61+
for d in dirs:
62+
for t in d.listdir('test_*.py'):
63+
if t.basename in PY3_ONLY:
64+
continue
65+
if not try_import(t):
66+
failed += 1
5867
return failed
5968

69+
6070
def main():
6171
if sys.version_info[:2] != (2, 7):
6272
print('ERROR: this script should be run on top of python 2.7')
@@ -65,7 +75,7 @@ def main():
6575
sys.path.insert(0, str(ROOT))
6676
failed = 0
6777
failed += try_import_hpy_devel()
68-
failed += try_import_tests()
78+
failed += try_import_tests(TEST_DIRS)
6979
print()
7080
if failed == 0:
7181
print('Everything ok!')

graalpython/lib-graalpython/modules/hpy/test/conftest.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
2-
from .support import ExtensionCompiler
3-
from hpy.debug.pytest import hpy_debug # make it available to all tests
2+
from .support import ExtensionCompiler, DefaultExtensionTemplate
3+
from hpy.debug.leakdetector import LeakDetector
44

55
def pytest_addoption(parser):
66
parser.addoption(
@@ -14,10 +14,21 @@ def hpy_devel(request):
1414

1515
@pytest.fixture(params=['cpython', 'universal', 'debug'])
1616
def hpy_abi(request):
17-
return request.param
17+
abi = request.param
18+
if abi == 'debug':
19+
with LeakDetector():
20+
yield abi
21+
else:
22+
yield abi
1823

1924
@pytest.fixture
20-
def compiler(request, tmpdir, hpy_devel, hpy_abi):
25+
def ExtensionTemplate():
26+
return DefaultExtensionTemplate
27+
28+
29+
@pytest.fixture
30+
def compiler(request, tmpdir, hpy_devel, hpy_abi, ExtensionTemplate):
2131
compiler_verbose = request.config.getoption('--compiler-v')
2232
return ExtensionCompiler(tmpdir, hpy_devel, hpy_abi,
23-
compiler_verbose=compiler_verbose)
33+
compiler_verbose=compiler_verbose,
34+
ExtensionTemplate=ExtensionTemplate)

0 commit comments

Comments
 (0)