diff options
author | Stefan Sauer <ensonic@hora-obscura.de> | 2019-12-23 11:15:58 +0000 |
---|---|---|
committer | Stefan Sauer <ensonic@hora-obscura.de> | 2019-12-23 11:15:58 +0000 |
commit | ad76c0ccdb8a88ad0a3c1eb27f58794ee94de6e1 (patch) | |
tree | 66727014ac3e2147ca37ce7a3540472391e33b5f | |
parent | b84b964327019b946534a4cd7838b591c1f69a60 (diff) | |
parent | c11728a9483f907db304d2c3a25afb7720d8d35a (diff) | |
download | gtk-doc-ad76c0ccdb8a88ad0a3c1eb27f58794ee94de6e1.tar.gz |
Merge branch 'tests' into 'master'
meson: Fix running tests
See merge request GNOME/gtk-doc!40
-rw-r--r-- | .gitlab-ci.yml | 1 | ||||
-rw-r--r-- | meson.build | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/highlight.py | 0 | ||||
-rw-r--r-- | tests/meson.build | 31 |
4 files changed, 22 insertions, 18 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee5dfbf..3f84030 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,7 @@ meson-build: script: - meson --prefix /usr _build . - ninja -C _build + - meson test -C _build except: - tags diff --git a/meson.build b/meson.build index f7d785f..7eeef38 100644 --- a/meson.build +++ b/meson.build @@ -13,8 +13,8 @@ version = meson.project_version() package_name = meson.project_name() # Paths -srcdir = meson.source_root() -builddir = meson.build_root() +srcdir = meson.current_source_dir() +builddir = meson.current_build_dir() prefix = get_option('prefix') @@ -165,7 +165,9 @@ configure_file( ) subdir('help') -subdir('tests') +if get_option('tests') + subdir('tests') +endif # A dummy dependency object that to use gtkdoc as subproject fallback # To be used as: dependency('gtk-doc', fallback : ['gtk-doc', 'dummy_dep']) diff --git a/tests/highlight.py b/tests/highlight.py index 7c88049..7c88049 100644..100755 --- a/tests/highlight.py +++ b/tests/highlight.py diff --git a/tests/meson.build b/tests/meson.build index a60cf46..92add69 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -8,11 +8,14 @@ gtkdoc_unit_tests = [ 'scan', ] +test_env = environment() +test_env.append('PYTHONPATH', srcdir, builddir) + foreach test_name: gtkdoc_unit_tests test( 'test-unit-@0@'.format(test_name), python_prg, - env: ['PYTHONPATH=@0@'.format(builddir)], + env: test_env, args: [ join_paths( srcdir, @@ -25,20 +28,18 @@ endforeach subdir('helpers') -if get_option('tests') == true - glib_dep = dependency('glib-2.0', version: glib_req) - gobject_dep = dependency('gobject-2.0', version: glib_req) +glib_dep = dependency('glib-2.0', version: glib_req) +gobject_dep = dependency('gobject-2.0', version: glib_req) - glib_prefix = glib_dep.get_pkgconfig_variable('prefix') - glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') +glib_prefix = glib_dep.get_pkgconfig_variable('prefix') +glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') - gobject_prefix = gobject_dep.get_pkgconfig_variable('prefix') - gobject_docpath = join_paths(gobject_prefix, 'share', 'gtk-doc', 'html') +gobject_prefix = gobject_dep.get_pkgconfig_variable('prefix') +gobject_docpath = join_paths(gobject_prefix, 'share', 'gtk-doc', 'html') - subdir('annotations') - subdir('bugs') - subdir('empty') - subdir('fail') - subdir('gobject') - subdir('program') -endif +subdir('annotations') +subdir('bugs') +subdir('empty') +subdir('fail') +subdir('gobject') +subdir('program') |