Added plain Python sample project.

pull/383/head
Jussi Pakkanen 9 years ago
parent d95a108503
commit a8120eb519
  1. 1
      run_tests.py
  2. 0
      test cases/python3/1 basic/gluon/__init__.py
  3. 2
      test cases/python3/1 basic/gluon/gluonator.py
  4. 9
      test cases/python3/1 basic/meson.build
  5. 9
      test cases/python3/1 basic/prog.py
  6. 5
      test cases/python3/1 basic/subdir/meson.build
  7. 12
      test cases/python3/1 basic/subdir/subprog.py

@ -260,6 +260,7 @@ def detect_tests_to_run():
all_tests.append(('objective c', gather_tests('test cases/objc'), False if not mesonlib.is_windows() else True))
all_tests.append(('fortran', gather_tests('test cases/fortran'), False if shutil.which('gfortran') else True))
all_tests.append(('swift', gather_tests('test cases/swift'), False if shutil.which('swiftc') else True))
all_tests.append(('python3', gather_tests('test cases/python3'), False if shutil.which('python3') else True))
return all_tests
def run_tests(extra_args):

@ -0,0 +1,2 @@
def gluoninate():
return 42

@ -0,0 +1,9 @@
project('python sample', 'c')
py3 = find_program('python3')
main = files('prog.py')
test('toplevel', py3, args : main)
subdir('subdir')

@ -0,0 +1,9 @@
#!/usr/bin/env python3
from gluon import gluonator
import sys
print('Running mainprog from root dir.')
if gluonator.gluoninate() != 42:
sys.exit(1)

@ -0,0 +1,5 @@
submain = find_program('subprog.py')
test('subdir',
submain,
env : 'PYTHONPATH=' + meson.source_root())

@ -0,0 +1,12 @@
#!/usr/bin/env python3
# In order to run this program, PYTHONPATH must be set to
# point to source root.
from gluon import gluonator
import sys
print('Running mainprog from subdir.')
if gluonator.gluoninate() != 42:
sys.exit(1)
Loading…
Cancel
Save