Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/2] tests/dnn: Make DNN tests regular libavfilter tests
Date: Fri, 17 Dec 2021 23:41:42 +0100
Message-ID: <AM7PR03MB66605F3A346933B6BE63CE978F789@AM7PR03MB6660.eurprd03.prod.outlook.com> (raw)
In-Reply-To: <AM7PR03MB6660721B4AB2FF66521FD0A18F769@AM7PR03MB6660.eurprd03.prod.outlook.com>

Andreas Rheinhardt:
> 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>
> ---
>  libavfilter/Makefile                          |  3 ++
>  libavfilter/tests/.gitignore                  |  8 +++++
>  .../tests/dnn-layer-avgpool.c                 |  0
>  .../tests/dnn-layer-conv2d.c                  |  0
>  .../tests/dnn-layer-dense.c                   |  0
>  .../tests/dnn-layer-depth2space.c             |  0
>  .../tests/dnn-layer-mathbinary.c              |  0
>  .../tests/dnn-layer-mathunary.c               |  0
>  .../tests/dnn-layer-maximum.c                 |  0
>  .../tests/dnn-layer-pad.c                     |  0
>  tests/Makefile                                |  5 ++-
>  tests/dnn/.gitignore                          |  8 -----
>  tests/dnn/Makefile                            | 18 ----------
>  tests/fate/dnn.mak                            | 34 ++++++++++---------
>  14 files changed, 31 insertions(+), 45 deletions(-)
>  rename tests/dnn/dnn-layer-avgpool-test.c => libavfilter/tests/dnn-layer-avgpool.c (100%)
>  rename tests/dnn/dnn-layer-conv2d-test.c => libavfilter/tests/dnn-layer-conv2d.c (100%)
>  rename tests/dnn/dnn-layer-dense-test.c => libavfilter/tests/dnn-layer-dense.c (100%)
>  rename tests/dnn/dnn-layer-depth2space-test.c => libavfilter/tests/dnn-layer-depth2space.c (100%)
>  rename tests/dnn/dnn-layer-mathbinary-test.c => libavfilter/tests/dnn-layer-mathbinary.c (100%)
>  rename tests/dnn/dnn-layer-mathunary-test.c => libavfilter/tests/dnn-layer-mathunary.c (100%)
>  rename tests/dnn/dnn-layer-maximum-test.c => libavfilter/tests/dnn-layer-maximum.c (100%)
>  rename tests/dnn/dnn-layer-pad-test.c => libavfilter/tests/dnn-layer-pad.c (100%)
>  delete mode 100644 tests/dnn/.gitignore
>  delete mode 100644 tests/dnn/Makefile
> 
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index f4f077af46..d39fab2304 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -587,6 +587,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
> similarity index 100%
> rename from tests/dnn/dnn-layer-avgpool-test.c
> rename to libavfilter/tests/dnn-layer-avgpool.c
> diff --git a/tests/dnn/dnn-layer-conv2d-test.c b/libavfilter/tests/dnn-layer-conv2d.c
> similarity index 100%
> rename from tests/dnn/dnn-layer-conv2d-test.c
> rename to libavfilter/tests/dnn-layer-conv2d.c
> diff --git a/tests/dnn/dnn-layer-dense-test.c b/libavfilter/tests/dnn-layer-dense.c
> similarity index 100%
> rename from tests/dnn/dnn-layer-dense-test.c
> rename to libavfilter/tests/dnn-layer-dense.c
> diff --git a/tests/dnn/dnn-layer-depth2space-test.c b/libavfilter/tests/dnn-layer-depth2space.c
> similarity index 100%
> rename from tests/dnn/dnn-layer-depth2space-test.c
> rename to libavfilter/tests/dnn-layer-depth2space.c
> diff --git a/tests/dnn/dnn-layer-mathbinary-test.c b/libavfilter/tests/dnn-layer-mathbinary.c
> similarity index 100%
> rename from tests/dnn/dnn-layer-mathbinary-test.c
> rename to libavfilter/tests/dnn-layer-mathbinary.c
> diff --git a/tests/dnn/dnn-layer-mathunary-test.c b/libavfilter/tests/dnn-layer-mathunary.c
> similarity index 100%
> rename from tests/dnn/dnn-layer-mathunary-test.c
> rename to libavfilter/tests/dnn-layer-mathunary.c
> diff --git a/tests/dnn/dnn-layer-maximum-test.c b/libavfilter/tests/dnn-layer-maximum.c
> similarity index 100%
> rename from tests/dnn/dnn-layer-maximum-test.c
> rename to libavfilter/tests/dnn-layer-maximum.c
> diff --git a/tests/dnn/dnn-layer-pad-test.c b/libavfilter/tests/dnn-layer-pad.c
> similarity index 100%
> rename from tests/dnn/dnn-layer-pad-test.c
> rename to 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)
> 

Will apply this tomorrow unless there are objections.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      parent reply	other threads:[~2021-12-17 22:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 15:52 Andreas Rheinhardt
2021-12-15 15:53 ` [FFmpeg-devel] [PATCH 2/2] avcodec/tests: Update .gitignore file Andreas Rheinhardt
2021-12-17 22:41 ` Andreas Rheinhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM7PR03MB66605F3A346933B6BE63CE978F789@AM7PR03MB6660.eurprd03.prod.outlook.com \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git