Skip to content

Commit

Permalink
tests/dnn: Make DNN tests regular libavfilter tests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mkver committed Dec 18, 2021
1 parent 69a45b8 commit c26730e
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 45 deletions.
3 changes: 3 additions & 0 deletions libavfilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions libavfilter/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

THREADS = 1
VREF = tests/vsynth1/00.pgm
AREF = tests/data/asynth1.sw
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions tests/dnn/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions tests/dnn/Makefile

This file was deleted.

34 changes: 18 additions & 16 deletions tests/fate/dnn.mak
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit c26730e

Please sign in to comment.