[MPlayer-dev-eng] [PATCH] Add fate test

Diego Biurrun diego at biurrun.de
Wed Nov 9 02:43:18 CET 2011


On Sun, Nov 06, 2011 at 11:04:10AM +0100, Reimar Döffinger wrote:
> a bit hackish, video only, some samples fail even when testing on a
> single configuration.

> --- Makefile	(revision 34309)
> +++ Makefile	(working copy)
> @@ -926,6 +926,7 @@
>  
>  clean:
>  	-$(MAKE) -C ffmpeg $@
> +	-$(MAKE) -C tests clean
>  	-rm -f $(call ADD_ALL_DIRS,/*.o /*.a /*.ho /*~)
>  	-rm -f $(call ADD_ALL_EXESUFS,mplayer mencoder)
>  
> @@ -1087,12 +1088,14 @@
>  
> +fatetest: mplayer$(EXESUF)
> +	$(MAKE) -C tests fatetest
>  
>  
>  -include $(DEP_FILES) $(DRIVER_DEP_FILES) $(TESTS_DEP_FILES) $(TOOLS_DEP_FILES) $(DHAHELPER_DEP_FILES)
>  
>  .PHONY: all doxygen *install* *tools drivers dhahelper*
> -.PHONY: checkheaders *clean tests check_checksums
> +.PHONY: checkheaders *clean tests check_checksums fatetest

I designed the build system non-recursive and monolithic on purpose.

tests/Makefile should be part of the main Makefile.

> --- tests/faterun.sh	(revision 0)
> +++ tests/faterun.sh	(revision 0)
> @@ -0,0 +1,10 @@
> +#!/bin/sh
> +i=$1
> +echo "running $i"
> +mkdir -p res/$(dirname $i)
> +touch res/$i.md5
> +../mplayer -noconfig all -lavdopts threads=4:bitexact -really-quiet -noconsolecontrols -nosound -benchmark -vo md5sum:outfile=res/$i.md5 $FATE_SAMPLES/$i
> +if ! diff -uw ref/$i.md5 res/$i.md5 ; then
> +    mv res/$i.md5 res/$i.md5.bad
> +    exit 1
> +fi

"i" is not really a better variable name than "1".
Also, a few empty lines could make this more readable.

I'll have to play with it still, but adding a test suite is a great
idea in principle.

Diego


More information about the MPlayer-dev-eng mailing list