Commit ba9df2a1 authored by Sophie Herold's avatar Sophie Herold
Browse files

Try to avoid rebuild for tests

parent 26d18dc1
......@@ -6,13 +6,15 @@ cargo_script = find_program(join_paths(meson.source_root(), 'build-aux/cargo.sh'
bin = meson.project_name()
rust_profile = '--release'
cargo_options = '--release'
rust_target = 'release'
if get_option('profile') == 'dev'
rust_profile = ''
cargo_options = ''
rust_target = 'debug'
endif
cargo_target_dir = join_paths(meson.build_root(), 'target')
cargo_release = custom_target(
'cargo-build',
build_by_default: true,
......@@ -24,8 +26,8 @@ cargo_release = custom_target(
command: [
cargo_script,
meson.source_root(),
join_paths(meson.build_root(), 'target'),
rust_profile,
cargo_target_dir,
cargo_options,
join_paths(meson.build_root(), 'target', rust_target, bin),
'@OUTPUT@',
]
......@@ -35,4 +37,14 @@ cargo = find_program('cargo')
test('cargo fmt', cargo, args: ['fmt', '--', '--check'])
test('cargo clippy', cargo, args: ['clippy'], is_parallel: false, timeout: 1800)
test('cargo test', cargo, args: ['test'], is_parallel: false, timeout: 1800)
test('cargo test',
cargo,
args: [
'test',
'--manifest-path', join_paths(meson.source_root(), 'Cargo.toml'),
'--target-dir', cargo_target_dir,
cargo_options
],
is_parallel: false,
timeout: 1800
)
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