diff --git a/crates/engine/tests/export.rs b/crates/engine/tests/export.rs index 428cad8..1a4c5eb 100644 --- a/crates/engine/tests/export.rs +++ b/crates/engine/tests/export.rs @@ -1668,13 +1668,21 @@ fn injected_with( engine::envcfg::unset("VE_SW_ENC"); engine::envcfg::set("VE_HW_TEST_FAKE", "1"); // The child is a binary of `engine-hw`, so cargo names it for no test of - // this package; it sits beside the test binary's own `target//`. - let child = std::env::current_exe() + // this package; it sits beside the test binary's own `target//`, + // or under `EDITH_TARGET_DIR` when cargo's `build-dir` keeps the test + // binaries elsewhere. + let profile = if cfg!(debug_assertions) { "debug" } else { "release" }; + let beside = std::env::current_exe() .expect("the test binary's path") .parent() .and_then(|deps| deps.parent()) .expect("target/") .join("hw-child"); + let child = [Some(beside.clone()), engine::envcfg::var_os("EDITH_TARGET_DIR").map(|t| std::path::PathBuf::from(t).join(profile).join("hw-child"))] + .into_iter() + .flatten() + .find(|c| c.is_file()) + .unwrap_or(beside); engine::envcfg::set("VE_HW_CHILD_BIN", child.to_str().expect("a UTF-8 path")); match timeout_ms { Some(ms) => engine::envcfg::set("VE_HW_TIMEOUT_MS", ms), diff --git a/scripts/gen_fixtures.sh b/scripts/gen_fixtures.sh index ddce120..27eb3ea 100755 --- a/scripts/gen_fixtures.sh +++ b/scripts/gen_fixtures.sh @@ -848,3 +848,10 @@ ffmpeg -y -f lavfi -i "testsrc2=size=1920x1080:rate=30:duration=2" \ echo "fixtures written to assets/" +# Copy-length fixture: 4.0 s of picture over 44.1k AAC, whose 172.27 packets' +# worth of sound a stream copy has to round up, not away (export.rs +# a_copied_sound_runs_as_long_as_its_picture). +ffmpeg -y -f lavfi -i testsrc2=size=320x180:rate=30:duration=4 \ + -f lavfi -i "sine=frequency=440:sample_rate=44100:duration=4" \ + -map 0:v -map 1:a -c:v libx264 -profile:v baseline -pix_fmt yuv420p \ + -ac 2 -c:a aac -b:a 128k -shortest assets/test_sync.mp4