Skip to content

Commit

Permalink
CI: test.sh don't run cargo, simplify args
Browse files Browse the repository at this point in the history
  • Loading branch information
thedataking committed Dec 6, 2023
1 parent 48b44bd commit dc36709
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
--platform linux/arm64 \
ghcr.io/immunant/rav1d/debian-bullseye-aarch64:latest \
.github/workflows/test.sh -t 2 \
-r ../target/aarch64-unknown-linux-gnu/release/dav1d \
-s ../target/aarch64-unknown-linux-gnu/release/seek_stress
-r target/aarch64-unknown-linux-gnu/release/dav1d \
-s target/aarch64-unknown-linux-gnu/release/seek_stress
- name: upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-arm7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
--platform linux/arm/v7 \
ghcr.io/immunant/rav1d/debian-bullseye-arm7:latest \
.github/workflows/test.sh -t 2 \
-r ../target/armv7-unknown-linux-gnueabihf/release/dav1d \
-s ../target/armv7-unknown-linux-gnueabihf/release/seek_stress
-r target/armv7-unknown-linux-gnueabihf/release/dav1d \
-s target/armv7-unknown-linux-gnueabihf/release/seek_stress
- name: upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build-and-test-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build: [
# release build without optimized assembly routines
{name: "release", flags: "--release --no-default-features --features=bitdepth_8,bitdepth_16", timeout_multiplier: 1},
# debug build to catch overflows with optimized assembly routines
# debug build with optimizations to catch overflows with optimized assembly routines
{name: "opt-dev", flags: "--profile opt-dev", timeout_multiplier: 2}
]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,8 +51,8 @@ jobs:
- name: meson test for ${{ matrix.target }} ${{ matrix.build.name }}
run: |
.github/workflows/test.sh \
-r ../target/${{ matrix.target }}/${{ matrix.build.name }}/dav1d \
-s ../target/${{ matrix.target }}/${{ matrix.build.name }}/seek_stress \
-r target/${{ matrix.target }}/${{ matrix.build.name }}/dav1d \
-s target/${{ matrix.target }}/${{ matrix.build.name }}/seek_stress \
-t ${{ matrix.build.timeout_multiplier }}
- name: copy log files
if: ${{ !cancelled() }}
Expand Down Expand Up @@ -100,8 +100,9 @@ jobs:
cargo build --release
- name: meson test for x86_64-apple-darwin
run: |
.github/workflows/test.sh -r ../target/release/dav1d \
-s ../target/release/seek_stress
.github/workflows/test.sh \
-r target/release/dav1d \
-s target/release/seek_stress
- name: copy log files
if: ${{ !cancelled() }}
run: |
Expand Down
33 changes: 17 additions & 16 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,27 @@ 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')

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...'
)
# 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 test the Rust executables instead of the C versions.
if test_rust_path == ''
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'
profile = 'debug'
else
run_command('cargo', 'build', '--release', check: true)
test_rust_path = '../target/release/dav1d'
seek_stress_test_rust_path = '../target/release/seek_stress'
profile = 'release'
endif
test_rust_path = '../target/' + profile + '/dav1d'
test_rust_path = join_paths(meson.current_source_dir(), test_rust_path)
dav1d = find_program(test_rust_path, required: true)
seek_stress_test_rust_path = '../target/' + profile + '/seek_stress'
seek_stress_test_rust_path = join_paths(meson.current_source_dir(), seek_stress_test_rust_path)
seek_stress = find_program(seek_stress_test_rust_path, required: true)
else
# Adjust relative paths so one can use binary paths relative to project
# top dir rather than relative to the location of the test subdirectory.
dav1d = files(join_paths('../', get_option('test_rust_path')))
seek_stress = files(join_paths('../', get_option('seek_stress_test_rust_path')))
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.
dav1d = files(test_rust_path)
seek_stress = files(seek_stress_test_rust_path)
endif

# Include dav1d test data repository with additional tests
Expand Down

0 comments on commit dc36709

Please sign in to comment.