[vala/wip/meson: 4/4] meson: Add valadoc tests
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/meson: 4/4] meson: Add valadoc tests
- Date: Mon, 11 Feb 2019 14:16:22 +0000 (UTC)
commit a6f0005bb2a03061cfd3ff7d7bbe8b1303c909e8
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 | 71 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 72 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..5414bfe82
--- /dev/null
+++ b/valadoc/tests/meson.build
@@ -0,0 +1,71 @@
+test_cases = [
+ 'libvaladoc/errorreporter.vala',
+ 'libvaladoc/gtkdoc-scanner.vala',
+ 'libvaladoc/markupreader.vala',
+ 'libvaladoc/parser/manyrule.vala',
+ 'libvaladoc/parser/oneofrule.vala',
+ 'libvaladoc/parser/optionalrule.vala',
+ 'libvaladoc/parser/sequencerule.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)],
+ depends: [valacore_lib, libvaladoc_lib]
+ )
+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]