From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
Kent Gibson <warthog618@gmail.com>,
Vincent Fazio <vfazio@xes-inc.com>,
Erik Wierich <erik@riscstar.com>,
Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH libgpiod 4/7] tests: update library API version string tests
Date: Wed, 03 Sep 2025 15:02:02 +0200 [thread overview]
Message-ID: <20250903-api-version-detach-v1-4-027ca5928518@linaro.org> (raw)
In-Reply-To: <20250903-api-version-detach-v1-0-027ca5928518@linaro.org>
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
The version string returned by gpiod_api_version() is now stricter and
will always be of the form: x.y.z where x, y and z are unsigned integer
numbers. We no longer have to parse various suffixes so update the test
cases tree-wide.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/cxx/tests/tests-misc.cpp | 2 +-
bindings/glib/tests/tests-misc.c | 2 +-
bindings/python/tests/tests_module.py | 2 +-
tests/tests-misc.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/bindings/cxx/tests/tests-misc.cpp b/bindings/cxx/tests/tests-misc.cpp
index 33fc3faf029d7969f547f5c528abee6bd9f02020..8fef2e18f9dd494cdd0818bd3d2225111a869871 100644
--- a/bindings/cxx/tests/tests-misc.cpp
+++ b/bindings/cxx/tests/tests-misc.cpp
@@ -71,7 +71,7 @@ TEST_CASE("api_version() returns a valid API version", "[misc]")
SECTION("check api_version() format")
{
REQUIRE_THAT(::gpiod::api_version(),
- regex_matcher("^\\d+\\.\\d+(\\.\\d+|\\-devel|\\-rc\\d+)?$"));
+ regex_matcher("^\\d+\\.\\d+\\.\\d+"));
}
}
diff --git a/bindings/glib/tests/tests-misc.c b/bindings/glib/tests/tests-misc.c
index 356e408ec4c2240bb2211d2a064f85794da625fa..37f9d6849f9f8dc7155cc22d51dd5bda8bc5e4c2 100644
--- a/bindings/glib/tests/tests-misc.c
+++ b/bindings/glib/tests/tests-misc.c
@@ -56,7 +56,7 @@ GPIOD_TEST_CASE(is_gpiochip_link_good)
GPIOD_TEST_CASE(version_string)
{
- static const gchar *const pattern = "^\\d+\\.\\d+(\\.\\d+|\\-devel|\\-rc\\d+)?$";
+ static const gchar *const pattern = "^\\d+\\.\\d+\\.\\d+";
g_autoptr(GError) err = NULL;
g_autoptr(GRegex) regex = NULL;
diff --git a/bindings/python/tests/tests_module.py b/bindings/python/tests/tests_module.py
index 7120c6346ba4666adb250d0880d5777dbb7666ea..406bfe7c4c486bce34848246e2e58ce028cfde4a 100644
--- a/bindings/python/tests/tests_module.py
+++ b/bindings/python/tests/tests_module.py
@@ -50,7 +50,7 @@ class IsGPIOChip(TestCase):
class VersionString(TestCase):
- VERSION_PATTERN = "^\\d+\\.\\d+(\\.\\d+|\\-devel|\\-rc\\d+)?$"
+ VERSION_PATTERN = "^\\d+\\.\\d+\\.\\d+$"
def test_api_version_string(self) -> None:
self.assertRegex(gpiod.api_version, VersionString.VERSION_PATTERN)
diff --git a/tests/tests-misc.c b/tests/tests-misc.c
index 9d4f3dedbae6f0e415d85be52d7b47dad01cce43..00f3272d2ebc199801792209b428503912b97309 100644
--- a/tests/tests-misc.c
+++ b/tests/tests-misc.c
@@ -68,7 +68,7 @@ GPIOD_TEST_CASE(is_gpiochip_null_path)
GPIOD_TEST_CASE(version_string)
{
- static const gchar *const pattern = "^\\d+\\.\\d+(\\.\\d+|\\-devel|\\-rc\\d+)?$";
+ static const gchar *const pattern = "^\\d+\\.\\d+\\.\\d+";
g_autoptr(GError) err = NULL;
g_autoptr(GRegex) regex = NULL;
--
2.48.1
next prev parent reply other threads:[~2025-09-03 13:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 13:01 [PATCH libgpiod 0/7] build: detach the libgpiod API version from the libgpiod package version Bartosz Golaszewski
2025-09-03 13:01 ` [PATCH libgpiod 1/7] bindings: cxx: move misc.hpp inclusion to the correct place Bartosz Golaszewski
2025-09-03 13:02 ` [PATCH libgpiod 2/7] build: define a separate API version for the core C library Bartosz Golaszewski
2025-09-03 13:02 ` [PATCH libgpiod 3/7] core: change the behavior of gpiod_api_version() Bartosz Golaszewski
2025-09-03 13:02 ` Bartosz Golaszewski [this message]
2025-09-03 13:02 ` [PATCH libgpiod 5/7] tools: display C API *and* libgpiod package version for '-v' Bartosz Golaszewski
2025-09-03 13:02 ` [PATCH libgpiod 6/7] dbus: manager: " Bartosz Golaszewski
2025-09-03 13:02 ` [PATCH libgpiod 7/7] dbus: gpiocli: display the libgpiod package version for --version Bartosz Golaszewski
2025-09-04 6:13 ` [PATCH libgpiod 0/7] build: detach the libgpiod API version from the libgpiod package version Erik Schilling
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=20250903-api-version-detach-v1-4-027ca5928518@linaro.org \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=erik@riscstar.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=vfazio@xes-inc.com \
--cc=viresh.kumar@linaro.org \
--cc=warthog618@gmail.com \
/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).