Skip to content

Commit

Permalink
Clean up meson support for seek_stress
Browse files Browse the repository at this point in the history
  • Loading branch information
thedataking committed Jul 13, 2023
1 parent bdd382f commit 3d09c16
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ done
if [ -d "./build" ]
then
# also pass --reconfigure since $rust_test_path, etc. may have changed
meson setup build $debug_opt $rust_test_path $seek_stress_test_rust_path \
--reconfigure
meson setup build $debug_opt -Dtest_rust=true $rust_test_path \
$seek_stress_test_rust_path --reconfigure
else
# since build doesn't exist, it would be an error if we passed --reconfigure
meson setup build $debug_opt $rust_test_path $seek_stress_test_rust_path
meson setup build $debug_opt -Dtest_rust=true $rust_test_path \
$seek_stress_test_rust_path
fi

if [[ -z $seek_stress_test_rust_path ]]; then
Expand Down
38 changes: 20 additions & 18 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,28 @@ if get_option('enable_tools')
)
endif

test_rust_path = get_option('test_rust_path')
if test_rust_path == ''
message('running cargo since test_rust_path is not set...')
if get_option('debug')
run_command('cargo', 'build', check: true)
test_rust_path = '../target/debug/dav1d'
seek_stress_test_rust_path = '../target/debug/seek_stress'
else
run_command('cargo', 'build', '--release', check: true)
test_rust_path = '../target/release/dav1d'
seek_stress_test_rust_path = '../target/release/seek_stress'
endif
endif
if get_option('test_rust')
test_rust_path = get_option('test_rust_path')
seek_stress_test_rust_path = get_option('seek_stress_test_rust_path')

seek_stress_test_rust_path = get_option('seek_stress_test_rust_path')
if test_rust_path == '' or seek_stress_test_rust_path == ''
message('running cargo build since "test_rust" is set but ' +
'"test_rust_path" or "seek_stress_test_rust_path" isn\'t set...'
)
if get_option('debug')
run_command('cargo', 'build', check: true)
test_rust_path = '../target/debug/dav1d'
seek_stress_test_rust_path = '../target/debug/seek_stress'
else
run_command('cargo', 'build', '--release', check: true)
test_rust_path = '../target/release/dav1d'
seek_stress_test_rust_path = '../target/release/seek_stress'
endif
endif

# HACK: If we're trying to test the Rust build, override the `dav1d` and
# `seek_stress` executables to point to the versions produced by Cargo.
# This will cause the Rust executables to be tested instead of the C versions.
if get_option('test_rust')
# HACK: If we're trying to test the Rust build, override the `dav1d` and
# `seek_stress` executables to point to the versions produced by Cargo.
# This will cause the Rust executables to be tested instead of the C versions.
dav1d = files(test_rust_path)
seek_stress = files(seek_stress_test_rust_path)
endif
Expand Down

0 comments on commit 3d09c16

Please sign in to comment.