diff options
author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2018-04-27 00:00:00 +0000 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-07-11 09:16:14 +0200 |
commit | eaabc3ba8a827ca1455acc44c1d7c73e2a92bee4 (patch) | |
tree | 5ebe3814d68d7841d1ec18862390b251c0e6b233 /tests | |
parent | bd2054a127de9244bc05c4e170a014dd224507e8 (diff) | |
download | gobject-introspection-eaabc3ba8a827ca1455acc44c1d7c73e2a92bee4.tar.gz |
meson: Run Python unit tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/meson.build | 1 | ||||
-rw-r--r-- | tests/scanner/meson.build | 13 | ||||
-rw-r--r-- | tests/scanner/test_transformer.py | 6 |
3 files changed, 14 insertions, 6 deletions
diff --git a/tests/meson.build b/tests/meson.build index 458af2bb..71cd97fe 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -17,3 +17,4 @@ install_data(installed_sources, install_dir: join_paths(get_option('datadir'), ' ### TODO: actually test subdir('warn') +subdir('scanner') diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build new file mode 100644 index 00000000..f8b794d2 --- /dev/null +++ b/tests/scanner/meson.build @@ -0,0 +1,13 @@ + +scanner_test_env = environment() +scanner_test_env.append('PYTHONPATH', join_paths(meson.current_build_dir(), '../../')) + +scanner_test_files = [ + 'test_sourcescanner.py', + 'test_transformer.py' +] + +foreach f : scanner_test_files + test(f, python3, args: files(f), env: scanner_test_env) +endforeach + diff --git a/tests/scanner/test_transformer.py b/tests/scanner/test_transformer.py index 8c41fc58..13b0b669 100644 --- a/tests/scanner/test_transformer.py +++ b/tests/scanner/test_transformer.py @@ -16,12 +16,6 @@ else: os.environ['GI_SCANNER_DISABLE_CACHE'] = '1' -path = os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None) -assert path is not None -sys.path.insert(0, path) - -# Not correct, but enough to get the tests going uninstalled -builtins.__dict__['DATADIR'] = path from giscanner import ast from giscanner.sourcescanner import SourceScanner |