Commit 3b982908 authored by Rico Tzschichholz's avatar Rico Tzschichholz

meson: Add tests

parent ff208c60
......@@ -143,6 +143,17 @@ if valadoc_enabled and cc.run('''#include <gvc.h>
add_project_arguments('-D', 'WITH_CGRAPH', language: 'vala')
endif
add_test_setup('default', is_default: true, env: 'G_SLICE=debug-blocks G_DEBUG=fatal-warnings')
vg = find_program('valgrind', required: false)
if (vg.found())
add_test_setup('valgrind',
env: 'G_SLICE=always-malloc G_DEBUG=fatal-warnings',
exe_wrapper: [vg, '--error-exitcode=1', '--leak-check=full', '--track-origins=yes'],
timeout_multiplier: 100,
)
endif
subdir('gobject-introspection')
subdir('gee')
subdir('vala')
......@@ -158,5 +169,6 @@ if valadoc_enabled
endif
subdir('doc')
subdir('tests')
install_data('vala.m4', install_dir: join_paths('share', 'aclocal'))
This diff is collapsed.
#!/usr/bin/env python3
import sys, os, re
from pathlib import Path
if len(sys.argv) != 3:
print("Wrong amount of parameters.")
inputf = Path(sys.argv[1])
outputf = Path(sys.argv[2])
with inputf.open('r') as ifile:
with outputf.open('w') as ofile:
if not ifile.readline().strip() == "Invalid Code":
ifile.seek(0)
lines = ifile.readlines()
ofile.writelines(lines)
......@@ -21,3 +21,4 @@ meson.add_install_script('sh', '-c', 'cd $DESTDIR@0@; ln -fs --relative @1@ vala
subdir('doclets')
subdir('icons')
subdir('tests')
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(),
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment