[gtk-doc] build: Port to meson build system



commit 53c410d5e3d285b06418bcac85b272299571ac77
Author: Martin Blanchard <tchaik gmx com>
Date:   Thu May 10 23:08:27 2018 +0100

    build: Port to meson build system
    
    Initial port, including manual and tests (still wip).
    
    Known issues:
    
     * mkhtml2.py unit-tests module  relies on lxml, anytree and pygments
       but these dependencies are not track by the build system.
    
     * Integration tests documentation generation are broken.
    
     * gtkdoc_scangobj_runner.py builds --cflags and --libs itself in a
       non-portable (and wrong) way.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=794087

 cmake/meson.build                       |   37 +++++
 gtkdoc/meson.build                      |   54 +++++++
 help/manual/LINGUAS                     |   17 +++
 help/manual/meson.build                 |    9 ++
 help/meson.build                        |    3 +
 meson.build                             |  230 +++++++++++++++++++++++++++++++
 meson_options.txt                       |    9 ++
 style/meson.build                       |   15 ++
 tests/annotations/docs/meson.build      |  107 ++++++++++++++
 tests/annotations/meson.build           |    2 +
 tests/annotations/src/meson.build       |   26 ++++
 tests/bugs/docs/meson.build             |  107 ++++++++++++++
 tests/bugs/meson.build                  |    2 +
 tests/bugs/src/meson.build              |   25 ++++
 tests/empty/docs/meson.build            |  107 ++++++++++++++
 tests/empty/meson.build                 |    2 +
 tests/empty/src/meson.build             |   26 ++++
 tests/fail/docs/meson.build             |  107 ++++++++++++++
 tests/fail/meson.build                  |    2 +
 tests/fail/src/meson.build              |   25 ++++
 tests/gobject/docs/images/meson.build   |    3 +
 tests/gobject/docs/meson.build          |  126 +++++++++++++++++
 tests/gobject/meson.build               |    2 +
 tests/gobject/src/meson.build           |   30 ++++
 tests/helpers/gtkdoc_check_runner.py    |   30 ++++
 tests/helpers/gtkdoc_fixxref_runner.py  |   27 ++++
 tests/helpers/gtkdoc_mkdb_runner.py     |   27 ++++
 tests/helpers/gtkdoc_mkhtml_runner.py   |   38 +++++
 tests/helpers/gtkdoc_scan_runner.py     |   27 ++++
 tests/helpers/gtkdoc_scangobj_runner.py |   54 +++++++
 tests/helpers/meson.build               |    6 +
 tests/meson.build                       |   37 +++++
 tests/program/docs/meson.build          |  106 ++++++++++++++
 tests/program/meson.build               |    2 +
 tests/program/src/meson.build           |   10 ++
 tests/repro/docs/meson.build            |  106 ++++++++++++++
 tests/repro/meson.build                 |    2 +
 tests/repro/src/meson.build             |   25 ++++
 38 files changed, 1570 insertions(+), 0 deletions(-)
---
diff --git a/cmake/meson.build b/cmake/meson.build
new file mode 100644
index 0000000..b5efe28
--- /dev/null
+++ b/cmake/meson.build
@@ -0,0 +1,37 @@
+cmake_in = configuration_data()
+cmake_in.set('PACKAGE_VERSION', version)
+cmake_in.set('bindir', bindir)
+
+configure_file(
+  input: 'GtkDocConfig.cmake.in',
+  output: 'GtkDocConfig.cmake',
+  configuration: cmake_in,
+  install: true,
+  install_dir: join_paths(
+    cmakedatadir,
+    'GtkDoc',
+  )
+)
+
+configure_file(
+  input: 'GtkDocConfigVersion.cmake.in',
+  output: 'GtkDocConfigVersion.cmake',
+  configuration: cmake_in,
+  install: true,
+  install_dir: join_paths(
+    cmakedatadir,
+    'GtkDoc',
+  )
+)
+
+gtkdoc_cmake_data = [
+  'GtkDocScanGObjWrapper.cmake',
+]
+
+install_data(
+  gtkdoc_cmake_data,
+  install_dir: join_paths(
+    cmakedatadir,
+    'GtkDoc',
+  )
+)
\ No newline at end of file
diff --git a/gtkdoc-depscan.in b/gtkdoc-depscan.in
old mode 100644
new mode 100755
diff --git a/gtkdoc-mkhtml.in b/gtkdoc-mkhtml.in
old mode 100644
new mode 100755
diff --git a/gtkdoc-mkhtml2.in b/gtkdoc-mkhtml2.in
old mode 100644
new mode 100755
diff --git a/gtkdoc-mkman.in b/gtkdoc-mkman.in
old mode 100644
new mode 100755
diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in
old mode 100644
new mode 100755
diff --git a/gtkdoc/meson.build b/gtkdoc/meson.build
new file mode 100644
index 0000000..fac9d10
--- /dev/null
+++ b/gtkdoc/meson.build
@@ -0,0 +1,54 @@
+config_py = configuration_data()
+config_py.set('prefix', get_option('prefix'))
+config_py.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
+config_py.set('datadir', '${datarootdir}')
+
+config_py.set('DBLATEX', dblatex_prg_path)
+config_py.set('FOP', fop_prg_path)
+config_py.set('HIGHLIGHT', highlight_prg_path)
+config_py.set('HIGHLIGHT_OPTIONS', ' '.join(highlight_prg_args))
+config_py.set('PKG_CONFIG', pkgconfig_prg_path)
+config_py.set('XSLTPROC', xsltproc_prg_path)
+
+config_py.set('VERSION', version)
+config_py.set('EXEEXT', '')
+
+configure_file(
+  input: 'config.py.in',
+  output: 'config.py',
+  configuration: config_py,
+  install: true,
+  install_dir: join_paths(
+    pkgpythondir,
+    'gtkdoc',
+  ),
+)
+
+gtkdoc_sources = [
+  '__init__.py',
+  'check.py',
+  'common.py',
+  'fixxref.py',
+  'md_to_db.py',
+  'mkdb.py',
+  'mkhtml.py',
+  'mkhtml2.py',
+  'mkman.py',
+  'mkpdf.py',
+  'rebase.py',
+  'scan.py',
+  'scangobj.py',
+]
+
+custom_target(
+  'gtkdoc',
+  input: gtkdoc_sources,
+  output: gtkdoc_sources,
+  build_by_default: true,
+  command: ['cp', '-f', '@INPUT@', '@OUTDIR@'],
+  install: true,
+  install_dir: join_paths(
+    pkgpythondir,
+    'gtkdoc',
+  ),
+)
\ No newline at end of file
diff --git a/gtkdocize.in b/gtkdocize.in
old mode 100644
new mode 100755
diff --git a/help/manual/LINGUAS b/help/manual/LINGUAS
new file mode 100644
index 0000000..4b0e383
--- /dev/null
+++ b/help/manual/LINGUAS
@@ -0,0 +1,17 @@
+# Please keep this list sorted alphabetically.
+#
+bn_IN
+cs
+de
+el
+en_GB
+es
+fr
+gl
+gu
+pt_BR
+sl
+sv
+ta
+te
+zh_CN
\ No newline at end of file
diff --git a/help/manual/meson.build b/help/manual/meson.build
new file mode 100644
index 0000000..0dc4414
--- /dev/null
+++ b/help/manual/meson.build
@@ -0,0 +1,9 @@
+gtkdoc_help_sources = [
+  'index.docbook',
+  'fdl-appendix.xml',
+]
+
+gnome.yelp(
+  package_name,
+  sources: gtkdoc_help_sources,
+)
\ No newline at end of file
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..50b2c47
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,3 @@
+if get_option('yelp_manual') == true
+  subdir('manual')
+endif
\ No newline at end of file
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..6ffcd58
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,230 @@
+project('gtk-doc', 'c',
+  version: '1.28.1',
+  license: 'GPL2+',
+  meson_version: '>= 0.41.0',
+)
+
+gnome = import('gnome')
+python = import('python3')
+
+# Versioning
+version = meson.project_version()
+version_arr = version.split('.')
+version_major = version_arr[0].to_int()
+version_minor = version_arr[1].to_int()
+version_micro = version_arr[2].to_int()
+
+package_name = meson.project_name()
+
+# Paths
+srcdir = meson.source_root()
+builddir = meson.build_root()
+
+prefix = get_option('prefix')
+
+bindir = join_paths(prefix, get_option('bindir'))
+libdir = join_paths(prefix, get_option('libdir'))
+datadir = join_paths(prefix, get_option('datadir'))
+
+cmakedatadir = join_paths(libdir, 'cmake')
+
+autoconfdatadir = join_paths(datadir, 'aclocal')
+pkgdir = join_paths(datadir, package_name)
+pkgdatadir = join_paths(pkgdir, 'data')
+pkgpythondir = join_paths(pkgdir, 'python')
+pkgconfigdir = join_paths(datadir, 'pkgconfig')
+
+# Dependencies
+glib_req = '>= 2.38.0'
+python3_req = '>= 3.4.0'
+
+glib_dep = dependency('glib-2.0', version: glib_req)
+gobject_dep = dependency('gobject-2.0', version: glib_req)
+python3_dep = dependency('python3', version: python3_req)
+
+python_prg = python.find_python()
+
+pkgconfig_prg = find_program('pkg-config', required: true)
+xsltproc_prg = find_program('xsltproc', required: true)
+dblatex_prg = find_program('dblatex', required: false)
+fop_prg = find_program('fop', required: false)
+
+source_highlight_prg = find_program('source-highlight', required: false)
+highlight_prg = find_program('highlight', required: false)
+vim_prg = find_program('vim', required: false)
+
+python_prg_path = join_paths(python_prg.path())
+pkgconfig_prg_path = join_paths(pkgconfig_prg.path())
+xsltproc_prg_path = join_paths(xsltproc_prg.path())
+
+dblatex_prg_path = ''
+if dblatex_prg.found()
+  dblatex_prg_path = join_paths(dblatex_prg.path())
+endif
+
+fop_prg_path = ''
+if fop_prg.found()
+  fop_prg_path = join_paths(fop_prg.path())
+endif
+
+highlight_prg_path = ''
+highlight_prg_args = ''
+if source_highlight_prg.found()
+  highlight_prg_path = join_paths(source_highlight_prg.path())
+  highlight_prg_args = [
+    '-t4',
+    '-s$SRC_LANG',
+    '-cstyle.css',
+    '--no-doc',
+    '-i',
+  ]
+elif highlight_prg.found()
+  highlight_prg_path = join_paths(highlight_prg.path())
+  highlight_prg_args = [
+    '--syntax=$SRC_LANG',
+    '--out-format=xhtml',
+    '-f',
+    '--class-name=gtkdoc',
+  ]
+elif vim_prg.found()
+  highlight_prg_path = join_paths(vim_prg.path())
+endif
+
+# Options
+generate_pdf_output = true
+if not dblatex_prg.found() and not fop_prg.found()
+  generate_pdf_output = false
+endif
+
+# Code
+subdir('gtkdoc')
+
+gtkdoc_binaires = [
+  'gtkdoc-check',
+  'gtkdoc-depscan',
+  'gtkdoc-fixxref',
+  'gtkdoc-mkdb',
+  'gtkdoc-mkhtml',
+  'gtkdoc-mkhtml2',
+  'gtkdoc-mkman',
+  'gtkdoc-mkpdf',
+  'gtkdoc-rebase',
+  'gtkdoc-scan',
+  'gtkdoc-scangobj',
+  'gtkdocize',
+]
+
+binary_in = configuration_data()
+binary_in.set('PYTHON', python_prg_path)
+binary_in.set('PKG_CONFIG', pkgconfig_prg_path)
+
+binary_in.set('PYTHON_PACKAGE_DIR', pkgpythondir)
+
+binary_in.set('prefix', get_option('prefix'))
+binary_in.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
+binary_in.set('datadir', '${datarootdir}')
+
+binary_in.set('PACKAGE', package_name)
+
+binary_in.set('VERSION', version)
+
+foreach binary: gtkdoc_binaires
+  configure_file(
+    input: '@0@.in'.format(binary),
+    output: binary,
+    configuration: binary_in,
+    install: true,
+    install_dir: bindir,
+  )
+endforeach
+
+# Data
+gtkdoc_data = [
+  'devhelp2.xsd',
+  'devhelp2.xsl',
+  'gtk-doc.make',
+  'gtk-doc.xsl',
+  'version-greater-or-equal.xsl',
+]
+
+install_data(
+  gtkdoc_data,
+  install_dir: pkgdatadir,
+)
+
+custom_target(
+  'gtk-doc.flat.make',
+  input: 'gtk-doc.make',
+  output: 'gtk-doc.flat.make',
+  install: true,
+  install_dir: pkgdatadir,
+  capture: true,
+  command: [
+    'sed',
+    '-e',
+    's/EXTRA_DIST =/EXTRA_DIST +=/',
+    '@INPUT@',
+  ]
+)
+
+subdir('style')
+
+if get_option('autoconf_support') == true
+  custom_target(
+    'gtk-doc.m4',
+    input: 'gtk-doc.m4',
+    output: 'gtk-doc.m4',
+    install: true,
+    install_dir: autoconfdatadir,
+    command: [
+      'cp',
+      '-f',
+      '@INPUT@',
+      '@OUTPUT@',
+    ],
+  )
+endif
+
+if get_option('cmake_support') == true
+  subdir('cmake')
+endif
+
+gtkdoc_pc = configuration_data()
+gtkdoc_pc.set('prefix', prefix)
+gtkdoc_pc.set('exec_prefix', '${prefix}')
+gtkdoc_pc.set('datadir', join_paths('${prefix}', get_option('datadir')))
+
+gtkdoc_pc.set('PACKAGE', package_name)
+gtkdoc_pc.set('VERSION', version)
+
+configure_file(
+  input: 'gtk-doc.pc.in',
+  output: 'gtk-doc.pc',
+  configuration: gtkdoc_pc,
+  install: true,
+  install_dir: pkgconfigdir,
+)
+
+subdir('help')
+subdir('tests')
+
+summary = [
+  '',
+  '------',
+  'gtk-doc @0@'.format(version),
+  '',
+  'Directories:',
+  '             prefix: @0@'.format(prefix),
+  '             bindir: @0@'.format(bindir),
+  '             libdir: @0@'.format(libdir),
+  '            datadir: @0@'.format(datadir),
+  '',
+  'Configuration:',
+  '  Autotools support: @0@'.format(get_option('autoconf_support')),
+  '      CMake support: @0@'.format(get_option('cmake_support')),
+  '         PDF output: @0@'.format(generate_pdf_output),
+  '        User manual: @0@'.format(get_option('yelp_manual')),
+  '------',
+]
+
+message('\n'.join(summary))
\ No newline at end of file
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..8d24fda
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,9 @@
+option('autoconf_support',
+       type: 'boolean', value: true,
+       description: 'Install autotools macros')
+option('cmake_support',
+       type: 'boolean', value: true,
+       description: 'Install CMake macros')
+option('yelp_manual',
+       type: 'boolean', value: true,
+       description: 'Build the user manual (requires yelp-tools)')
\ No newline at end of file
diff --git a/style/meson.build b/style/meson.build
new file mode 100644
index 0000000..bb81b5f
--- /dev/null
+++ b/style/meson.build
@@ -0,0 +1,15 @@
+gtkdoc_style_data = [
+  'home.png',
+  'left.png',
+  'left-insensitive.png',
+  'right.png',
+  'right-insensitive.png',
+  'style.css',
+  'up.png',
+  'up-insensitive.png',
+]
+
+install_data(
+  gtkdoc_style_data,
+  install_dir: pkgdatadir,
+)
\ No newline at end of file
diff --git a/tests/annotations/docs/meson.build b/tests/annotations/docs/meson.build
new file mode 100644
index 0000000..2ec4b8f
--- /dev/null
+++ b/tests/annotations/docs/meson.build
@@ -0,0 +1,107 @@
+annotations_test_source_dir = join_paths(
+  srcdir,
+  'tests',
+  'annotations',
+  'src'
+)
+
+annotations_test_docs_dir = join_paths(
+  srcdir,
+  'tests',
+  'annotations',
+  'docs'
+)
+
+annotations_test_output_dir = join_paths(
+  builddir,
+  'tests',
+  'annotations',
+  'docs'
+)
+
+annotations_test_html_data = []
+
+test(
+  'test-annotations-scan',
+  python_prg,
+  workdir: annotations_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scan_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(annotations_test_output_dir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(annotations_test_source_dir),
+    '--ignore-headers=config.h',
+    '--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
+    '--ignore-decorators=GLIB_VAR',
+  ],
+)
+
+test(
+  'test-annotations-mkdb',
+  python_prg,
+  workdir: annotations_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkdb_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(annotations_test_source_dir),
+    '--main-sgml-file=@0@'.format('tester-docs.xml'),
+    '--output-format=xml',
+    '--xml-mode',
+  ],
+)
+
+foreach style_data: gtkdoc_style_data
+  annotations_test_html_data += join_paths(srcdir, 'style', style_data)
+endforeach
+
+test(
+  'test-annotations-mkhtml',
+  python_prg,
+  workdir: annotations_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkhtml_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(join_paths(annotations_test_output_dir, 'html')),
+    '--html-assets=@0@'.format('@@'.join(annotations_test_html_data)),
+    '@0@'.format('tester'),
+    '@0@'.format(join_paths('..', 'tester-docs.xml')),
+    '--uninstalled',
+    '--path=@0@'.format(':'.join([
+      annotations_test_docs_dir,
+      srcdir])
+    ),
+  ],
+)
+
+test(
+  'test-annotations-fixxref',
+  python_prg,
+  workdir: annotations_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_fixxref_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--module-dir=@0@'.format('html'),
+    '--extra-dir=@0@'.format(glib_docpath),
+    '--extra-dir=@0@'.format(gobject_docpath),
+  ],
+)
+
+test(
+  'test-annotations-check',
+  python_prg,
+  workdir: annotations_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_check_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--input-dir=@0@'.format(annotations_test_docs_dir),
+    '--output-dir=@0@'.format(annotations_test_output_dir),
+  ],
+)
\ No newline at end of file
diff --git a/tests/annotations/meson.build b/tests/annotations/meson.build
new file mode 100644
index 0000000..dc00692
--- /dev/null
+++ b/tests/annotations/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('docs')
\ No newline at end of file
diff --git a/tests/annotations/src/meson.build b/tests/annotations/src/meson.build
new file mode 100644
index 0000000..076bdf2
--- /dev/null
+++ b/tests/annotations/src/meson.build
@@ -0,0 +1,26 @@
+annotations_test_public_h = [
+  'tester.h',
+]
+
+annotations_test_c = [
+  'tester.c',
+]
+
+annotations_test_deps = [
+  glib_dep,
+  gobject_dep,
+]
+
+annotations_test_lib = shared_library(
+  'annotationstester',
+  sources: annotations_test_c,
+  dependencies: annotations_test_deps,
+  install: false,
+)
+
+annotations_test_dep = declare_dependency(
+  link_with: annotations_test_lib,
+  include_directories: include_directories('.'),
+  dependencies: annotations_test_deps,
+  sources: annotations_test_public_h,
+)
\ No newline at end of file
diff --git a/tests/bugs/docs/meson.build b/tests/bugs/docs/meson.build
new file mode 100644
index 0000000..567fb4f
--- /dev/null
+++ b/tests/bugs/docs/meson.build
@@ -0,0 +1,107 @@
+bugs_test_source_dir = join_paths(
+  srcdir,
+  'tests',
+  'bugs',
+  'src'
+)
+
+bugs_test_docs_dir = join_paths(
+  srcdir,
+  'tests',
+  'bugs',
+  'docs'
+)
+
+bugs_test_output_dir = join_paths(
+  builddir,
+  'tests',
+  'bugs',
+  'docs'
+)
+
+bugs_test_html_data = []
+
+test(
+  'test-bugs-scan',
+  python_prg,
+  workdir: bugs_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scan_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(bugs_test_output_dir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(bugs_test_source_dir),
+    '--ignore-headers=config.h',
+    '--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
+    '--ignore-decorators=GLIB_VAR|GTKDOC_GNUC_CONST|BUG_711598_DEPRECATED_FOR\(.+\)',
+    '--rebuild-types',
+  ],
+)
+
+test(
+  'test-bugs-mkdb',
+  python_prg,
+  workdir: bugs_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkdb_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(bugs_test_source_dir),
+    '--main-sgml-file=@0@'.format('tester-docs.xml'),
+    '--output-format=xml',
+    '--xml-mode',
+  ],
+)
+
+foreach style_data: gtkdoc_style_data
+  bugs_test_html_data += join_paths(srcdir, 'style', style_data)
+endforeach
+
+test(
+  'test-bugs-mkhtml',
+  python_prg,
+  workdir: bugs_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkhtml_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(join_paths(bugs_test_output_dir, 'html')),
+    '--html-assets=@0@'.format('@@'.join(bugs_test_html_data)),
+    '@0@'.format('tester'),
+    '@0@'.format(join_paths('..', 'tester-docs.xml')),
+    '--uninstalled',
+    '--path=@0@'.format(':'.join([
+      bugs_test_docs_dir,
+      srcdir])
+    ),
+  ],
+)
+
+test(
+  'test-bugs-fixxref',
+  python_prg,
+  workdir: bugs_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_fixxref_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--module-dir=@0@'.format('.'),
+    '--extra-dir=@0@'.format(glib_docpath),
+  ],
+)
+
+test(
+  'test-bugs-check',
+  python_prg,
+  workdir: bugs_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_check_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--input-dir=@0@'.format(bugs_test_docs_dir),
+    '--output-dir=@0@'.format(bugs_test_output_dir),
+  ],
+)
\ No newline at end of file
diff --git a/tests/bugs/meson.build b/tests/bugs/meson.build
new file mode 100644
index 0000000..dc00692
--- /dev/null
+++ b/tests/bugs/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('docs')
\ No newline at end of file
diff --git a/tests/bugs/src/meson.build b/tests/bugs/src/meson.build
new file mode 100644
index 0000000..a1c3992
--- /dev/null
+++ b/tests/bugs/src/meson.build
@@ -0,0 +1,25 @@
+bugs_test_public_h = [
+  'tester.h',
+]
+
+bugs_test_c = [
+  'tester.c',
+]
+
+bugs_test_deps = [
+  glib_dep,
+]
+
+bugs_test_lib = shared_library(
+  'bugstester',
+  sources: bugs_test_c,
+  dependencies: bugs_test_deps,
+  install: false,
+)
+
+bugs_test_dep = declare_dependency(
+  link_with: bugs_test_lib,
+  include_directories: include_directories('.'),
+  dependencies: bugs_test_deps,
+  sources: bugs_test_public_h,
+)
\ No newline at end of file
diff --git a/tests/empty/docs/meson.build b/tests/empty/docs/meson.build
new file mode 100644
index 0000000..f05939c
--- /dev/null
+++ b/tests/empty/docs/meson.build
@@ -0,0 +1,107 @@
+empty_test_source_dir = join_paths(
+  srcdir,
+  'tests',
+  'empty',
+  'src'
+)
+
+empty_test_docs_dir = join_paths(
+  srcdir,
+  'tests',
+  'empty',
+  'docs'
+)
+
+empty_test_output_dir = join_paths(
+  builddir,
+  'tests',
+  'empty',
+  'docs'
+)
+
+empty_test_html_data = []
+
+test(
+  'test-empty-scan',
+  python_prg,
+  workdir: empty_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scan_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(empty_test_output_dir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(empty_test_source_dir),
+    '--ignore-headers=config.h',
+    '--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
+    '--rebuild-sections',
+  ],
+)
+
+test(
+  'test-empty-mkdb',
+  python_prg,
+  workdir: empty_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkdb_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(empty_test_source_dir),
+    '--main-sgml-file=@0@'.format('tester-docs.xml'),
+    '--output-format=xml',
+    '--xml-mode',
+  ],
+)
+
+foreach style_data: gtkdoc_style_data
+  empty_test_html_data += join_paths(srcdir, 'style', style_data)
+endforeach
+
+test(
+  'test-empty-mkhtml',
+  python_prg,
+  workdir: empty_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkhtml_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(join_paths(empty_test_output_dir, 'html')),
+    '--html-assets=@0@'.format('@@'.join(empty_test_html_data)),
+    '@0@'.format('tester'),
+    '@0@'.format(join_paths('..', 'tester-docs.xml')),
+    '--uninstalled',
+    '--path=@0@'.format(':'.join([
+      empty_test_docs_dir,
+      srcdir])
+    ),
+  ],
+)
+
+test(
+  'test-empty-fixxref',
+  python_prg,
+  workdir: empty_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_fixxref_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--module-dir=@0@'.format('html'),
+    '--extra-dir=@0@'.format(glib_docpath),
+    '--extra-dir=@0@'.format(gobject_docpath),
+  ],
+)
+
+test(
+  'test-empty-check',
+  python_prg,
+  workdir: empty_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_check_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--input-dir=@0@'.format(empty_test_docs_dir),
+    '--output-dir=@0@'.format(empty_test_output_dir),
+  ],
+)
\ No newline at end of file
diff --git a/tests/empty/meson.build b/tests/empty/meson.build
new file mode 100644
index 0000000..dc00692
--- /dev/null
+++ b/tests/empty/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('docs')
\ No newline at end of file
diff --git a/tests/empty/src/meson.build b/tests/empty/src/meson.build
new file mode 100644
index 0000000..881af67
--- /dev/null
+++ b/tests/empty/src/meson.build
@@ -0,0 +1,26 @@
+empty_test_public_h = [
+  'tester.h',
+]
+
+empty_test_c = [
+  'tester.c',
+]
+
+empty_test_deps = [
+  glib_dep,
+  gobject_dep,
+]
+
+empty_test_lib = shared_library(
+  'emptytester',
+  sources: empty_test_c,
+  dependencies: empty_test_deps,
+  install: false,
+)
+
+empty_test_dep = declare_dependency(
+  link_with: empty_test_lib,
+  include_directories: include_directories('.'),
+  dependencies: empty_test_deps,
+  sources: empty_test_public_h,
+)
\ No newline at end of file
diff --git a/tests/fail/docs/meson.build b/tests/fail/docs/meson.build
new file mode 100644
index 0000000..8a5b9c2
--- /dev/null
+++ b/tests/fail/docs/meson.build
@@ -0,0 +1,107 @@
+fail_test_source_dir = join_paths(
+  srcdir,
+  'tests',
+  'fail',
+  'src'
+)
+
+fail_test_docs_dir = join_paths(
+  srcdir,
+  'tests',
+  'fail',
+  'docs'
+)
+
+fail_test_output_dir = join_paths(
+  builddir,
+  'tests',
+  'fail',
+  'docs'
+)
+
+fail_test_html_data = []
+
+test(
+  'test-fail-scan',
+  python_prg,
+  workdir: fail_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scan_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(fail_test_output_dir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(fail_test_source_dir),
+    '--ignore-headers=config.h',
+    '--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
+    '--ignore-decorators=GLIB_VAR',
+  ],
+)
+
+test(
+  'test-fail-mkdb',
+  python_prg,
+  workdir: fail_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkdb_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(fail_test_source_dir),
+    '--main-sgml-file=@0@'.format('tester-docs.xml'),
+    '--output-format=xml',
+    '--xml-mode',
+  ],
+)
+
+foreach style_data: gtkdoc_style_data
+  fail_test_html_data += join_paths(srcdir, 'style', style_data)
+endforeach
+
+test(
+  'test-fail-mkhtml',
+  python_prg,
+  workdir: fail_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkhtml_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(join_paths(fail_test_output_dir, 'html')),
+    '--html-assets=@0@'.format('@@'.join(fail_test_html_data)),
+    '@0@'.format('tester'),
+    '@0@'.format(join_paths('..', 'tester-docs.xml')),
+    '--uninstalled',
+    '--path=@0@'.format(':'.join([
+      fail_test_docs_dir,
+      srcdir])
+    ),
+  ],
+)
+
+test(
+  'test-fail-fixxref',
+  python_prg,
+  workdir: fail_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_fixxref_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--module-dir=@0@'.format('html'),
+    '--extra-dir=@0@'.format(glib_docpath),
+  ],
+)
+
+test(
+  'test-fail-check',
+  python_prg,
+  workdir: fail_test_docs_dir,
+  is_parallel: false,
+  should_fail: true,
+  args: [
+    gtkdoc_check_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--input-dir=@0@'.format(fail_test_docs_dir),
+    '--output-dir=@0@'.format(fail_test_output_dir),
+  ],
+)
\ No newline at end of file
diff --git a/tests/fail/meson.build b/tests/fail/meson.build
new file mode 100644
index 0000000..dc00692
--- /dev/null
+++ b/tests/fail/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('docs')
\ No newline at end of file
diff --git a/tests/fail/src/meson.build b/tests/fail/src/meson.build
new file mode 100644
index 0000000..8b0fd4c
--- /dev/null
+++ b/tests/fail/src/meson.build
@@ -0,0 +1,25 @@
+fail_test_public_h = [
+  'tester.h',
+]
+
+fail_test_c = [
+  'tester.c',
+]
+
+fail_test_deps = [
+  glib_dep,
+]
+
+fail_test_lib = shared_library(
+  'failtester',
+  sources: fail_test_c,
+  dependencies: fail_test_deps,
+  install: false,
+)
+
+fail_test_dep = declare_dependency(
+  link_with: fail_test_lib,
+  include_directories: include_directories('.'),
+  dependencies: fail_test_deps,
+  sources: fail_test_public_h,
+)
\ No newline at end of file
diff --git a/tests/gobject/docs/images/meson.build b/tests/gobject/docs/images/meson.build
new file mode 100644
index 0000000..ee2da70
--- /dev/null
+++ b/tests/gobject/docs/images/meson.build
@@ -0,0 +1,3 @@
+gobject_test_html_data += [
+  join_paths(srcdir, 'tests', 'gobject', 'docs', 'images', 'object.png')
+]
\ No newline at end of file
diff --git a/tests/gobject/docs/meson.build b/tests/gobject/docs/meson.build
new file mode 100644
index 0000000..5a05e30
--- /dev/null
+++ b/tests/gobject/docs/meson.build
@@ -0,0 +1,126 @@
+gobject_test_source_dir = join_paths(
+  srcdir,
+  'tests',
+  'gobject',
+  'src'
+)
+
+gobject_test_docs_dir = join_paths(
+  srcdir,
+  'tests',
+  'gobject',
+  'docs'
+)
+
+gobject_test_output_dir = join_paths(
+  builddir,
+  'tests',
+  'gobject',
+  'docs'
+)
+
+gobject_test_html_data = []
+
+test(
+  'test-gobject-scan',
+  python_prg,
+  workdir: gobject_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scan_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(gobject_test_output_dir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(gobject_test_source_dir),
+    '--ignore-headers=config.h',
+    '--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
+    '--rebuild-types',
+  ],
+)
+
+test(
+  'test-gobject-scangobj',
+  python_prg,
+  workdir: gobject_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scangobj_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--pkg-config=@0@'.format(pkgconfig_prg_path),
+    '--extra-pkg=@0@'.format('glib-2.0'),
+    '--extra-pkg=@0@'.format('gobject-2.0'),
+    '--extra-lib=@0@'.format(gobject_test_lib.full_path()),
+    '--module=@0@'.format('tester'),
+  ],
+)
+
+test(
+  'test-gobject-mkdb',
+  python_prg,
+  workdir: gobject_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkdb_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(gobject_test_source_dir),
+    '--main-sgml-file=@0@'.format('tester-docs.xml'),
+    '--output-format=xml',
+    '--xml-mode',
+  ],
+)
+
+foreach style_data: gtkdoc_style_data
+  gobject_test_html_data += join_paths(srcdir, 'style', style_data)
+endforeach
+
+subdir('images') # Appends to gobject_test_html_data
+
+test(
+  'test-gobject-mkhtml',
+  python_prg,
+  workdir: gobject_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkhtml_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(join_paths(gobject_test_output_dir, 'html')),
+    '--html-assets=@0@'.format('@@'.join(gobject_test_html_data)),
+    '@0@'.format('tester'),
+    '@0@'.format(join_paths('..', 'tester-docs.xml')),
+    '--uninstalled',
+    '--path=@0@'.format(':'.join([
+      gobject_test_docs_dir,
+      srcdir,
+      ])
+    ),
+  ],
+)
+
+test(
+  'test-gobject-fixxref',
+  python_prg,
+  workdir: gobject_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_fixxref_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--module-dir=@0@'.format('html'),
+    '--extra-dir=@0@'.format(glib_docpath),
+    '--extra-dir=@0@'.format(gobject_docpath),
+  ],
+)
+
+test(
+  'test-gobject-check',
+  python_prg,
+  workdir: gobject_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_check_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--input-dir=@0@'.format(gobject_test_docs_dir),
+    '--output-dir=@0@'.format(gobject_test_output_dir),
+  ],
+)
\ No newline at end of file
diff --git a/tests/gobject/meson.build b/tests/gobject/meson.build
new file mode 100644
index 0000000..dc00692
--- /dev/null
+++ b/tests/gobject/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('docs')
\ No newline at end of file
diff --git a/tests/gobject/src/meson.build b/tests/gobject/src/meson.build
new file mode 100644
index 0000000..aa1d4e4
--- /dev/null
+++ b/tests/gobject/src/meson.build
@@ -0,0 +1,30 @@
+gobject_test_public_h = [
+  'giface.h',
+  'gobject.h',
+  'gtypes.h',
+]
+
+gobject_test_c = [
+  'giface.c',
+  'gobject.c',
+  'gtypes.c',
+]
+
+gobject_test_deps = [
+  glib_dep,
+  gobject_dep,
+]
+
+gobject_test_lib = shared_library(
+  'gobjecttester',
+  sources: gobject_test_c,
+  dependencies: gobject_test_deps,
+  install: false,
+)
+
+gobject_test_dep = declare_dependency(
+  link_with: gobject_test_lib,
+  include_directories: include_directories('.'),
+  dependencies: gobject_test_deps,
+  sources: gobject_test_public_h,
+)
\ No newline at end of file
diff --git a/tests/helpers/gtkdoc_check_runner.py b/tests/helpers/gtkdoc_check_runner.py
new file mode 100644
index 0000000..e2d188b
--- /dev/null
+++ b/tests/helpers/gtkdoc_check_runner.py
@@ -0,0 +1,30 @@
+# -*- python -*-
+
+from __future__ import print_function
+
+import argparse
+import os
+import sys
+
+from subprocess import call
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='gtkdoc-check runner.')
+
+    parser.add_argument("--binary-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--input-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--output-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+
+    options, arguments = parser.parse_known_args()
+
+    arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-check'))
+
+    environ = os.environ.copy()
+
+    environ['SRCDIR'] = options.input_dir
+    environ['BUILDDIR'] = options.output_dir
+
+    sys.exit(call(arguments, env=environ))
\ No newline at end of file
diff --git a/tests/helpers/gtkdoc_fixxref_runner.py b/tests/helpers/gtkdoc_fixxref_runner.py
new file mode 100644
index 0000000..7cb233b
--- /dev/null
+++ b/tests/helpers/gtkdoc_fixxref_runner.py
@@ -0,0 +1,27 @@
+# -*- python -*-
+
+from __future__ import print_function
+
+import argparse
+import os
+import sys
+
+from subprocess import call
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='gtkdoc-fixxref runner.')
+
+    parser.add_argument("--binary-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--change-dir", type=str, default=None,
+                        help='Path to the gtkdoc executables directory to be used')
+
+    options, arguments = parser.parse_known_args()
+
+    arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-fixxref'))
+
+    if not options.change_dir is None:
+        if not os.path.exists(options.change_dir):
+            os.makedirs(options.change_dir)
+
+    sys.exit(call(arguments, cwd=options.change_dir))
\ No newline at end of file
diff --git a/tests/helpers/gtkdoc_mkdb_runner.py b/tests/helpers/gtkdoc_mkdb_runner.py
new file mode 100644
index 0000000..1e6983f
--- /dev/null
+++ b/tests/helpers/gtkdoc_mkdb_runner.py
@@ -0,0 +1,27 @@
+# -*- python -*-
+
+from __future__ import print_function
+
+import argparse
+import os
+import sys
+
+from subprocess import call
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='gtkdoc-mkdb runner.')
+
+    parser.add_argument("--binary-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--change-dir", type=str, default=None,
+                        help='Path to the gtkdoc executables directory to be used')
+
+    options, arguments = parser.parse_known_args()
+
+    arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-mkdb'))
+
+    if not options.change_dir is None:
+        if not os.path.exists(options.change_dir):
+            os.makedirs(options.change_dir)
+
+    sys.exit(call(arguments, cwd=options.change_dir))
\ No newline at end of file
diff --git a/tests/helpers/gtkdoc_mkhtml_runner.py b/tests/helpers/gtkdoc_mkhtml_runner.py
new file mode 100644
index 0000000..2c48d7b
--- /dev/null
+++ b/tests/helpers/gtkdoc_mkhtml_runner.py
@@ -0,0 +1,38 @@
+# -*- python -*-
+
+from __future__ import print_function
+
+import argparse
+import os
+import shutil
+import sys
+
+from subprocess import call
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='gtkdoc-mkhtml runner.')
+
+    parser.add_argument("--binary-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--change-dir", type=str, default=None,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--html-assets", type=str, default=None,
+                        help='List of HTML assets, seprated by "@@"')
+
+    options, arguments = parser.parse_known_args()
+
+    arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-mkhtml'))
+
+    if not options.change_dir is None:
+        if not os.path.exists(options.change_dir):
+            os.makedirs(options.change_dir)
+
+    if not options.html_assets is None:
+        for html_asset in options.html_assets.split('@@'):
+            if not options.change_dir is None:
+                html_target = os.path.join(options.change_dir, os.path.basename(html_asset))
+            else:
+                html_target = os.path.join(os.getcwd(), os.path.basename(html_asset))
+            shutil.copyfile(html_asset, html_target)
+
+    sys.exit(call(arguments, cwd=options.change_dir))
\ No newline at end of file
diff --git a/tests/helpers/gtkdoc_scan_runner.py b/tests/helpers/gtkdoc_scan_runner.py
new file mode 100644
index 0000000..c757ce8
--- /dev/null
+++ b/tests/helpers/gtkdoc_scan_runner.py
@@ -0,0 +1,27 @@
+# -*- python -*-
+
+from __future__ import print_function
+
+import argparse
+import os
+import sys
+
+from subprocess import call
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='gtkdoc-scan runner.')
+
+    parser.add_argument("--binary-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--change-dir", type=str, default=None,
+                        help='Path to the gtkdoc executables directory to be used')
+
+    options, arguments = parser.parse_known_args()
+
+    arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-scan'))
+
+    if not options.change_dir is None:
+        if not os.path.exists(options.change_dir):
+            os.makedirs(options.change_dir)
+
+    sys.exit(call(arguments, cwd=options.change_dir))
\ No newline at end of file
diff --git a/tests/helpers/gtkdoc_scangobj_runner.py b/tests/helpers/gtkdoc_scangobj_runner.py
new file mode 100644
index 0000000..e01d027
--- /dev/null
+++ b/tests/helpers/gtkdoc_scangobj_runner.py
@@ -0,0 +1,54 @@
+# -*- python -*-
+
+from __future__ import print_function
+
+import argparse
+import os
+import sys
+
+from subprocess import call, PIPE, Popen
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='gtkdoc-scangobj runner.')
+
+    parser.add_argument("--binary-dir", type=str, required=True,
+                        help='Path to the gtkdoc executables directory to be used')
+    parser.add_argument("--pkg-config", type=str, required=True,
+                        help='Path to the pkg-config executable to be used')
+    parser.add_argument("--extra-pkg", type=str, default=[], action='append',
+                        help='Extra package to be use while scanning')
+    parser.add_argument("--extra-lib", type=str, default=[], action='append',
+                        help='Extra library to be use while scanning')
+
+    options, arguments = parser.parse_known_args()
+
+    arguments.insert(0, os.path.join(options.binary_dir, 'gtkdoc-scangobj'))
+
+    process = Popen([options.pkg_config,
+                    '--cflags'] + options.extra_pkg,
+                    stdout=PIPE, stderr=PIPE)
+
+    cflags = []
+    output, error = process.communicate()
+    if process.returncode == 0:
+        cflags += output.rstrip().decode('utf-8').split(' ')
+
+    arguments.append('--cflags={0}'.format(' '.join(cflags)))
+
+    process = Popen([options.pkg_config,
+                    '--libs'] + options.extra_pkg,
+                    stdout=PIPE, stderr=PIPE)
+
+    libs = []
+    output, error = process.communicate()
+    if process.returncode == 0:
+        libs += output.rstrip().decode('utf-8').split(' ')
+
+    for lib in options.extra_lib:
+        libs.append('-l{0}'.format(os.path.basename(lib).split('.')[0].lstrip('lib')))
+        libs.append('-L{0}'.format(os.path.dirname(lib)))
+        libs.append('-Wl,-rpath,{0}'.format(os.path.dirname(lib)))
+
+    arguments.append('--ldflags={0}'.format(' '.join(libs)))
+
+    sys.exit(call(arguments))
\ No newline at end of file
diff --git a/tests/helpers/meson.build b/tests/helpers/meson.build
new file mode 100644
index 0000000..7e0123e
--- /dev/null
+++ b/tests/helpers/meson.build
@@ -0,0 +1,6 @@
+gtkdoc_scan_runner_script = files('gtkdoc_scan_runner.py')
+gtkdoc_scangobj_runner_script = files('gtkdoc_scangobj_runner.py')
+gtkdoc_mkdb_runner_script = files('gtkdoc_mkdb_runner.py')
+gtkdoc_mkhtml_runner_script = files('gtkdoc_mkhtml_runner.py')
+gtkdoc_fixxref_runner_script = files('gtkdoc_fixxref_runner.py')
+gtkdoc_check_runner_script = files('gtkdoc_check_runner.py')
\ No newline at end of file
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..0ea0a41
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,37 @@
+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')
+
+gtkdoc_unit_tests = [
+  'check',
+  'common',
+  'mk-to-db',
+  'mkhtml2',
+]
+
+foreach test_name: gtkdoc_unit_tests
+  test(
+    'test-unit-@0@'.format(test_name),
+    python_prg,
+    env: ['PYTHONPATH=@0@'.format(builddir)],
+    args: [
+      join_paths(
+        srcdir,
+        'tests',
+        '@0@.py'.format(test_name.underscorify()),
+      )
+    ],
+  )
+endforeach
+
+subdir('helpers')
+
+subdir('annotations')
+subdir('bugs')
+subdir('empty')
+subdir('fail')
+subdir('gobject')
+subdir('program')
+subdir('repro')
\ No newline at end of file
diff --git a/tests/program/docs/meson.build b/tests/program/docs/meson.build
new file mode 100644
index 0000000..1520e7e
--- /dev/null
+++ b/tests/program/docs/meson.build
@@ -0,0 +1,106 @@
+program_test_source_dir = join_paths(
+  srcdir,
+  'tests',
+  'program',
+  'src'
+)
+
+program_test_docs_dir = join_paths(
+  srcdir,
+  'tests',
+  'program',
+  'docs'
+)
+
+program_test_output_dir = join_paths(
+  builddir,
+  'tests',
+  'program',
+  'docs'
+)
+
+program_test_html_data = []
+
+test(
+  'test-program-scan',
+  python_prg,
+  workdir: program_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scan_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(program_test_output_dir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(program_test_source_dir),
+    '--ignore-headers=config.h',
+    '--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
+    '--rebuild-types',
+  ],
+)
+
+test(
+  'test-program-mkdb',
+  python_prg,
+  workdir: program_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkdb_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(program_test_source_dir),
+    '--main-sgml-file=@0@'.format('tester-docs.xml'),
+    '--output-format=xml',
+    '--xml-mode',
+  ],
+)
+
+foreach style_data: gtkdoc_style_data
+  program_test_html_data += join_paths(srcdir, 'style', style_data)
+endforeach
+
+test(
+  'test-program-mkhtml',
+  python_prg,
+  workdir: program_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkhtml_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(join_paths(program_test_output_dir, 'html')),
+    '--html-assets=@0@'.format('@@'.join(program_test_html_data)),
+    '@0@'.format('tester'),
+    '@0@'.format(join_paths('..', 'tester-docs.xml')),
+    '--uninstalled',
+    '--path=@0@'.format(':'.join([
+      program_test_docs_dir,
+      srcdir])
+    ),
+  ],
+)
+
+test(
+  'test-program-fixxref',
+  python_prg,
+  workdir: program_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_fixxref_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--module-dir=@0@'.format('html'),
+    '--extra-dir=@0@'.format(glib_docpath),
+  ],
+)
+
+test(
+  'test-program-check',
+  python_prg,
+  workdir: program_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_check_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--input-dir=@0@'.format(program_test_docs_dir),
+    '--output-dir=@0@'.format(program_test_output_dir),
+  ],
+)
\ No newline at end of file
diff --git a/tests/program/meson.build b/tests/program/meson.build
new file mode 100644
index 0000000..dc00692
--- /dev/null
+++ b/tests/program/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('docs')
\ No newline at end of file
diff --git a/tests/program/src/meson.build b/tests/program/src/meson.build
new file mode 100644
index 0000000..02b8bbc
--- /dev/null
+++ b/tests/program/src/meson.build
@@ -0,0 +1,10 @@
+
+program_test_c = [
+  'test-program.c',
+]
+
+program_test_lib = executable(
+  'programtester',
+  sources: program_test_c,
+  install: false,
+)
\ No newline at end of file
diff --git a/tests/repro/docs/meson.build b/tests/repro/docs/meson.build
new file mode 100644
index 0000000..08a0f08
--- /dev/null
+++ b/tests/repro/docs/meson.build
@@ -0,0 +1,106 @@
+repro_test_source_dir = join_paths(
+  srcdir,
+  'tests',
+  'repro',
+  'src'
+)
+
+repro_test_docs_dir = join_paths(
+  srcdir,
+  'tests',
+  'repro',
+  'docs'
+)
+
+repro_test_output_dir = join_paths(
+  builddir,
+  'tests',
+  'repro',
+  'docs'
+)
+
+repro_test_html_data = []
+
+test(
+  'test-repro-scan',
+  python_prg,
+  workdir: repro_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_scan_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(repro_test_output_dir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(repro_test_source_dir),
+    '--ignore-headers=config.h',
+    '--rebuild-sections',
+    '--rebuild-types',
+  ],
+)
+
+test(
+  'test-repro-mkdb',
+  python_prg,
+  workdir: repro_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkdb_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--source-dir=@0@'.format(repro_test_source_dir),
+    '--main-sgml-file=@0@'.format('tester-docs.xml'),
+    '--output-format=xml',
+    '--xml-mode',
+  ],
+)
+
+foreach style_data: gtkdoc_style_data
+  repro_test_html_data += join_paths(srcdir, 'style', style_data)
+endforeach
+
+test(
+  'test-repro-mkhtml',
+  python_prg,
+  workdir: repro_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_mkhtml_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--change-dir=@0@'.format(join_paths(repro_test_output_dir, 'html')),
+    '--html-assets=@0@'.format('@@'.join(repro_test_html_data)),
+    '@0@'.format('tester'),
+    '@0@'.format(join_paths('..', 'tester-docs.xml')),
+    '--uninstalled',
+    '--path=@0@'.format(':'.join([
+      repro_test_docs_dir,
+      srcdir])
+    ),
+  ],
+)
+
+test(
+  'test-repro-fixxref',
+  python_prg,
+  workdir: repro_test_output_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_fixxref_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--module=@0@'.format('tester'),
+    '--module-dir=@0@'.format('html'),
+    '--extra-dir=@0@'.format(glib_docpath),
+  ],
+)
+
+test(
+  'test-repro-check',
+  python_prg,
+  workdir: repro_test_docs_dir,
+  is_parallel: false,
+  args: [
+    gtkdoc_check_runner_script,
+    '--binary-dir=@0@'.format(builddir),
+    '--input-dir=@0@'.format(repro_test_docs_dir),
+    '--output-dir=@0@'.format(repro_test_output_dir),
+  ],
+)
\ No newline at end of file
diff --git a/tests/repro/meson.build b/tests/repro/meson.build
new file mode 100644
index 0000000..dc00692
--- /dev/null
+++ b/tests/repro/meson.build
@@ -0,0 +1,2 @@
+subdir('src')
+subdir('docs')
\ No newline at end of file
diff --git a/tests/repro/src/meson.build b/tests/repro/src/meson.build
new file mode 100644
index 0000000..a3e12e3
--- /dev/null
+++ b/tests/repro/src/meson.build
@@ -0,0 +1,25 @@
+repro_test_public_h = [
+  'tester.h',
+]
+
+repro_test_c = [
+  'tester.c',
+]
+
+repro_test_deps = [
+  glib_dep,
+]
+
+repro_test_lib = shared_library(
+  'reprotester',
+  sources: repro_test_c,
+  dependencies: repro_test_deps,
+  install: false,
+)
+
+repro_test_dep = declare_dependency(
+  link_with: repro_test_lib,
+  include_directories: include_directories('.'),
+  dependencies: repro_test_deps,
+  sources: repro_test_public_h,
+)
\ No newline at end of file



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]