summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-15 13:51:16 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-19 00:46:29 +0100
commitc26730ed8fb7ca94ef448f53dd69da472aa4e75b (patch)
treed1b289a838a3a5a816e5cb96f3ce7ac6e60bc161
parent69a45b8a4998e61efd40b054e70abc722f7e155f (diff)
tests/dnn: Make DNN tests regular libavfilter tests
They test libavfilter internal API, so they should be libavfilter test programs (which implies: linked statically to libavfilter to access internal APIs and linked normally (statically or dynamically depending upon the build configuration) against all the other libs). Right now, they are always linked statically against all libs, which is a significant size waste compared to shared libs as all of libavcodec has been pulled in despite not being really used. This also leads to linking failures on systems for which av_export_avutil is intended: libavcodec does not expect to be linked statically against the library providing avpriv_(cga|vga16)_font in this case. This is fixed by this commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/Makefile3
-rw-r--r--libavfilter/tests/.gitignore8
-rw-r--r--libavfilter/tests/dnn-layer-avgpool.c (renamed from tests/dnn/dnn-layer-avgpool-test.c)0
-rw-r--r--libavfilter/tests/dnn-layer-conv2d.c (renamed from tests/dnn/dnn-layer-conv2d-test.c)0
-rw-r--r--libavfilter/tests/dnn-layer-dense.c (renamed from tests/dnn/dnn-layer-dense-test.c)0
-rw-r--r--libavfilter/tests/dnn-layer-depth2space.c (renamed from tests/dnn/dnn-layer-depth2space-test.c)0
-rw-r--r--libavfilter/tests/dnn-layer-mathbinary.c (renamed from tests/dnn/dnn-layer-mathbinary-test.c)0
-rw-r--r--libavfilter/tests/dnn-layer-mathunary.c (renamed from tests/dnn/dnn-layer-mathunary-test.c)0
-rw-r--r--libavfilter/tests/dnn-layer-maximum.c (renamed from tests/dnn/dnn-layer-maximum-test.c)0
-rw-r--r--libavfilter/tests/dnn-layer-pad.c (renamed from tests/dnn/dnn-layer-pad-test.c)0
-rw-r--r--tests/Makefile5
-rw-r--r--tests/dnn/.gitignore8
-rw-r--r--tests/dnn/Makefile18
-rw-r--r--tests/fate/dnn.mak34
14 files changed, 31 insertions, 45 deletions
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 9a061ba3c8..cb328c2bf8 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -590,6 +590,9 @@ SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_filter.h
TOOLS = graph2dot
TESTPROGS = drawutils filtfmts formats integral
+TESTPROGS-$(CONFIG_DNN) += dnn-layer-avgpool dnn-layer-conv2d dnn-layer-dense \
+ dnn-layer-depth2space dnn-layer-mathbinary \
+ dnn-layer-mathunary dnn-layer-maximum dnn-layer-pad \
TOOLS-$(CONFIG_LIBZMQ) += zmqsend
diff --git a/libavfilter/tests/.gitignore b/libavfilter/tests/.gitignore
index 65ef86f2e5..db482cd49b 100644
--- a/libavfilter/tests/.gitignore
+++ b/libavfilter/tests/.gitignore
@@ -1,3 +1,11 @@
+/dnn-layer-conv2d
+/dnn-layer-depth2space
+/dnn-layer-maximum
+/dnn-layer-pad
+/dnn-layer-mathbinary
+/dnn-layer-mathunary
+/dnn-layer-avgpool
+/dnn-layer-dense
/drawutils
/filtfmts
/formats
diff --git a/tests/dnn/dnn-layer-avgpool-test.c b/libavfilter/tests/dnn-layer-avgpool.c
index 4a925ea22a..4a925ea22a 100644
--- a/tests/dnn/dnn-layer-avgpool-test.c
+++ b/libavfilter/tests/dnn-layer-avgpool.c
diff --git a/tests/dnn/dnn-layer-conv2d-test.c b/libavfilter/tests/dnn-layer-conv2d.c
index 5ee60eeaf0..5ee60eeaf0 100644
--- a/tests/dnn/dnn-layer-conv2d-test.c
+++ b/libavfilter/tests/dnn-layer-conv2d.c
diff --git a/tests/dnn/dnn-layer-dense-test.c b/libavfilter/tests/dnn-layer-dense.c
index 696f7505e5..696f7505e5 100644
--- a/tests/dnn/dnn-layer-dense-test.c
+++ b/libavfilter/tests/dnn-layer-dense.c
diff --git a/tests/dnn/dnn-layer-depth2space-test.c b/libavfilter/tests/dnn-layer-depth2space.c
index 958247e675..958247e675 100644
--- a/tests/dnn/dnn-layer-depth2space-test.c
+++ b/libavfilter/tests/dnn-layer-depth2space.c
diff --git a/tests/dnn/dnn-layer-mathbinary-test.c b/libavfilter/tests/dnn-layer-mathbinary.c
index 2e41dc1ae7..2e41dc1ae7 100644
--- a/tests/dnn/dnn-layer-mathbinary-test.c
+++ b/libavfilter/tests/dnn-layer-mathbinary.c
diff --git a/tests/dnn/dnn-layer-mathunary-test.c b/libavfilter/tests/dnn-layer-mathunary.c
index 0f84c12960..0f84c12960 100644
--- a/tests/dnn/dnn-layer-mathunary-test.c
+++ b/libavfilter/tests/dnn-layer-mathunary.c
diff --git a/tests/dnn/dnn-layer-maximum-test.c b/libavfilter/tests/dnn-layer-maximum.c
index bf22f3719f..bf22f3719f 100644
--- a/tests/dnn/dnn-layer-maximum-test.c
+++ b/libavfilter/tests/dnn-layer-maximum.c
diff --git a/tests/dnn/dnn-layer-pad-test.c b/libavfilter/tests/dnn-layer-pad.c
index a8443ce3be..a8443ce3be 100644
--- a/tests/dnn/dnn-layer-pad-test.c
+++ b/libavfilter/tests/dnn-layer-pad.c
diff --git a/tests/Makefile b/tests/Makefile
index 1e0345b163..1bf9a7a36b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,3 +1,4 @@
+
THREADS = 1
VREF = tests/vsynth1/00.pgm
AREF = tests/data/asynth1.sw
@@ -10,8 +11,7 @@ FFMPEG=ffmpeg$(PROGSSUF)$(EXESUF)
$(AREF): CMP=
APITESTSDIR := tests/api
-DNNTESTSDIR := tests/dnn
-FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR) $(DNNTESTSDIR)
+FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR)
OUTDIRS += $(FATE_OUTDIRS)
$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
@@ -96,7 +96,6 @@ CONFIG_LARGE_TESTS:=
endif
include $(SRC_PATH)/$(APITESTSDIR)/Makefile
-include $(SRC_PATH)/$(DNNTESTSDIR)/Makefile
include $(SRC_PATH)/tests/fate/acodec.mak
include $(SRC_PATH)/tests/fate/vcodec.mak
diff --git a/tests/dnn/.gitignore b/tests/dnn/.gitignore
deleted file mode 100644
index 03b04d6653..0000000000
--- a/tests/dnn/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/dnn-layer-conv2d-test
-/dnn-layer-depth2space-test
-/dnn-layer-maximum-test
-/dnn-layer-pad-test
-/dnn-layer-mathbinary-test
-/dnn-layer-mathunary-test
-/dnn-layer-avgpool-test
-/dnn-layer-dense-test
diff --git a/tests/dnn/Makefile b/tests/dnn/Makefile
deleted file mode 100644
index ef827520de..0000000000
--- a/tests/dnn/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-DNNTESTPROGS += dnn-layer-pad
-DNNTESTPROGS += dnn-layer-conv2d
-DNNTESTPROGS += dnn-layer-depth2space
-DNNTESTPROGS += dnn-layer-dense
-DNNTESTPROGS += dnn-layer-mathbinary
-DNNTESTPROGS += dnn-layer-maximum
-DNNTESTPROGS += dnn-layer-mathunary
-DNNTESTPROGS += dnn-layer-avgpool
-
-DNNTESTOBJS := $(DNNTESTOBJS:%=$(DNNTESTSDIR)%) $(DNNTESTPROGS:%=$(DNNTESTSDIR)/%-test.o)
-DNNTESTPROGS := $(DNNTESTPROGS:%=$(DNNTESTSDIR)/%-test$(EXESUF))
--include $(wildcard $(DNNTESTOBJS:.o=.d))
-
-$(DNNTESTPROGS): %$(EXESUF): %.o $(FF_STATIC_DEP_LIBS)
- $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(filter %.o,$^) $(FF_STATIC_DEP_LIBS) $(EXTRALIBS-avcodec) $(EXTRALIBS-avfilter) $(EXTRALIBS-avformat) $(EXTRALIBS-avutil) $(EXTRALIBS-swresample) $(EXTRALIBS)
-
-testclean::
- $(RM) $(addprefix $(DNNTESTSDIR)/,$(CLEANSUFFIXES) *-test$(EXESUF))
diff --git a/tests/fate/dnn.mak b/tests/fate/dnn.mak
index ef07ee45f8..a30a2976d9 100644
--- a/tests/fate/dnn.mak
+++ b/tests/fate/dnn.mak
@@ -1,41 +1,43 @@
+DNNTESTSDIR := libavfilter/tests
+
FATE_DNN += fate-dnn-layer-pad
-fate-dnn-layer-pad: $(DNNTESTSDIR)/dnn-layer-pad-test$(EXESUF)
-fate-dnn-layer-pad: CMD = run $(DNNTESTSDIR)/dnn-layer-pad-test$(EXESUF)
+fate-dnn-layer-pad: $(DNNTESTSDIR)/dnn-layer-pad$(EXESUF)
+fate-dnn-layer-pad: CMD = run $(DNNTESTSDIR)/dnn-layer-pad$(EXESUF)
fate-dnn-layer-pad: CMP = null
FATE_DNN += fate-dnn-layer-conv2d
-fate-dnn-layer-conv2d: $(DNNTESTSDIR)/dnn-layer-conv2d-test$(EXESUF)
-fate-dnn-layer-conv2d: CMD = run $(DNNTESTSDIR)/dnn-layer-conv2d-test$(EXESUF)
+fate-dnn-layer-conv2d: $(DNNTESTSDIR)/dnn-layer-conv2d$(EXESUF)
+fate-dnn-layer-conv2d: CMD = run $(DNNTESTSDIR)/dnn-layer-conv2d$(EXESUF)
fate-dnn-layer-conv2d: CMP = null
FATE_DNN += fate-dnn-layer-dense
-fate-dnn-layer-dense: $(DNNTESTSDIR)/dnn-layer-dense-test$(EXESUF)
-fate-dnn-layer-dense: CMD = run $(DNNTESTSDIR)/dnn-layer-dense-test$(EXESUF)
+fate-dnn-layer-dense: $(DNNTESTSDIR)/dnn-layer-dense$(EXESUF)
+fate-dnn-layer-dense: CMD = run $(DNNTESTSDIR)/dnn-layer-dense$(EXESUF)
fate-dnn-layer-dense: CMP = null
FATE_DNN += fate-dnn-layer-depth2space
-fate-dnn-layer-depth2space: $(DNNTESTSDIR)/dnn-layer-depth2space-test$(EXESUF)
-fate-dnn-layer-depth2space: CMD = run $(DNNTESTSDIR)/dnn-layer-depth2space-test$(EXESUF)
+fate-dnn-layer-depth2space: $(DNNTESTSDIR)/dnn-layer-depth2space$(EXESUF)
+fate-dnn-layer-depth2space: CMD = run $(DNNTESTSDIR)/dnn-layer-depth2space$(EXESUF)
fate-dnn-layer-depth2space: CMP = null
FATE_DNN += fate-dnn-layer-mathbinary
-fate-dnn-layer-mathbinary: $(DNNTESTSDIR)/dnn-layer-mathbinary-test$(EXESUF)
-fate-dnn-layer-mathbinary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathbinary-test$(EXESUF)
+fate-dnn-layer-mathbinary: $(DNNTESTSDIR)/dnn-layer-mathbinary$(EXESUF)
+fate-dnn-layer-mathbinary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathbinary$(EXESUF)
fate-dnn-layer-mathbinary: CMP = null
FATE_DNN += fate-dnn-layer-maximum
-fate-dnn-layer-maximum: $(DNNTESTSDIR)/dnn-layer-maximum-test$(EXESUF)
-fate-dnn-layer-maximum: CMD = run $(DNNTESTSDIR)/dnn-layer-maximum-test$(EXESUF)
+fate-dnn-layer-maximum: $(DNNTESTSDIR)/dnn-layer-maximum$(EXESUF)
+fate-dnn-layer-maximum: CMD = run $(DNNTESTSDIR)/dnn-layer-maximum$(EXESUF)
fate-dnn-layer-maximum: CMP = null
FATE_DNN += fate-dnn-layer-mathunary
-fate-dnn-layer-mathunary: $(DNNTESTSDIR)/dnn-layer-mathunary-test$(EXESUF)
-fate-dnn-layer-mathunary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathunary-test$(EXESUF)
+fate-dnn-layer-mathunary: $(DNNTESTSDIR)/dnn-layer-mathunary$(EXESUF)
+fate-dnn-layer-mathunary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathunary$(EXESUF)
fate-dnn-layer-mathunary: CMP = null
FATE_DNN += fate-dnn-layer-avgpool
-fate-dnn-layer-avgpool: $(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)
-fate-dnn-layer-avgpool: CMD = run $(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)
+fate-dnn-layer-avgpool: $(DNNTESTSDIR)/dnn-layer-avgpool$(EXESUF)
+fate-dnn-layer-avgpool: CMD = run $(DNNTESTSDIR)/dnn-layer-avgpool$(EXESUF)
fate-dnn-layer-avgpool: CMP = null
FATE-$(CONFIG_DNN) += $(FATE_DNN)