All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
	Kent Gibson <warthog618@gmail.com>
Cc: linux-gpio@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [libgpiod][PATCH] tools: tests: accept the new gpio-sim label format in test cases
Date: Mon,  6 May 2024 18:25:06 +0200	[thread overview]
Message-ID: <20240506162506.176935-1-brgl@bgdev.pl> (raw)

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Since kernel commit 840a97e2fbaf ("gpio: sim: delimit the fwnode name
with a ":" when generating labels") the gpio-sim automatic labels are
generated by delimiting the device name and the fwnode name with ':'
instead of '-' for better readability. This will break the tests once
linux v6.9 is out. Act in advance and accept both forms.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 tools/gpio-tools-test.bash | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash
index 5ef4ef6..b55c5eb 100755
--- a/tools/gpio-tools-test.bash
+++ b/tools/gpio-tools-test.bash
@@ -304,9 +304,9 @@ test_gpiodetect_all_chips() {
 
 	run_tool gpiodetect
 
-	output_contains_line "$sim0 [${sim0dev}-node0] (4 lines)"
-	output_contains_line "$sim1 [${sim1dev}-node0] (8 lines)"
-	output_contains_line "$sim2 [${sim2dev}-node0] (16 lines)"
+	output_regex_match "$sim0 \[${sim0dev}[-:]node0\] \(4 lines\)"
+	output_regex_match "$sim1 \[${sim1dev}[-:]node0\] \(8 lines\)"
+	output_regex_match "$sim2 \[${sim2dev}[-:]node0\] \(16 lines\)"
 	status_is 0
 
 	# ignoring symlinks
@@ -334,21 +334,21 @@ test_gpiodetect_a_chip() {
 	# by name
 	run_tool gpiodetect $sim0
 
-	output_contains_line "$sim0 [${sim0dev}-node0] (4 lines)"
+	output_regex_match "$sim0 \[${sim0dev}[-:]node0\] \(4 lines\)"
 	num_lines_is 1
 	status_is 0
 
 	# by path
 	run_tool gpiodetect ${GPIOSIM_CHIP_PATH[sim1]}
 
-	output_contains_line "$sim1 [${sim1dev}-node0] (8 lines)"
+	output_regex_match "$sim1 \[${sim1dev}[-:]node0\] \(8 lines\)"
 	num_lines_is 1
 	status_is 0
 
 	# by number
 	run_tool gpiodetect $(gpiosim_chip_number sim2)
 
-	output_contains_line "$sim2 [${sim2dev}-node0] (16 lines)"
+	output_regex_match "$sim2 \[${sim2dev}[-:]node0\] \(16 lines\)"
 	num_lines_is 1
 	status_is 0
 
@@ -356,7 +356,7 @@ test_gpiodetect_a_chip() {
 	gpiosim_chip_symlink sim2 .
 	run_tool gpiodetect $GPIOSIM_CHIP_LINK
 
-	output_contains_line "$sim2 [${sim2dev}-node0] (16 lines)"
+	output_regex_match "$sim2 \[${sim2dev}[-:]node0\] \(16 lines\)"
 	num_lines_is 1
 	status_is 0
 }
@@ -375,9 +375,9 @@ test_gpiodetect_multiple_chips() {
 
 	run_tool gpiodetect $sim0 $sim1 $sim2
 
-	output_contains_line "$sim0 [${sim0dev}-node0] (4 lines)"
-	output_contains_line "$sim1 [${sim1dev}-node0] (8 lines)"
-	output_contains_line "$sim2 [${sim2dev}-node0] (16 lines)"
+	output_regex_match "$sim0 \[${sim0dev}[-:]node0\] \(4 lines\)"
+	output_regex_match "$sim1 \[${sim1dev}[-:]node0\] \(8 lines\)"
+	output_regex_match "$sim2 \[${sim2dev}[-:]node0\] \(16 lines\)"
 	num_lines_is 3
 	status_is 0
 }
-- 
2.40.1


             reply	other threads:[~2024-05-06 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 16:25 Bartosz Golaszewski [this message]
2024-05-07  1:31 ` [libgpiod][PATCH] tools: tests: accept the new gpio-sim label format in test cases Kent Gibson
2024-05-07  9:23 ` Bartosz Golaszewski

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=20240506162506.176935-1-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.