...
 
Commits (2)
......@@ -146,6 +146,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')
......
......@@ -706,17 +706,6 @@ foreach flag : supported_test_cflags
vala_flags += ['-X', flag]
endforeach
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: 10,
)
endif
preparetest = find_program('prepare-test.py')
foreach case : test_cases
......
......@@ -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/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(),
)