mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 05:21:00 +00:00
meson: add test wrapper
Allow us to run the tests using 'meson test'. Needed for https://gitlab.freedesktop.org/gstreamer/gst-ci/issues/46
This commit is contained in:
parent
accd10dfea
commit
28e3e3199c
2 changed files with 22 additions and 4 deletions
|
@ -7,8 +7,8 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
command, meson_build_dir, meson_current_source_dir, meson_build_root, target, ext, exclude = sys.argv[
|
command, meson_build_dir, meson_current_source_dir, meson_build_root, target, exclude = sys.argv[
|
||||||
1:]
|
1:7]
|
||||||
|
|
||||||
cargo_target_dir = os.path.join(meson_build_dir, 'target')
|
cargo_target_dir = os.path.join(meson_build_dir, 'target')
|
||||||
|
|
||||||
|
@ -28,11 +28,17 @@ env['PKG_CONFIG_PATH'] = ':'.join(pkg_config_path)
|
||||||
|
|
||||||
if command == 'build':
|
if command == 'build':
|
||||||
# cargo build
|
# cargo build
|
||||||
|
ext = sys.argv[7]
|
||||||
cargo_cmd = ['cargo', 'build', '--manifest-path',
|
cargo_cmd = ['cargo', 'build', '--manifest-path',
|
||||||
os.path.join(meson_current_source_dir, 'Cargo.toml'),
|
os.path.join(meson_current_source_dir, 'Cargo.toml'),
|
||||||
'--workspace']
|
'--workspace']
|
||||||
if target == 'release':
|
if target == 'release':
|
||||||
cargo_cmd.append('--release')
|
cargo_cmd.append('--release')
|
||||||
|
elif command == 'test':
|
||||||
|
# cargo test
|
||||||
|
cargo_cmd = ['cargo', 'test', '--no-fail-fast', '--color=always', '--manifest-path',
|
||||||
|
os.path.join(meson_current_source_dir, 'Cargo.toml'),
|
||||||
|
'--workspace']
|
||||||
else:
|
else:
|
||||||
print("Unknown command:", command)
|
print("Unknown command:", command)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
16
meson.build
16
meson.build
|
@ -80,6 +80,8 @@ foreach d: deps
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
exclude = ','.join(exclude)
|
||||||
|
|
||||||
# Always build the target so we don't have to list all source files as input
|
# Always build the target so we don't have to list all source files as input
|
||||||
rs_plugins = custom_target('gst-plugins-rs',
|
rs_plugins = custom_target('gst-plugins-rs',
|
||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
|
@ -94,10 +96,20 @@ rs_plugins = custom_target('gst-plugins-rs',
|
||||||
meson.current_source_dir(),
|
meson.current_source_dir(),
|
||||||
meson.build_root(),
|
meson.build_root(),
|
||||||
target,
|
target,
|
||||||
ext,
|
exclude,
|
||||||
','.join(exclude)])
|
ext])
|
||||||
|
|
||||||
# FIXME: raises a warning as the target has multiple outputs and meson will use
|
# FIXME: raises a warning as the target has multiple outputs and meson will use
|
||||||
# only the first one. All the plugins have the same basedir, hence
|
# only the first one. All the plugins have the same basedir, hence
|
||||||
# GST_PLUGIN_PATH will include them all, so that's ok.
|
# GST_PLUGIN_PATH will include them all, so that's ok.
|
||||||
plugins = [rs_plugins]
|
plugins = [rs_plugins]
|
||||||
|
|
||||||
|
test('tests',
|
||||||
|
cargo_wrapper,
|
||||||
|
args: ['test',
|
||||||
|
meson.current_build_dir(),
|
||||||
|
meson.current_source_dir(),
|
||||||
|
meson.build_root(),
|
||||||
|
target,
|
||||||
|
exclude],
|
||||||
|
timeout: 600)
|
||||||
|
|
Loading…
Reference in a new issue