commit
3803ca1a38
11 changed files with 76 additions and 69 deletions
@ -1,9 +1,8 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
from gluon import gluonator |
||||
import sys |
||||
|
||||
print('Running mainprog from root dir.') |
||||
|
||||
if gluonator.gluoninate() != 42: |
||||
sys.exit(1) |
||||
raise ValueError("!= 42") |
||||
|
@ -1,14 +1,11 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import tachyon |
||||
import sys |
||||
|
||||
result = tachyon.phaserize('shoot') |
||||
|
||||
if not isinstance(result, int): |
||||
print('Returned result not an integer.') |
||||
sys.exit(1) |
||||
raise SystemExit('Returned result not an integer.') |
||||
|
||||
if result != 1: |
||||
print('Returned result {} is not 1.'.format(result)) |
||||
sys.exit(1) |
||||
raise SystemExit('Returned result {} is not 1.'.format(result)) |
||||
|
@ -1,23 +1,19 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
from storer import Storer |
||||
import sys |
||||
|
||||
s = Storer() |
||||
|
||||
if s.get_value() != 0: |
||||
print('Initial value incorrect.') |
||||
sys.exit(1) |
||||
raise SystemExit('Initial value incorrect.') |
||||
|
||||
s.set_value(42) |
||||
|
||||
if s.get_value() != 42: |
||||
print('Setting value failed.') |
||||
sys.exit(1) |
||||
raise SystemExit('Setting value failed.') |
||||
|
||||
try: |
||||
s.set_value('not a number') |
||||
print('Using wrong argument type did not fail.') |
||||
sys.exit(1) |
||||
raise SystemExit('Using wrong argument type did not fail.') |
||||
except TypeError: |
||||
pass |
||||
|
@ -1,20 +1,26 @@ |
||||
project('cython', 'c', |
||||
default_options : ['warning_level=3']) |
||||
|
||||
cython = find_program('cython3', required : false) |
||||
py3_dep = dependency('python3', required : false) |
||||
if meson.backend() != 'ninja' |
||||
error('MESON_SKIP_TEST: Ninja backend required') |
||||
endif |
||||
|
||||
if cython.found() and py3_dep.found() |
||||
py_mod = import('python') |
||||
py3 = py_mod.find_installation() |
||||
py3_dep = py3.dependency() |
||||
subdir('libdir') |
||||
cython = find_program('cython', required : false) |
||||
if not cython.found() |
||||
error('MESON_SKIP_TEST: Cython3 not found.') |
||||
endif |
||||
|
||||
test('cython tester', |
||||
py3, |
||||
args : files('cytest.py'), |
||||
env : ['PYTHONPATH=' + pydir] |
||||
) |
||||
else |
||||
error('MESON_SKIP_TEST: Cython3 or Python3 libraries not found, skipping test.') |
||||
py_mod = import('python') |
||||
py3 = py_mod.find_installation() |
||||
py3_dep = py3.dependency(required: false) |
||||
if not py3_dep.found() |
||||
error('MESON_SKIP_TEST: Python library not found.') |
||||
endif |
||||
|
||||
subdir('libdir') |
||||
|
||||
test('cython tester', |
||||
py3, |
||||
args : files('cytest.py'), |
||||
env : ['PYTHONPATH=' + pydir] |
||||
) |
||||
|
@ -1,7 +1,7 @@ |
||||
project('python kwarg') |
||||
|
||||
py = import('python') |
||||
prog_python = py.find_installation('python3', modules : ['setuptools']) |
||||
prog_python = py.find_installation('python3', modules : ['distutils']) |
||||
assert(prog_python.found() == true, 'python not found when should be') |
||||
prog_python = py.find_installation('python3', modules : ['thisbetternotexistmod'], required : false) |
||||
assert(prog_python.found() == false, 'python not found but reported as found') |
||||
|
Loading…
Reference in new issue