Commit a7290363cc for ffmpeg
commit a7290363cc813409b6e078467e9caee14c9ac44b
Author: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Date: Tue Nov 24 10:17:50 2026 -0800
tests/fate: fix temporary files and generic tags on target runners
Use target paths for commands and the host path for patching and cleanup.
Stop on patch failure. Stage the generic-tags fixture and require the
programs and components used by each test.
Co-Authored-By: Michael Niedermayer <michael@niedermayer.cc>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Fairy
Signed-off-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 34c0312b5a..741e69f79f 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -44,15 +44,12 @@ esac
target_path(){
- case ${1} in
- [a-zA-Z]:/*)
- echo ${1}
- ;;
- /*)
- echo ${1}
+ case $1 in
+ [a-zA-Z]:/*|/*)
+ printf '%s\n' "$1"
;;
*)
- echo ${target_path}/${1}
+ printf '%s\n' "$target_path/$1"
;;
esac
}
@@ -105,13 +102,7 @@ runecho(){
}
run_with_temp(){
- create_tmp=$1
- process_tmp=$2
- filext=$3
- tmpfile=${outdir}/$test.$filext
- cleanfiles="$cleanfiles $tmpfile"
- run $create_tmp $tmpfile || return 1
- run $process_tmp $tmpfile
+ run_with_patched_temp "$1" "$2" "$3"
}
# Overwrite bytes at a specific offset in a binary file.
@@ -133,14 +124,18 @@ run_with_patched_temp(){
process_tmp=$2
filext=$3
tmpfile=${outdir}/$test.$filext
+ target_tmpfile=$(target_path "$tmpfile")
cleanfiles="$cleanfiles $tmpfile"
shift 3
- run $create_tmp $tmpfile || return 1
+ run $create_tmp "$target_tmpfile" || return 1
while [ $# -ge 2 ]; do
- patch_bytes "$tmpfile" "$1" "$2"
+ patch_bytes "$tmpfile" "$1" "$2" || {
+ echo "Failed to patch $tmpfile at offset $1" >&2
+ return 1
+ }
shift 2
done
- run $process_tmp $tmpfile
+ run $process_tmp "$target_tmpfile"
}
probefmt(){
diff --git a/tests/fate/generic-tags.mak b/tests/fate/generic-tags.mak
index 635c895e4b..38455f4094 100644
--- a/tests/fate/generic-tags.mak
+++ b/tests/fate/generic-tags.mak
@@ -1,31 +1,42 @@
-tests/data/generic-tags.mp3: TAG = GEN
-tests/data/generic-tags.mp3: ffmpeg$(PROGSSUF)$(EXESUF) $(SRC_PATH)/tests/generic-tags.ffmeta | tests/data
- $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
- -i $(TARGET_SAMPLES)/audiomatch/square3.mp3 \
- -f ffmetadata -i $(SRC_PATH)/tests/generic-tags.ffmeta \
- -c:a copy -map_metadata 1 $(TARGET_PATH)/$@ -y 2>/dev/null
+GENERIC_TAGS_INPUT = tests/data/generic-tags.mp3
+
+tests/data/generic-tags.ffmeta: TAG = COPY
+tests/data/generic-tags.ffmeta: $(SRC_PATH)/tests/generic-tags.ffmeta | tests/data
+ $(M)cp $< $@
+
+$(GENERIC_TAGS_INPUT): TAG = GEN
+$(GENERIC_TAGS_INPUT): ffmpeg$(PROGSSUF)$(EXESUF) tests/data/generic-tags.ffmeta | tests/data
+ $(M)$(TARGET_EXEC) "$(TARGET_PATH)/$<" -nostdin -v error \
+ -i "$(TARGET_SAMPLES)/audiomatch/square3.mp3" \
+ -f ffmetadata -i "$(TARGET_PATH)/tests/data/generic-tags.ffmeta" \
+ -c:a copy -map_metadata 1 "$(TARGET_PATH)/$@" -y
ID3V2_TESTBIN = libavformat/tests/id3v2$(EXESUF)
+GENERIC_TAGS_FIXTURE = MP3_MUXER MP3_DEMUXER FFMETADATA_DEMUXER FILE_PROTOCOL
+GENERIC_TAGS_TRANSCODE = $(GENERIC_TAGS_FIXTURE) PIPE_PROTOCOL FRAMECRC_MUXER
+GENERIC_TAGS_MP3_DECODER = $(if $(CONFIG_MP3FLOAT_DECODER),MP3FLOAT_DECODER,MP3_DECODER)
-FATE_GENERIC_TAGS-$(call REMUX, MP3) += fate-generic-tags-remux-mp3
-fate-generic-tags-remux-mp3: tests/data/generic-tags.mp3 $(ID3V2_TESTBIN)
-fate-generic-tags-remux-mp3: CMD = run_with_temp "$(FFMPEG) -nostdin -hide_banner -loglevel error -i $(TARGET_PATH)/tests/data/generic-tags.mp3 -c copy -fflags +bitexact -f mp3 -y" "$(ID3V2_TESTBIN)" mp3
+FATE_GENERIC_TAGS_MP3-$(call ALLYES, $(GENERIC_TAGS_FIXTURE)) += fate-generic-tags-remux-mp3
+fate-generic-tags-remux-mp3: $(GENERIC_TAGS_INPUT) $(ID3V2_TESTBIN)
+fate-generic-tags-remux-mp3: CMD = run_with_temp "$(FFMPEG) -nostdin -hide_banner -loglevel error -i $(TARGET_PATH)/$(GENERIC_TAGS_INPUT) -c copy -fflags +bitexact -f mp3 -y" "$(ID3V2_TESTBIN)" mp3
-FATE_GENERIC_TAGS-$(call REMUX, MP3, FLAC_MUXER FLAC_DEMUXER FLAC_ENCODER FLAC_DECODER ARESAMPLE_FILTER) += fate-generic-tags-remux-vorbiscomment
-fate-generic-tags-remux-vorbiscomment: tests/data/generic-tags.mp3
-fate-generic-tags-remux-vorbiscomment: CMD = generic_tags mp3 $(TARGET_PATH)/tests/data/generic-tags.mp3 flac flac "-t 0 -af aresample -strict experimental"
+FATE_GENERIC_TAGS-$(call ALLYES, $(GENERIC_TAGS_TRANSCODE) FLAC_MUXER FLAC_DEMUXER FLAC_ENCODER FLAC_DECODER ARESAMPLE_FILTER $(GENERIC_TAGS_MP3_DECODER)) += fate-generic-tags-remux-vorbiscomment
+fate-generic-tags-remux-vorbiscomment: $(GENERIC_TAGS_INPUT)
+fate-generic-tags-remux-vorbiscomment: CMD = generic_tags mp3 $(GENERIC_TAGS_INPUT) flac flac "-t 0 -af aresample -sample_fmt s32 -strict experimental"
-FATE_GENERIC_TAGS-$(call REMUX, MP3, ASF_MUXER ASF_DEMUXER WMAV1_ENCODER WMAV1_DECODER) += fate-generic-tags-remux-asf
-fate-generic-tags-remux-asf: tests/data/generic-tags.mp3
-fate-generic-tags-remux-asf: CMD = generic_tags mp3 $(TARGET_PATH)/tests/data/generic-tags.mp3 asf wmav1
+FATE_GENERIC_TAGS-$(call ALLYES, $(GENERIC_TAGS_TRANSCODE) ASF_MUXER ASF_DEMUXER WMAV1_ENCODER MP3FLOAT_DECODER) += fate-generic-tags-remux-asf
+fate-generic-tags-remux-asf: $(GENERIC_TAGS_INPUT)
+fate-generic-tags-remux-asf: CMD = generic_tags mp3 $(GENERIC_TAGS_INPUT) asf wmav1
-FATE_GENERIC_TAGS-$(call REMUX, MP3, WAV_MUXER WAV_DEMUXER PCM_S16LE_ENCODER PCM_S16LE_DECODER ARESAMPLE_FILTER) += fate-generic-tags-remux-riff
-fate-generic-tags-remux-riff: tests/data/generic-tags.mp3
-fate-generic-tags-remux-riff: CMD = generic_tags mp3 $(TARGET_PATH)/tests/data/generic-tags.mp3 wav pcm_s16le "-t 0 -af aresample"
+FATE_GENERIC_TAGS-$(call ALLYES, $(GENERIC_TAGS_TRANSCODE) WAV_MUXER WAV_DEMUXER PCM_S16LE_ENCODER ARESAMPLE_FILTER $(GENERIC_TAGS_MP3_DECODER)) += fate-generic-tags-remux-riff
+fate-generic-tags-remux-riff: $(GENERIC_TAGS_INPUT)
+fate-generic-tags-remux-riff: CMD = generic_tags mp3 $(GENERIC_TAGS_INPUT) wav pcm_s16le "-t 0 -af aresample"
-FATE_GENERIC_TAGS-$(call REMUX, MP3, MOV_MUXER MOV_DEMUXER MPEGAUDIO_PARSER) += fate-generic-tags-remux-mov
-fate-generic-tags-remux-mov: tests/data/generic-tags.mp3
-fate-generic-tags-remux-mov: CMD = generic_tags mp3 $(TARGET_PATH)/tests/data/generic-tags.mp3 mp4 copy
+# The MP4 stream-copy reference needs an MP3 decoder to retain Skip Samples side data.
+FATE_GENERIC_TAGS-$(call ALLYES, $(GENERIC_TAGS_TRANSCODE) MP4_MUXER MOV_DEMUXER MPEGAUDIO_PARSER $(GENERIC_TAGS_MP3_DECODER)) += fate-generic-tags-remux-mov
+fate-generic-tags-remux-mov: $(GENERIC_TAGS_INPUT)
+fate-generic-tags-remux-mov: CMD = generic_tags mp3 $(GENERIC_TAGS_INPUT) mp4 copy
+FATE_SAMPLES_FFMPEG += $(FATE_GENERIC_TAGS_MP3-yes)
FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_GENERIC_TAGS-yes)
-fate-generic-tags: $(FATE_GENERIC_TAGS-yes)
+fate-generic-tags: $(if $(CONFIG_FFMPEG),$(FATE_GENERIC_TAGS_MP3-yes) $(if $(CONFIG_FFPROBE),$(FATE_GENERIC_TAGS-yes)))