linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-gpio@vger.kernel.org
Subject: Re: [libgpiod v2][PATCH v3 3/3] tests: rewrite core C tests using libgpiosim
Date: Sat, 5 Mar 2022 13:51:47 +0800	[thread overview]
Message-ID: <20220305055147.GC9638@sol> (raw)
In-Reply-To: <20220303091836.168223-4-brgl@bgdev.pl>

On Thu, Mar 03, 2022 at 10:18:36AM +0100, Bartosz Golaszewski wrote:
> This replaces the old tests for the C API v1 based on gpio-mockup with
> a test suite based on gpio-sim that covers around 95% of the libgpiod v2
> codebase.
> 
> The test harness has been rebuilt and shrank significantly as well. The
> libgpiosim API has been wrapped in a gobject interface.
> 
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> ---
>  configure.ac                 |    8 +-
>  tests/Makefile.am            |   24 +-
>  tests/gpiod-test-helpers.c   |   49 ++
>  tests/gpiod-test-helpers.h   |  139 +++++
>  tests/gpiod-test-sim.c       |  308 ++++++++++
>  tests/gpiod-test-sim.h       |   42 ++
>  tests/gpiod-test.c           |  233 +-------
>  tests/gpiod-test.h           |   83 +--
>  tests/gpiosim/gpiosim.c      |    1 +
>  tests/mockup/Makefile.am     |   11 -
>  tests/mockup/gpio-mockup.c   |  496 ----------------
>  tests/mockup/gpio-mockup.h   |   36 --
>  tests/tests-chip.c           |  282 ++++-----
>  tests/tests-edge-event.c     |  490 +++++++++++++++
>  tests/tests-event.c          |  908 ----------------------------
>  tests/tests-info-event.c     |  301 ++++++++++
>  tests/tests-line-config.c    |  503 ++++++++++++++++
>  tests/tests-line-info.c      |  318 ++++++++++
>  tests/tests-line-request.c   |  526 ++++++++++++++++
>  tests/tests-line.c           | 1091 ----------------------------------
>  tests/tests-misc.c           |   80 ++-
>  tests/tests-request-config.c |   90 +++
>  22 files changed, 2995 insertions(+), 3024 deletions(-)
>  create mode 100644 tests/gpiod-test-helpers.c
>  create mode 100644 tests/gpiod-test-helpers.h
>  create mode 100644 tests/gpiod-test-sim.c
>  create mode 100644 tests/gpiod-test-sim.h
>  delete mode 100644 tests/mockup/Makefile.am
>  delete mode 100644 tests/mockup/gpio-mockup.c
>  delete mode 100644 tests/mockup/gpio-mockup.h
>  create mode 100644 tests/tests-edge-event.c
>  delete mode 100644 tests/tests-event.c
>  create mode 100644 tests/tests-info-event.c
>  create mode 100644 tests/tests-line-config.c
>  create mode 100644 tests/tests-line-info.c
>  create mode 100644 tests/tests-line-request.c
>  delete mode 100644 tests/tests-line.c
>  create mode 100644 tests/tests-request-config.c
> 
> diff --git a/configure.ac b/configure.ac
> index cb4c1fd..f8d34ed 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -28,9 +28,8 @@ AC_SUBST(VERSION_STR, [$PACKAGE_VERSION$EXTRA_VERSION])
>  AC_SUBST(ABI_VERSION, [4.1.2])
>  # Have a separate ABI version for C++ bindings:
>  AC_SUBST(ABI_CXX_VERSION, [2.1.1])
> -# ABI version for libgpiomockup (we need this since it can be installed if we
> +# ABI version for libgpiosim (we need this since it can be installed if we
>  # enable install-tests).
> -AC_SUBST(ABI_MOCKUP_VERSION, [0.1.0])
>  AC_SUBST(ABI_GPIOSIM_VERSION, [0.1.0])
>  
>  AC_CONFIG_AUX_DIR([autostuff])
> @@ -138,14 +137,14 @@ AC_DEFUN([FUNC_NOT_FOUND_TESTS],
>  
>  if test "x$with_tests" = xtrue
>  then
> -	# For libgpiomockup & libgpiosim
> +	# For libgpiosim
>  	AC_CHECK_FUNC([qsort], [], [FUNC_NOT_FOUND_TESTS([qsort])])
>  	PKG_CHECK_MODULES([KMOD], [libkmod >= 18])
> -	PKG_CHECK_MODULES([UDEV], [libudev >= 215])
>  	PKG_CHECK_MODULES([MOUNT], [mount >= 2.33.1])
>  
>  	# For core library tests
>  	PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.50])
> +	PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.50])
>  
>  	if test "x$with_tools" = xtrue
>  	then
> @@ -236,7 +235,6 @@ AC_CONFIG_FILES([Makefile
>  		 lib/libgpiod.pc
>  		 tools/Makefile
>  		 tests/Makefile
> -		 tests/mockup/Makefile
>  		 tests/gpiosim/Makefile
>  		 bindings/cxx/libgpiodcxx.pc
>  		 bindings/Makefile
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 2b1e082..dce9a5a 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -1,24 +1,32 @@
>  # SPDX-License-Identifier: GPL-2.0-or-later
>  # SPDX-FileCopyrightText: 2017-2022 Bartosz Golaszewski <brgl@bgdev.pl>
>  
> -SUBDIRS = mockup gpiosim
> -
> +SUBDIRS = gpiosim
> + 

Whitespace error.

Other than that all good.

Good to see the randomness removed from the gpio-sim naming.
I would like to see the option removed from libgpiosim as well, but that
is outside the scope of this patch series.

Cheers,
Kent.

      reply	other threads:[~2022-03-05  5:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03  9:18 [libgpiod v2][PATCH v3 0/3] libgpiod v2: rewrite tests for the C library Bartosz Golaszewski
2022-03-03  9:18 ` [libgpiod v2][PATCH v3 1/3] API: add an enum for line values Bartosz Golaszewski
2022-03-05  5:50   ` Kent Gibson
2022-03-03  9:18 ` [libgpiod v2][PATCH v3 2/3] line-config: expose the override logic to users Bartosz Golaszewski
2022-03-05  5:51   ` Kent Gibson
2022-03-05 20:57     ` Bartosz Golaszewski
2022-03-03  9:18 ` [libgpiod v2][PATCH v3 3/3] tests: rewrite core C tests using libgpiosim Bartosz Golaszewski
2022-03-05  5:51   ` Kent Gibson [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=20220305055147.GC9638@sol \
    --to=warthog618@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).