diff mbox series

[FFmpeg-devel,17/32] fate/fits: Use transcode for transcode-like test

Message ID AS8PR01MB794414A62A3367140CC96AA48FF99@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit 9d767b8a988de512279cf0f8c3a14ce637ef862d
Headers show
Series [FFmpeg-devel,01/32] fate/matroska: Use REMUX and TRANSCODE where appropriate | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 24, 2022, 3:34 a.m. UTC
Each of the intermediately generated lena-*.fits files is only used
for exactly one test; so it could be deleted right after the test.
Switching to a transcode test (which is also more natural) achieves
this. It also adds checksums of the intermediate files to the ref-file.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 tests/fate/fits.mak              | 19 +++++--------------
 tests/ref/fate/fitsdec-gbrap16le |  2 ++
 tests/ref/fate/fitsdec-gbrp      |  2 ++
 tests/ref/fate/fitsdec-gbrp16    |  2 ++
 tests/ref/fate/fitsdec-gray      |  2 ++
 5 files changed, 13 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/tests/fate/fits.mak b/tests/fate/fits.mak
index ea471d6654..b9e99d97ee 100644
--- a/tests/fate/fits.mak
+++ b/tests/fate/fits.mak
@@ -6,17 +6,10 @@  tests/data/fits-multi.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
 
 #mapping of fits file formats to png filenames
 # TODO: Use an actual 64bit input file and fix the gbrp16 test on big-endian
-map.tests/data/lena-gray.fits    := gray8
-map.tests/data/lena-gbrp.fits    := rgb24
-map.tests/data/lena-gbrp16.fits  := rgb48
-map.tests/data/lena-gbrap16le.fits := rgba64
-
-tests/data/lena%.fits: TAG = GEN
-tests/data/lena%.fits: NAME = $(map.$(@))
-tests/data/lena%.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
-	$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-        -i $(TARGET_SAMPLES)/png1/lena-$(map.$(@)).png \
-        -y $(TARGET_PATH)/$(@) 2>/dev/null
+fits-png-map-gray      := gray8
+fits-png-map-gbrp      := rgb24
+fits-png-map-gbrp16    := rgb48
+fits-png-map-gbrap16le := rgba64
 
 FATE_FITS_DEC-$(call FRAMECRC, FITS, FITS, SCALE_FILTER) += fate-fitsdec-ext_data_min_max
 fate-fitsdec-ext_data_min_max: CMD = framecrc -i $(TARGET_SAMPLES)/fits/x0cj010ct_d0h.fit -pix_fmt gray16le -vf scale
@@ -35,11 +28,9 @@  fate-fitsdec-multi: tests/data/fits-multi.fits
 fate-fitsdec-multi: CMD = framecrc -i $(TARGET_PATH)/tests/data/fits-multi.fits -pix_fmt gbrap
 
 fate-fitsdec%: PIXFMT = $(word 3, $(subst -, ,$(@)))
-fate-fitsdec%: SRC = $(TARGET_PATH)/tests/data/lena-$(PIXFMT).fits
-fate-fitsdec%: CMD = framecrc -i $(SRC) -pix_fmt $(PIXFMT)
+fate-fitsdec%: CMD = transcode image2 $(TARGET_SAMPLES)/png1/lena-$(fits-png-map-$(PIXFMT)).png fits "-vf scale -pix_fmt $(PIXFMT)"
 
 FATE_FITS_DEC_PIXFMT = gray gbrp gbrp16 gbrap16le
-$(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%): fate-fitsdec-%: tests/data/lena-%.fits
 FATE_FITS_DEC-$(call TRANSCODE, FITS, FITS, IMAGE2_DEMUXER PNG_DECODER SCALE_FILTER) += $(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%)
 
 FATE_FITS += $(FATE_FITS_DEC-yes)
diff --git a/tests/ref/fate/fitsdec-gbrap16le b/tests/ref/fate/fitsdec-gbrap16le
index 78abb5cde7..53ef980b13 100644
--- a/tests/ref/fate/fitsdec-gbrap16le
+++ b/tests/ref/fate/fitsdec-gbrap16le
@@ -1,3 +1,5 @@ 
+64526d8da12d1fa07ceea5725647076f *tests/data/fate/fitsdec-gbrap16le.fits
+135360 tests/data/fate/fitsdec-gbrap16le.fits
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: rawvideo
diff --git a/tests/ref/fate/fitsdec-gbrp b/tests/ref/fate/fitsdec-gbrp
index 8767b6715f..23249f492b 100644
--- a/tests/ref/fate/fitsdec-gbrp
+++ b/tests/ref/fate/fitsdec-gbrp
@@ -1,3 +1,5 @@ 
+38e232e4c1ca57b5866efa01da70359c *tests/data/fate/fitsdec-gbrp.fits
+54720 tests/data/fate/fitsdec-gbrp.fits
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: rawvideo
diff --git a/tests/ref/fate/fitsdec-gbrp16 b/tests/ref/fate/fitsdec-gbrp16
index f6368f2c02..9250690e9b 100644
--- a/tests/ref/fate/fitsdec-gbrp16
+++ b/tests/ref/fate/fitsdec-gbrp16
@@ -1,3 +1,5 @@ 
+2078208c93ba417d3fe150ba42bf5a30 *tests/data/fate/fitsdec-gbrp16.fits
+103680 tests/data/fate/fitsdec-gbrp16.fits
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: rawvideo
diff --git a/tests/ref/fate/fitsdec-gray b/tests/ref/fate/fitsdec-gray
index 488ee71022..b7992bfda3 100644
--- a/tests/ref/fate/fitsdec-gray
+++ b/tests/ref/fate/fitsdec-gray
@@ -1,3 +1,5 @@ 
+c02ac3e0a9f2ceeb1e6e66c085a63671 *tests/data/fate/fitsdec-gray.fits
+20160 tests/data/fate/fitsdec-gray.fits
 #tb 0: 1/1
 #media_type 0: video
 #codec_id 0: rawvideo