From 942ce1ecb8a3a87430f1675bc9c8e3e2d27a0aff Mon Sep 17 00:00:00 2001 From: Per Larsen Date: Thu, 13 Jul 2023 16:43:22 -0700 Subject: [PATCH] Clean up meson support for seek_stress --- .github/workflows/test.sh | 7 ++++--- tests/meson.build | 38 ++++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.sh b/.github/workflows/test.sh index 32784b970..165b9f4cc 100755 --- a/.github/workflows/test.sh +++ b/.github/workflows/test.sh @@ -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 diff --git a/tests/meson.build b/tests/meson.build index 0b86ba020..bcf41bc3c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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