summaryrefslogtreecommitdiff
path: root/tests/scanner
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scanner')
-rw-r--r--tests/scanner/annotationparser/meson.build18
-rw-r--r--tests/scanner/meson.build24
-rw-r--r--tests/scanner/test_docwriter.py12
3 files changed, 26 insertions, 28 deletions
diff --git a/tests/scanner/annotationparser/meson.build b/tests/scanner/annotationparser/meson.build
index 954dc28d..cce8c5c7 100644
--- a/tests/scanner/annotationparser/meson.build
+++ b/tests/scanner/annotationparser/meson.build
@@ -1,20 +1,14 @@
annotationparser_test_env = environment()
-annotationparser_test_env.append('PYTHONPATH', join_paths(meson.current_build_dir(), '../../../'))
+annotationparser_test_env.prepend('PYTHONPATH', test_env_common_pypath)
+if test_env_common_path.length() > 0
+ annotationparser_test_env.prepend('PATH', test_env_common_path)
+endif
annotationparser_test_files = [
'test_patterns.py',
+ 'test_parser.py',
]
-# FIXME: MSVC
-# from giscanner._giscanner import SourceScanner as CSourceScanner
-# ImportError: DLL load failed: The specified module could not be found.
-if cc.get_id() != 'msvc'
- annotationparser_test_files += [
- 'test_parser.py',
- ]
-endif
-
foreach f : annotationparser_test_files
- test(f, python, args: files(f), env: annotationparser_test_env)
+ test(f, python, args: files(f), env: annotationparser_test_env, depends: [giscanner_pymod])
endforeach
-
diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build
index cc5ee530..62809169 100644
--- a/tests/scanner/meson.build
+++ b/tests/scanner/meson.build
@@ -1,24 +1,20 @@
-
scanner_test_env = environment()
-scanner_test_env.append('PYTHONPATH', join_paths(meson.current_build_dir(), '../../'))
+scanner_test_env.prepend('PYTHONPATH', test_env_common_pypath)
+if test_env_common_path.length() > 0
+ scanner_test_env.prepend('PATH', test_env_common_path)
+endif
scanner_test_files = [
'test_shlibs.py',
+ 'test_sourcescanner.py',
+ 'test_transformer.py',
+ 'test_xmlwriter.py',
+ 'test_pkgconfig.py',
+ 'test_docwriter.py',
]
-# FIXME: MSVC
-if cc.get_id() != 'msvc'
- scanner_test_files += [
- 'test_sourcescanner.py',
- 'test_transformer.py',
- 'test_xmlwriter.py',
- 'test_pkgconfig.py',
- 'test_docwriter.py',
- ]
-endif
-
foreach f : scanner_test_files
- test(f, python, args: files(f), env: scanner_test_env)
+ test(f, python, args: files(f), env: scanner_test_env, depends: [giscanner_pymod])
endforeach
subdir('annotationparser')
diff --git a/tests/scanner/test_docwriter.py b/tests/scanner/test_docwriter.py
index 8b2d0fb0..3fb64171 100644
--- a/tests/scanner/test_docwriter.py
+++ b/tests/scanner/test_docwriter.py
@@ -1,9 +1,17 @@
import unittest
-from giscanner.docwriter import DocWriter
-from giscanner.transformer import Transformer
+try:
+ import mako
+except ImportError:
+ HAS_MAKO = False
+else:
+ HAS_MAKO = True
+ mako
+ from giscanner.docwriter import DocWriter
+ from giscanner.transformer import Transformer
+@unittest.skipUnless(HAS_MAKO, "mako missing")
class TestDocWriter(unittest.TestCase):
def test_main(self):