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
590590
591591 TOOLS = graph2dot
592592 TESTPROGS = drawutils filtfmts formats integral
593+TESTPROGS-$(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 \
593596
594597 TOOLS-$(CONFIG_LIBZMQ) += zmqsend
595598
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
19 /drawutils
210 /filtfmts
311 /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+
12 THREADS = 1
23 VREF = tests/vsynth1/00.pgm
34 AREF = tests/data/asynth1.sw
@@ -10,8 +11,7 @@ FFMPEG=ffmpeg$(PROGSSUF)$(EXESUF) · 6 unmodified lines
1011 $(AREF): CMP=
1112
1213 APITESTSDIR := tests/api
13−DNNTESTSDIR := tests/dnn
14−FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR) $(DNNTESTSDIR)
14+FATE_OUTDIRS = tests/data tests/data/fate tests/data/filtergraphs tests/data/lavf tests/data/lavf-fate tests/data/pixfmt tests/vsynth1 $(APITESTSDIR)
1515 OUTDIRS += $(FATE_OUTDIRS)
1616
1717 $(VREF): tests/videogen$(HOSTEXESUF) | tests/vsynth1
@@ -96,7 +96,6 @@ CONFIG_LARGE_TESTS:= · 78 unmodified lines
9696 endif
9797
9898 include $(SRC_PATH)/$(APITESTSDIR)/Makefile
99−include $(SRC_PATH)/$(DNNTESTSDIR)/Makefile
10099
101100 include $(SRC_PATH)/tests/fate/acodec.mak
102101 include $(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 @@
1−DNNTESTPROGS += dnn-layer-pad
2−DNNTESTPROGS += dnn-layer-conv2d
3−DNNTESTPROGS += dnn-layer-depth2space
4−DNNTESTPROGS += dnn-layer-dense
5−DNNTESTPROGS += dnn-layer-mathbinary
6−DNNTESTPROGS += dnn-layer-maximum
7−DNNTESTPROGS += dnn-layer-mathunary
8−DNNTESTPROGS += dnn-layer-avgpool
9−
10−DNNTESTOBJS := $(DNNTESTOBJS:%=$(DNNTESTSDIR)%) $(DNNTESTPROGS:%=$(DNNTESTSDIR)/%-test.o)
11−DNNTESTPROGS := $(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−
17−testclean::
18− $(RM) $(addprefix $(DNNTESTSDIR)/,$(CLEANSUFFIXES) *-test$(EXESUF))
tests/fate/dnn.mak+18−16
@@ -1,41 +1,43 @@
1+DNNTESTSDIR := libavfilter/tests
2+
13 FATE_DNN += fate-dnn-layer-pad
2−fate-dnn-layer-pad: $(DNNTESTSDIR)/dnn-layer-pad-test$(EXESUF)
3−fate-dnn-layer-pad: CMD = run $(DNNTESTSDIR)/dnn-layer-pad-test$(EXESUF)
4+fate-dnn-layer-pad: $(DNNTESTSDIR)/dnn-layer-pad$(EXESUF)
5+fate-dnn-layer-pad: CMD = run $(DNNTESTSDIR)/dnn-layer-pad$(EXESUF)
46 fate-dnn-layer-pad: CMP = null
57
68 FATE_DNN += fate-dnn-layer-conv2d
7−fate-dnn-layer-conv2d: $(DNNTESTSDIR)/dnn-layer-conv2d-test$(EXESUF)
8−fate-dnn-layer-conv2d: CMD = run $(DNNTESTSDIR)/dnn-layer-conv2d-test$(EXESUF)
9+fate-dnn-layer-conv2d: $(DNNTESTSDIR)/dnn-layer-conv2d$(EXESUF)
10+fate-dnn-layer-conv2d: CMD = run $(DNNTESTSDIR)/dnn-layer-conv2d$(EXESUF)
911 fate-dnn-layer-conv2d: CMP = null
1012
1113 FATE_DNN += fate-dnn-layer-dense
12−fate-dnn-layer-dense: $(DNNTESTSDIR)/dnn-layer-dense-test$(EXESUF)
13−fate-dnn-layer-dense: CMD = run $(DNNTESTSDIR)/dnn-layer-dense-test$(EXESUF)
14+fate-dnn-layer-dense: $(DNNTESTSDIR)/dnn-layer-dense$(EXESUF)
15+fate-dnn-layer-dense: CMD = run $(DNNTESTSDIR)/dnn-layer-dense$(EXESUF)
1416 fate-dnn-layer-dense: CMP = null
1517
1618 FATE_DNN += fate-dnn-layer-depth2space
17−fate-dnn-layer-depth2space: $(DNNTESTSDIR)/dnn-layer-depth2space-test$(EXESUF)
18−fate-dnn-layer-depth2space: CMD = run $(DNNTESTSDIR)/dnn-layer-depth2space-test$(EXESUF)
19+fate-dnn-layer-depth2space: $(DNNTESTSDIR)/dnn-layer-depth2space$(EXESUF)
20+fate-dnn-layer-depth2space: CMD = run $(DNNTESTSDIR)/dnn-layer-depth2space$(EXESUF)
1921 fate-dnn-layer-depth2space: CMP = null
2022
2123 FATE_DNN += fate-dnn-layer-mathbinary
22−fate-dnn-layer-mathbinary: $(DNNTESTSDIR)/dnn-layer-mathbinary-test$(EXESUF)
23−fate-dnn-layer-mathbinary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathbinary-test$(EXESUF)
24+fate-dnn-layer-mathbinary: $(DNNTESTSDIR)/dnn-layer-mathbinary$(EXESUF)
25+fate-dnn-layer-mathbinary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathbinary$(EXESUF)
2426 fate-dnn-layer-mathbinary: CMP = null
2527
2628 FATE_DNN += fate-dnn-layer-maximum
27−fate-dnn-layer-maximum: $(DNNTESTSDIR)/dnn-layer-maximum-test$(EXESUF)
28−fate-dnn-layer-maximum: CMD = run $(DNNTESTSDIR)/dnn-layer-maximum-test$(EXESUF)
29+fate-dnn-layer-maximum: $(DNNTESTSDIR)/dnn-layer-maximum$(EXESUF)
30+fate-dnn-layer-maximum: CMD = run $(DNNTESTSDIR)/dnn-layer-maximum$(EXESUF)
2931 fate-dnn-layer-maximum: CMP = null
3032
3133 FATE_DNN += fate-dnn-layer-mathunary
32−fate-dnn-layer-mathunary: $(DNNTESTSDIR)/dnn-layer-mathunary-test$(EXESUF)
33−fate-dnn-layer-mathunary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathunary-test$(EXESUF)
34+fate-dnn-layer-mathunary: $(DNNTESTSDIR)/dnn-layer-mathunary$(EXESUF)
35+fate-dnn-layer-mathunary: CMD = run $(DNNTESTSDIR)/dnn-layer-mathunary$(EXESUF)
3436 fate-dnn-layer-mathunary: CMP = null
3537
3638 FATE_DNN += fate-dnn-layer-avgpool
37−fate-dnn-layer-avgpool: $(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)
38−fate-dnn-layer-avgpool: CMD = run $(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)
39+fate-dnn-layer-avgpool: $(DNNTESTSDIR)/dnn-layer-avgpool$(EXESUF)
40+fate-dnn-layer-avgpool: CMD = run $(DNNTESTSDIR)/dnn-layer-avgpool$(EXESUF)
3941 fate-dnn-layer-avgpool: CMP = null
4042
4143 FATE-$(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