History

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.

Andreas Rheinhardt committed 4 years ago

Commit c26730e1 parent 69a45b814 files · +31 −45Browse files

Unified · Split

14 files
  1. libavfilter/Makefile +3 −0
  2. libavfilter/tests/.gitignore +8 −0
  3. libavfilter/tests/dnn-layer-avgpool.c +0 −0
  4. libavfilter/tests/dnn-layer-conv2d.c +0 −0
  5. libavfilter/tests/dnn-layer-dense.c +0 −0
  6. libavfilter/tests/dnn-layer-depth2space.c +0 −0
  7. libavfilter/tests/dnn-layer-mathbinary.c +0 −0
  8. libavfilter/tests/dnn-layer-mathunary.c +0 −0
  9. libavfilter/tests/dnn-layer-maximum.c +0 −0
  10. libavfilter/tests/dnn-layer-pad.c +0 −0
  11. tests/Makefile +2 −3
  12. tests/dnn/.gitignore +0 −8
  13. tests/dnn/Makefile +0 −18
  14. tests/fate/dnn.mak +18 −16
libavfilter/Makefile+3−0
@@ -590,6 +590,9 @@ SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_filter.h · 589 unmodified lines
590 590
591TOOLS = graph2dot591TOOLS = graph2dot
592TESTPROGS = drawutils filtfmts formats integral592TESTPROGS = drawutils filtfmts formats integral
593TESTPROGS-$(CONFIG_DNN) += dnn-layer-avgpool dnn-layer-conv2d dnn-layer-dense \
594 dnn-layer-depth2space dnn-layer-mathbinary \
595 dnn-layer-mathunary dnn-layer-maximum dnn-layer-pad \
593 596
594TOOLS-$(CONFIG_LIBZMQ) += zmqsend597TOOLS-$(CONFIG_LIBZMQ) += zmqsend
595 598
libavfilter/tests/.gitignore+8−0
@@ -1,3 +1,11 @@
1/dnn-layer-conv2d
2/dnn-layer-depth2space
3/dnn-layer-maximum
4/dnn-layer-pad
5/dnn-layer-mathbinary
6/dnn-layer-mathunary
7/dnn-layer-avgpool
8/dnn-layer-dense
1/drawutils9/drawutils
2/filtfmts10/filtfmts
3/formats11/formats
libavfilter/tests/dnn-layer-avgpool.crenamed from tests/dnn/dnn-layer-avgpool-test.c+0−0

File renamed without changes.

libavfilter/tests/dnn-layer-conv2d.crenamed from tests/dnn/dnn-layer-conv2d-test.c+0−0

File renamed without changes.

libavfilter/tests/dnn-layer-dense.crenamed from tests/dnn/dnn-layer-dense-test.c+0−0

File renamed without changes.

libavfilter/tests/dnn-layer-depth2space.crenamed from tests/dnn/dnn-layer-depth2space-test.c+0−0

File renamed without changes.

libavfilter/tests/dnn-layer-mathbinary.crenamed from tests/dnn/dnn-layer-mathbinary-test.c+0−0

File renamed without changes.

libavfilter/tests/dnn-layer-mathunary.crenamed from tests/dnn/dnn-layer-mathunary-test.c+0−0

File renamed without changes.

libavfilter/tests/dnn-layer-maximum.crenamed from tests/dnn/dnn-layer-maximum-test.c+0−0

File renamed without changes.

libavfilter/tests/dnn-layer-pad.crenamed from tests/dnn/dnn-layer-pad-test.c+0−0

File renamed without changes.

tests/Makefile+2−3
@@ -1,3 +1,4 @@
1
1THREADS = 12THREADS = 1
2VREF = tests/vsynth1/00.pgm3VREF = tests/vsynth1/00.pgm
3AREF = tests/data/asynth1.sw4AREF = tests/data/asynth1.sw
@@ -10,8 +11,7 @@ FFMPEG=ffmpeg$(PROGSSUF)$(EXESUF) · 6 unmodified lines
10$(AREF): CMP=11$(AREF): CMP=
11 12
12APITESTSDIR := tests/api13APITESTSDIR := tests/api
13DNNTESTSDIR := tests/dnn14FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR)
14FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR) $(DNNTESTSDIR)
15OUTDIRS += $(FATE_OUTDIRS)15OUTDIRS += $(FATE_OUTDIRS)
16 16
17$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth117$(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
@@ -96,7 +96,6 @@ CONFIG_LARGE_TESTS:= · 78 unmodified lines
96endif96endif
97 97
98include $(SRC_PATH)/$(APITESTSDIR)/Makefile98include $(SRC_PATH)/$(APITESTSDIR)/Makefile
99include $(SRC_PATH)/$(DNNTESTSDIR)/Makefile
100 99
101include $(SRC_PATH)/tests/fate/acodec.mak100include $(SRC_PATH)/tests/fate/acodec.mak
102include $(SRC_PATH)/tests/fate/vcodec.mak101include $(SRC_PATH)/tests/fate/vcodec.mak
tests/dnn/.gitignore+0−8
@@ -1,8 +0,0 @@
1/dnn-layer-conv2d-test
2/dnn-layer-depth2space-test
3/dnn-layer-maximum-test
4/dnn-layer-pad-test
5/dnn-layer-mathbinary-test
6/dnn-layer-mathunary-test
7/dnn-layer-avgpool-test
8/dnn-layer-dense-test
tests/dnn/Makefile+0−18
@@ -1,18 +0,0 @@
1DNNTESTPROGS += dnn-layer-pad
2DNNTESTPROGS += dnn-layer-conv2d
3DNNTESTPROGS += dnn-layer-depth2space
4DNNTESTPROGS += dnn-layer-dense
5DNNTESTPROGS += dnn-layer-mathbinary
6DNNTESTPROGS += dnn-layer-maximum
7DNNTESTPROGS += dnn-layer-mathunary
8DNNTESTPROGS += dnn-layer-avgpool
9
10DNNTESTOBJS := $(DNNTESTOBJS:%=$(DNNTESTSDIR)%) $(DNNTESTPROGS:%=$(DNNTESTSDIR)/%-test.o)
11DNNTESTPROGS := $(DNNTESTPROGS:%=$(DNNTESTSDIR)/%-test$(EXESUF))
12-include $(wildcard $(DNNTESTOBJS:.o=.d))
13
14$(DNNTESTPROGS): %$(EXESUF): %.o $(FF_STATIC_DEP_LIBS)
15 $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(filter %.o,$^) $(FF_STATIC_DEP_LIBS) $(EXTRALIBS-avcodec) $(EXTRALIBS-avfilter) $(EXTRALIBS-avformat) $(EXTRALIBS-avutil) $(EXTRALIBS-swresample) $(EXTRALIBS)
16
17testclean::
18 $(RM) $(addprefix $(DNNTESTSDIR)/,$(CLEANSUFFIXES) *-test$(EXESUF))
tests/fate/dnn.mak+18−16
@@ -1,41 +1,43 @@
1DNNTESTSDIR := libavfilter/tests
2
1FATE_DNN += fate-dnn-layer-pad3FATE_DNN += fate-dnn-layer-pad
2fate-dnn-layer-pad: $(DNNTESTSDIR)/dnn-layer-pad-test$(EXESUF)4fate-dnn-layer-pad: $(DNNTESTSDIR)/dnn-layer-pad$(EXESUF)
3fate-dnn-layer-pad: CMD = run $(DNNTESTSDIR)/dnn-layer-pad-test$(EXESUF)5fate-dnn-layer-pad: CMD = run $(DNNTESTSDIR)/dnn-layer-pad$(EXESUF)
4fate-dnn-layer-pad: CMP = null6fate-dnn-layer-pad: CMP = null
5 7
6FATE_DNN += fate-dnn-layer-conv2d8FATE_DNN += fate-dnn-layer-conv2d
7fate-dnn-layer-conv2d: $(DNNTESTSDIR)/dnn-layer-conv2d-test$(EXESUF)9fate-dnn-layer-conv2d: $(DNNTESTSDIR)/dnn-layer-conv2d$(EXESUF)
8fate-dnn-layer-conv2d: CMD = run $(DNNTESTSDIR)/dnn-layer-conv2d-test$(EXESUF)10fate-dnn-layer-conv2d: CMD = run $(DNNTESTSDIR)/dnn-layer-conv2d$(EXESUF)
9fate-dnn-layer-conv2d: CMP = null11fate-dnn-layer-conv2d: CMP = null
10 12
11FATE_DNN += fate-dnn-layer-dense13FATE_DNN += fate-dnn-layer-dense
12fate-dnn-layer-dense: $(DNNTESTSDIR)/dnn-layer-dense-test$(EXESUF)14fate-dnn-layer-dense: $(DNNTESTSDIR)/dnn-layer-dense$(EXESUF)
13fate-dnn-layer-dense: CMD = run $(DNNTESTSDIR)/dnn-layer-dense-test$(EXESUF)15fate-dnn-layer-dense: CMD = run $(DNNTESTSDIR)/dnn-layer-dense$(EXESUF)
14fate-dnn-layer-dense: CMP = null16fate-dnn-layer-dense: CMP = null
15 17
16FATE_DNN += fate-dnn-layer-depth2space18FATE_DNN += fate-dnn-layer-depth2space
17fate-dnn-layer-depth2space: $(DNNTESTSDIR)/dnn-layer-depth2space-test$(EXESUF)19fate-dnn-layer-depth2space: $(DNNTESTSDIR)/dnn-layer-depth2space$(EXESUF)
18fate-dnn-layer-depth2space: CMD = run $(DNNTESTSDIR)/dnn-layer-depth2space-test$(EXESUF)20fate-dnn-layer-depth2space: CMD = run $(DNNTESTSDIR)/dnn-layer-depth2space$(EXESUF)
19fate-dnn-layer-depth2space: CMP = null21fate-dnn-layer-depth2space: CMP = null
20 22
21FATE_DNN += fate-dnn-layer-mathbinary23FATE_DNN += fate-dnn-layer-mathbinary
22fate-dnn-layer-mathbinary: $(DNNTESTSDIR)/dnn-layer-mathbinary-test$(EXESUF)24fate-dnn-layer-mathbinary: $(DNNTESTSDIR)/dnn-layer-mathbinary$(EXESUF)
23fate-dnn-layer-mathbinary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathbinary-test$(EXESUF)25fate-dnn-layer-mathbinary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathbinary$(EXESUF)
24fate-dnn-layer-mathbinary: CMP = null26fate-dnn-layer-mathbinary: CMP = null
25 27
26FATE_DNN += fate-dnn-layer-maximum28FATE_DNN += fate-dnn-layer-maximum
27fate-dnn-layer-maximum: $(DNNTESTSDIR)/dnn-layer-maximum-test$(EXESUF)29fate-dnn-layer-maximum: $(DNNTESTSDIR)/dnn-layer-maximum$(EXESUF)
28fate-dnn-layer-maximum: CMD = run $(DNNTESTSDIR)/dnn-layer-maximum-test$(EXESUF)30fate-dnn-layer-maximum: CMD = run $(DNNTESTSDIR)/dnn-layer-maximum$(EXESUF)
29fate-dnn-layer-maximum: CMP = null31fate-dnn-layer-maximum: CMP = null
30 32
31FATE_DNN += fate-dnn-layer-mathunary33FATE_DNN += fate-dnn-layer-mathunary
32fate-dnn-layer-mathunary: $(DNNTESTSDIR)/dnn-layer-mathunary-test$(EXESUF)34fate-dnn-layer-mathunary: $(DNNTESTSDIR)/dnn-layer-mathunary$(EXESUF)
33fate-dnn-layer-mathunary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathunary-test$(EXESUF)35fate-dnn-layer-mathunary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathunary$(EXESUF)
34fate-dnn-layer-mathunary: CMP = null36fate-dnn-layer-mathunary: CMP = null
35 37
36FATE_DNN += fate-dnn-layer-avgpool38FATE_DNN += fate-dnn-layer-avgpool
37fate-dnn-layer-avgpool: $(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)39fate-dnn-layer-avgpool: $(DNNTESTSDIR)/dnn-layer-avgpool$(EXESUF)
38fate-dnn-layer-avgpool: CMD = run $(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)40fate-dnn-layer-avgpool: CMD = run $(DNNTESTSDIR)/dnn-layer-avgpool$(EXESUF)
39fate-dnn-layer-avgpool: CMP = null41fate-dnn-layer-avgpool: CMP = null
40 42
41FATE-$(CONFIG_DNN) += $(FATE_DNN)43FATE-$(CONFIG_DNN) += $(FATE_DNN)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t