diff --git a/Makefile b/Makefile
index d69004b47463684925ecec90c134dee7476f2685..a155eea58b0fdbf3f9de42673697c4e92f8988e3 100644
--- a/Makefile
+++ b/Makefile
@@ -187,18 +187,16 @@ lavftest:  fate-lavf
 lavfitest: fate-lavfi
 seektest:  fate-seek
 
-AREF = tests/data/acodec.ref.wav
-VREF = tests/data/vsynth1.ref.yuv
+AREF = fate-acodec-aref
+VREF = fate-vsynth1-vref fate-vsynth2-vref
 REFS = $(AREF) $(VREF)
 
-$(REFS): TAG = GEN
-
 $(VREF): ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
-	$(M)$(SRC_PATH)/tests/codec-regression.sh vref vsynth1 tests/vsynth1 "$(TARGET_EXEC)" "$(TARGET_PATH)"
-	$(Q)$(SRC_PATH)/tests/codec-regression.sh vref vsynth2 tests/vsynth2 "$(TARGET_EXEC)" "$(TARGET_PATH)"
-
 $(AREF): ffmpeg$(EXESUF) tests/data/asynth1.sw
-	$(M)$(SRC_PATH)/tests/codec-regression.sh aref acodec tests/acodec "$(TARGET_EXEC)" "$(TARGET_PATH)"
+
+fate-acodec-aref:  CMD = codectest acodec
+fate-vsynth1-vref: CMD = codectest vsynth1
+fate-vsynth2-vref: CMD = codectest vsynth2
 
 ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
 	@echo
@@ -287,7 +285,7 @@ FATE_UTILS = base64 tiny_psnr
 
 fate: $(FATE)
 
-$(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
+$(FATE) $(REFS): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
 	@echo "TEST    $(@:fate-%=%)"
 	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)'
 
diff --git a/tests/codec-regression.sh b/tests/codec-regression.sh
index 2ee6166c33b844254c00b4cdcda3f9379fd0cd6c..9b2aa6308dae15d171b9e93e8a0f31156c36d24f 100755
--- a/tests/codec-regression.sh
+++ b/tests/codec-regression.sh
@@ -16,10 +16,10 @@ rm -f "$benchfile"
 
 # generate reference for quality check
 if [ -n "$do_vref" ]; then
-do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
+do_ffmpeg $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo
 fi
 if [ -n "$do_aref" ]; then
-do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
+do_ffmpeg $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav
 fi
 
 if [ -n "$do_mpeg" ] ; then
diff --git a/tests/ref/acodec/aref b/tests/ref/acodec/aref
new file mode 100644
index 0000000000000000000000000000000000000000..8e6773be3b851a8a1c7d1cdeccc574a092fc688d
--- /dev/null
+++ b/tests/ref/acodec/aref
@@ -0,0 +1,2 @@
+95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/acodec.ref.wav
+1058444 ./tests/data/acodec.ref.wav
diff --git a/tests/ref/vsynth1/vref b/tests/ref/vsynth1/vref
new file mode 100644
index 0000000000000000000000000000000000000000..2defdac8703ef021da786ead5fa204cbb199b236
--- /dev/null
+++ b/tests/ref/vsynth1/vref
@@ -0,0 +1,2 @@
+c5ccac874dbf808e9088bc3107860042 *./tests/data/vsynth1.ref.yuv
+7603200 ./tests/data/vsynth1.ref.yuv
diff --git a/tests/ref/vsynth2/vref b/tests/ref/vsynth2/vref
new file mode 100644
index 0000000000000000000000000000000000000000..8f83b6c7ba7bd82be57d70f0368e5792ee754fa0
--- /dev/null
+++ b/tests/ref/vsynth2/vref
@@ -0,0 +1,2 @@
+dde5895817ad9d219f79a52d0bdfb001 *./tests/data/vsynth2.ref.yuv
+7603200 ./tests/data/vsynth2.ref.yuv