[vala/wip/meson] meson: Add valadoc tests



commit 9c2dc89ad9ce4e27c8d3b84530da13994b9c3a8b
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Feb 11 13:51:39 2019 +0100

    meson: Add valadoc tests

 valadoc/meson.build       |  1 +
 valadoc/tests/meson.build | 70 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+)
---
diff --git a/valadoc/meson.build b/valadoc/meson.build
index 999c75d7b..b731dc2da 100644
--- a/valadoc/meson.build
+++ b/valadoc/meson.build
@@ -21,3 +21,4 @@ meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ vala
 
 subdir('doclets')
 subdir('icons')
+subdir('tests')
diff --git a/valadoc/tests/meson.build b/valadoc/tests/meson.build
new file mode 100644
index 000000000..42b51a7d2
--- /dev/null
+++ b/valadoc/tests/meson.build
@@ -0,0 +1,70 @@
+test_cases = [
+       'libvaladoc/errorreporter.vala',
+       'libvaladoc/markupreader.vala',
+       'libvaladoc/gtkdoc-scanner.vala',
+       'libvaladoc/parser/manyrule.vala',
+       'libvaladoc/parser/oneofrule.vala',
+       'libvaladoc/parser/sequencerule.vala',
+       'libvaladoc/parser/optionalrule.vala',
+       'libvaladoc/parser/stubrule.vala',
+]
+
+vala_flags = [
+       '-X', '-DTOP_SRC_DIR="@0@"'.format(meson.source_root()),
+       '--vapidir', join_paths(meson.source_root(), 'vapi'),
+       '--pkg', 'gio-2.0',
+       '--disable-warnings',
+       '--main', 'main', '--save-temps',
+       '--cc', cc.cmd_array()[-1],
+       '-X', '-g',
+       '-X', '-O0',
+       '-X', '-pipe',
+       '-X', '-lm',
+       '--pkg', 'libgvc',
+       '--vapidir', join_paths(meson.build_root(), 'vala'),
+       '--pkg', 'libvala@0@'.format(vala_version_suffix),
+       '--vapidir', join_paths(meson.build_root(), 'libvaladoc'),
+       '--pkg', 'valadoc@0@'.format(vala_version_suffix),
+       '-X', '-L' + join_paths(meson.build_root(), 'vala'),
+       '-X', '-lvala@0@'.format(vala_version_suffix),
+       '-X', '-L' + join_paths(meson.build_root(), 'libvaladoc'),
+       '-X', '-lvaladoc@0@'.format(vala_version_suffix),
+       '-X', '-L' + join_paths(meson.build_root(), 'libvaladoc'),
+       '-X', '-lvaladoc@0@'.format(vala_version_suffix),
+       '-X', '-I' + join_paths(meson.build_root(), 'gee'),
+       '-X', '-I' + join_paths(meson.build_root(), 'vala'),
+       '-X', '-I' + join_paths(meson.build_root(), 'libvaladoc'),
+       join_paths(meson.source_root(), 'valadoc', 'tests', 'libvaladoc', 'parser', 'generic-scanner.vala'),
+]
+
+foreach flag : supported_test_cflags
+       vala_flags += ['-X', flag]
+endforeach
+
+foreach case : test_cases
+       test(case,
+               valac_exe,
+               workdir: meson.current_build_dir(),
+               args: vala_flags + [join_paths(meson.current_source_dir(), case)],
+       )
+endforeach
+
+driver_exe = executable('driver',
+       files(
+               'drivers/driver-test.vala',
+               'drivers/generic-api-test.vala',
+               join_paths(meson.source_root(), 'valadoc/driver.vala'),
+               join_paths(meson.source_root(), 'valadoc/girwriter.vala'),
+               join_paths(meson.source_root(), 'valadoc/initializerbuilder.vala'),
+               join_paths(meson.source_root(), 'valadoc/symbolresolver.vala'),
+               join_paths(meson.source_root(), 'valadoc/treebuilder.vala'),
+       ),
+       c_args: '-DTOP_SRC_DIR="@0@"'.format(meson.source_root()),
+       dependencies: [gobject_dep, valacodegen_dep, libvaladoc_dep],
+       install: false,
+)
+
+test('valadoc/driver',
+       driver_exe,
+       workdir: meson.current_build_dir(),
+)


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