Commit e7126bda authored by diego's avatar diego

Merge tests Makefile into the top-level Makefile.

This gets rid of some recursion and simplifies the code.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9255 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2bd4a006
......@@ -214,11 +214,12 @@ clean:
$(MAKE) -C libavformat clean
$(MAKE) -C libpostproc clean
$(MAKE) -C libswscale clean
$(MAKE) -C tests clean
$(MAKE) -C vhook clean
rm -f *.o *.d *~ .libs gmon.out TAGS $(ALLPROGS) $(ALLPROGS_G) \
output_example$(EXESUF) qt-faststart$(EXESUF) cws2fws$(EXESUF)
rm -f doc/*.html doc/*.pod doc/*.1
rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
distclean: clean
$(MAKE) -C libavutil distclean
......@@ -226,7 +227,6 @@ distclean: clean
$(MAKE) -C libavformat distclean
$(MAKE) -C libpostproc distclean
$(MAKE) -C libswscale distclean
$(MAKE) -C tests distclean
$(MAKE) -C vhook distclean
rm -f .depend version.h config.* *.pc
......@@ -235,11 +235,69 @@ TAGS:
# regression tests
codectest libavtest seektest test-server fulltest test: $(PROGS)
$(MAKE) -C tests $@
fulltest test: codectest libavtest seektest
#codectest libavtest seektest test-server: $(PROGS)
FFMPEG_REFFILE = $(SRC_PATH)/tests/ffmpeg.regression.ref
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
LIBAV_REFFILE = $(SRC_PATH)/tests/libav.regression.ref
ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
SEEK_REFFILE = $(SRC_PATH)/tests/seek.regression.ref
test-server: tests/vsynth1/00.pgm tests/asynth1.sw
@echo
@echo "Unfortunately ffserver is broken and therefore its regression"
@echo "test fails randomly. Treat the results accordingly."
@echo
$(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
codectest mpeg4 mpeg ac3 snow snowll: tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw tests/tiny_psnr$(EXESUF)
$(SRC_PATH)/tests/regression.sh $@ $(FFMPEG_REFFILE) tests/vsynth1
$(SRC_PATH)/tests/regression.sh $@ $(ROTOZOOM_REFFILE) tests/vsynth2
ifeq ($(CONFIG_GPL),yes)
libavtest: tests/vsynth1/00.pgm tests/asynth1.sw
$(SRC_PATH)/tests/regression.sh $@ $(LIBAV_REFFILE) tests/vsynth1
seektest: tests/seek_test$(EXESUF)
$(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE)
else
libavtest seektest:
@echo
@echo "This test requires FFmpeg to be compiled with --enable-gpl."
@echo
@exit 1
endif
ifeq ($(CONFIG_SWSCALER),yes)
test-server codectest mpeg4 mpeg ac3 snow snowll libavtest: swscale_error
swscale_error:
@echo
@echo "This regression test is incompatible with --enable-swscaler."
@echo
@exit 1
endif
tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
mkdir -p tests/vsynth1
$(BUILD_ROOT)/$< 'tests/vsynth1/'
tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
mkdir -p tests/vsynth2
$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
tests/asynth1.sw: tests/audiogen$(EXESUF)
$(BUILD_ROOT)/$< $@
%$(EXESUF): %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
tests/seek_test$(EXESUF): tests/seek_test.c
$(CC) $(LDFLAGS) $(CFLAGS) -DHAVE_AV_CONFIG_H -o $@ $< $(EXTRALIBS)
.PHONY: all lib videohook documentation install* wininstaller uninstall*
.PHONY: dep depend clean distclean TAGS
.PHONY: codectest libavtest seektest test-server fulltest test
.PHONY: mpeg4 mpeg ac3 snow snowll swscale-error
-include .depend
#
# Makefile for tests
# (c) 2002 Fabrice Bellard
#
include ../config.mak
VPATH = $(SRC_PATH_BARE)/tests
SRC_DIR = $(SRC_PATH)/tests
BUILD_DIR = $(BUILD_ROOT)/tests
CFLAGS = -O2 -Wall -g
FFMPEG_REFFILE = $(SRC_DIR)/ffmpeg.regression.ref
FFSERVER_REFFILE = $(SRC_DIR)/ffserver.regression.ref
LIBAV_REFFILE = $(SRC_DIR)/libav.regression.ref
ROTOZOOM_REFFILE = $(SRC_DIR)/rotozoom.regression.ref
SEEK_REFFILE = $(SRC_DIR)/seek.regression.ref
all fulltest test: codectest libavtest seektest
test-server: vsynth1/00.pgm asynth1.sw
@echo
@echo "Unfortunately ffserver is broken and therefore its regression"
@echo "test fails randomly. Treat the results accordingly."
@echo
$(SRC_DIR)/server-regression.sh $(FFSERVER_REFFILE) $(SRC_DIR)/test.conf
codectest mpeg4 mpeg ac3 snow snowll: vsynth1/00.pgm vsynth2/00.pgm asynth1.sw tiny_psnr$(EXESUF)
$(SRC_DIR)/regression.sh $@ $(FFMPEG_REFFILE) vsynth1
$(SRC_DIR)/regression.sh $@ $(ROTOZOOM_REFFILE) vsynth2
ifeq ($(CONFIG_GPL),yes)
libavtest: vsynth1/00.pgm asynth1.sw
$(SRC_DIR)/regression.sh $@ $(LIBAV_REFFILE) vsynth1
seektest: seek_test$(EXESUF)
$(SRC_DIR)/seek_test.sh $(SEEK_REFFILE)
else
libavtest seektest:
@echo
@echo "This test requires FFmpeg to be compiled with --enable-gpl."
@echo
@exit 1
endif
ifeq ($(CONFIG_SWSCALER),yes)
test-server codectest mpeg4 mpeg ac3 snow snowll libavtest: swscale_error
swscale_error:
@echo
@echo "This regression test is incompatible with --enable-swscaler."
@echo
@exit 1
endif
vsynth1/00.pgm: videogen$(EXESUF)
mkdir -p vsynth1
$(BUILD_DIR)/$< 'vsynth1/'
vsynth2/00.pgm: rotozoom$(EXESUF)
mkdir -p vsynth2
$(BUILD_DIR)/$< 'vsynth2/' $(SRC_DIR)/lena.pnm
asynth1.sw: audiogen$(EXESUF)
$(BUILD_DIR)/$< $@
%$(EXESUF): %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
seek_test$(EXESUF): seek_test.c
$(CC) $(LDFLAGS) $(CFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavutil -o $@ $< $(BUILD_ROOT)/libavformat/libavformat.a $(BUILD_ROOT)/libavcodec/libavcodec.a $(BUILD_ROOT)/libavutil/libavutil.a $(EXTRALIBS)
distclean clean:
rm -rf vsynth1 vsynth2 data asynth1.sw *~
rm -f $(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr)
.PHONY: all fulltest test codectest libavtest test-server seektest
.PHONY: mpeg4 mpeg ac3 snow snowll swscale_error distclean clean
This diff is collapsed.
This diff is collapsed.
......@@ -19,7 +19,7 @@ fi
set -e
datadir="./data"
datadir="./tests/data"
logfile="$datadir/ffmpeg.regression"
outfile="$datadir/a-"
......@@ -91,8 +91,8 @@ fi
# various files
ffmpeg="../ffmpeg_g"
tiny_psnr="./tiny_psnr"
ffmpeg="./ffmpeg_g"
tiny_psnr="tests/tiny_psnr"
reffile="$2"
benchfile="$datadir/ffmpeg.bench"
bench="$datadir/bench.tmp"
......@@ -100,7 +100,7 @@ bench2="$datadir/bench2.tmp"
raw_src="$3/%02d.pgm"
raw_dst="$datadir/out.yuv"
raw_ref="$datadir/ref.yuv"
pcm_src="asynth1.sw"
pcm_src="tests/asynth1.sw"
pcm_dst="$datadir/out.wav"
pcm_ref="$datadir/ref.wav"
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
......
This diff is collapsed.
This diff is collapsed.
#!/bin/sh
datadir="./data"
datadir="tests/data"
logfile="$datadir/seek.regression"
reffile="$1"
list=`ls data/a-* data/b-* | sort`
list=`ls tests/data/a-* tests/data/b-* | sort`
rm -f $logfile
for i in $list ; do
echo ---------------- >> $logfile
echo $i >> $logfile
echo $i | grep -v 'b-libav[01][0-9][.]' 2> /dev/null &&
./seek_test $i >> $logfile
tests/seek_test $i >> $logfile
done
if diff -u "$reffile" "$logfile" ; then
......
......@@ -8,23 +8,23 @@ else
fi
# Make sure that the data directory exists
mkdir -p data
mkdir -p tests/data
#perl -e 'chomp($wd = `pwd`); print map { s!data/!!; "<Stream $_>\nFile $wd/data/$_\n</Stream>\n\n" } @ARGV' data/a* >> data/test.conf
#perl -e 'chomp($wd = `pwd`); print map { s!data/!!; "<Stream $_.asf>\nFile $wd/data/$_\n</Stream>\n\n" } @ARGV' data/a* >> data/test.conf
#perl -e 'chomp($wd = `pwd`); print map { s!tests/data/!!; "<Stream $_>\nFile $wd/tests/data/$_\n</Stream>\n\n" } @ARGV' tests/data/a* >> tests/data/test.conf
#perl -e 'chomp($wd = `pwd`); print map { s!tests/data/!!; "<Stream $_.asf>\nFile $wd/tests/data/$_\n</Stream>\n\n" } @ARGV' tests/data/a* >> tests/data/test.conf
FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html`
rm -f feed1.ffm
../ffserver -d -f test.conf 2> /dev/null &
rm -f tests/feed1.ffm
./ffserver -d -f tests/test.conf 2> /dev/null &
FFSERVER_PID=$!
sleep 2
echo "Waiting for feeds to startup..."
../ffmpeg -loop_input -flags +bitexact -dct fastint -idct simple -y -f pgmyuv -i vsynth1/%02d.pgm http://localhost:9999/feed1.ffm 2> /dev/null &
./ffmpeg -loop_input -flags +bitexact -dct fastint -idct simple -y -f pgmyuv -i tests/vsynth1/%02d.pgm http://localhost:9999/feed1.ffm 2> /dev/null &
FFMPEG_PID=$!
sleep 5
(
cd data || exit $?
cd tests/data || exit $?
rm -f ff-*;
WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
for file in $FILES; do
......@@ -42,8 +42,8 @@ sleep 5
kill $FFMPEG_PID
kill $FFSERVER_PID
wait > /dev/null 2>&1
rm -f feed1.ffm
if $diff_cmd data/ffserver.regression "$1" ; then
rm -f tests/feed1.ffm
if $diff_cmd tests/data/ffserver.regression "$1" ; then
echo
echo Server regression test succeeded.
exit 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment