[FFmpeg-devel] [PATCH] tests: add fate-ffprobe test
jamal
jamrial at gmail.com
Thu Sep 20 03:51:27 CEST 2012
On 19/09/12 6:59 AM, Stefano Sabatini wrote:> On date Wednesday 2012-09-19 11:06:41 +0200, Stefano Sabatini encoded:
>
> Updated after the CSV fix.
>
> diff --git a/tests/Makefile b/tests/Makefile
> index 81ce3e1..2ca1665 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -32,6 +32,18 @@ tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
>
> tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN
>
> +FFPROBE_GENTEST_CMD = ffmpeg$(EXESUF) \
> + -f lavfi -i "aevalsrc=sin(400*PI*2*t)::d=0.25[out0]; testsrc=d=0.25[out1]; testsrc=s=100x100:d=0.25[out2]" \
> + -flags +bitexact -map 0:0 -map 0:1 -map 0:2 \
> + -metadata "title=ffprobe test file" \
> + -metadata "comment='A comment wih CSV, XML & JSON special chars': <tag value=\"x\">" \
> + -metadata "comment2=I ♥ Üñîçød€" \
> + -vcodec rawvideo -acodec pcm_s16le \
> + -y
> +
> +tests/data/ffprobe-test.nut: ffmpeg$(EXESUF)
> + $(M)$(FFPROBE_GENTEST_CMD) $@
> +
>
This needs to be "tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) | tests/data", like with the vsynth and asynth stuff above, or it will fail to create the file if the tests/data folder doesn't exist.
You should also add something like "tests/data/%.nut" to the TAG = GEN line above, and make sure the output of ffmpeg when creating ffprobe-test.nut is sent to /dev/null.
For example:
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -30,7 +30,16 @@ tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
$(M)$< $(SRC_PATH)/tests/lena.pnm $@
-tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN
+tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) | tests/data
+ $(M)./$< -f lavfi -i "aevalsrc=sin(400*PI*2*t)::d=0.25[out0]; testsrc=d=0.25[out1]; testsrc=s=100x100:d=0.25[out2]" \
+ -flags +bitexact -map 0:0 -map 0:1 -map 0:2 \
+ -metadata "title=ffprobe test file" \
+ -metadata "comment='A comment wih CSV, XML & JSON special chars': <tag value=\"x\">" \
+ -metadata "comment2=I ♥ Üñîçød€" \
+ -vcodec rawvideo -acodec pcm_s16le \
+ -y $@ > /dev/null 2>&1
+
+tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN
Which also gets rid of FFPROBE_GENTEST_CMD as it's not really necessary.
> diff --git a/tests/fate/ffprobe.mak b/tests/fate/ffprobe.mak
> new file mode 100644
> index 0000000..56f283b
> --- /dev/null
> +++ b/tests/fate/ffprobe.mak
> @@ -0,0 +1,33 @@
> +FFPROBE_TEST_FILE=tests/data/ffprobe-test.nut
> +FFPROBE_COMMAND=ffprobe$(EXESUF) -show_streams -show_packets -show_format -show_frames $(FFPROBE_TEST_FILE)
> +
> +FATE_FFPROBE += fate-ffprobe_compact
> +fate-ffprobe_compact: $(FFPROBE_TEST_FILE)
> +fate-ffprobe_compact: CMD = run $(FFPROBE_COMMAND) -of compact
> +
> +FATE_FFPROBE += fate-ffprobe_csv
> +fate-ffprobe_compact: $(FFPROBE_TEST_FILE)
> +fate-ffprobe_csv: CMD = run $(FFPROBE_COMMAND) -of csv
> +
> +FATE_FFPROBE += fate-ffprobe_default
> +fate-ffprobe_compact: $(FFPROBE_TEST_FILE)
> +fate-ffprobe_default: CMD = run $(FFPROBE_COMMAND) -of default
> +
> +FATE_FFPROBE += fate-ffprobe_flat
> +fate-ffprobe_compact: $(FFPROBE_TEST_FILE)
> +fate-ffprobe_flat: CMD = run $(FFPROBE_COMMAND) -of flat
> +
> +FATE_FFPROBE += fate-ffprobe_ini
> +fate-ffprobe_compact: $(FFPROBE_TEST_FILE)
> +fate-ffprobe_ini: CMD = run $(FFPROBE_COMMAND) -of ini
> +
> +FATE_FFPROBE += fate-ffprobe_json
> +fate-ffprobe_compact: $(FFPROBE_TEST_FILE)
> +fate-ffprobe_json: CMD = run $(FFPROBE_COMMAND) -of json
> +
> +FATE_FFPROBE += fate-ffprobe_xml
> +fate-ffprobe_compact: $(FFPROBE_TEST_FILE)
> +fate-ffprobe_xml: CMD = run $(FFPROBE_COMMAND) -of xml
> +
> +fate-ffprobe: $(FATE_FFPROBE)
> +
>
You repeated "fate-ffprobe_compact" for every test here.
Regards.
More information about the ffmpeg-devel
mailing list