* [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile
@ 2024-05-26 11:32 Kent Gibson
2024-05-26 11:32 ` [libgpiod][PATCH 1/2] bindings: python: add Testing section to README Kent Gibson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kent Gibson @ 2024-05-26 11:32 UTC (permalink / raw)
To: linux-gpio, brgl; +Cc: Kent Gibson
Recently I couldn't work out how to run the test suite for the Python
bindings. There were two problems, the make target did not run the
tests correctly, and the tests need to be run as root. This series
fixes the Makefile so the tests can be run via the make target, and
documents how to call it as it isn't totally obvious.
Patch 1 adds a Testing section to the README to clarify how to run the
tests.
Patch 2 fixes the python-tests-run make target so it will run the tests
as intended.
Kent Gibson (2):
bindings: python: add Testing section to README
bindings: python: fix python-tests-run make target
bindings/python/Makefile.am | 6 +++---
bindings/python/README.md | 10 ++++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [libgpiod][PATCH 1/2] bindings: python: add Testing section to README
2024-05-26 11:32 [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile Kent Gibson
@ 2024-05-26 11:32 ` Kent Gibson
2024-05-26 11:32 ` [libgpiod][PATCH 2/2] bindings: python: fix python-tests-run make target Kent Gibson
2024-05-28 9:14 ` [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile Bartosz Golaszewski
2 siblings, 0 replies; 4+ messages in thread
From: Kent Gibson @ 2024-05-26 11:32 UTC (permalink / raw)
To: linux-gpio, brgl; +Cc: Kent Gibson
Add a section describing how to run the test suite.
Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
bindings/python/README.md | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/bindings/python/README.md b/bindings/python/README.md
index 325c63d..cb5cee6 100644
--- a/bindings/python/README.md
+++ b/bindings/python/README.md
@@ -102,3 +102,13 @@ with gpiod.request_lines(
time.sleep(1)
```
+## Testing
+
+The test suite for the python bindings can be run by calling:
+
+```
+make python-tests-run
+```
+
+from the `libgpiod/bindings/python` directory as root (necessary to be able
+to create the **gpio-sims** used for testing).
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [libgpiod][PATCH 2/2] bindings: python: fix python-tests-run make target
2024-05-26 11:32 [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile Kent Gibson
2024-05-26 11:32 ` [libgpiod][PATCH 1/2] bindings: python: add Testing section to README Kent Gibson
@ 2024-05-26 11:32 ` Kent Gibson
2024-05-28 9:14 ` [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile Bartosz Golaszewski
2 siblings, 0 replies; 4+ messages in thread
From: Kent Gibson @ 2024-05-26 11:32 UTC (permalink / raw)
To: linux-gpio, brgl; +Cc: Kent Gibson
The python-tests-run target is broken as it does not correctly split
lines. It also calls Python directly rather then through the $PYTHON
variable.
Fix the line splitting and call Python using the $PYTHON variable.
Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
bindings/python/Makefile.am | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 65964c7..c14a6d4 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -13,10 +13,10 @@ python-tests:
$(PYTHON) build_tests.py
python-tests-run:
- PYTHONPATH=$(abs_top_srcdir)/bindings/python
+ PYTHONPATH=$(abs_top_srcdir)/bindings/python \
LD_LIBRARY_PATH=$(abs_top_builddir)/lib/.libs/:\
- $(abs_top_builddir)/tests/gpiosim/.libs/ \
- python3 -B -m tests
+ $(abs_top_builddir)/tests/gpiosim/.libs/ \
+ $(PYTHON) -B -m tests
else
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile
2024-05-26 11:32 [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile Kent Gibson
2024-05-26 11:32 ` [libgpiod][PATCH 1/2] bindings: python: add Testing section to README Kent Gibson
2024-05-26 11:32 ` [libgpiod][PATCH 2/2] bindings: python: fix python-tests-run make target Kent Gibson
@ 2024-05-28 9:14 ` Bartosz Golaszewski
2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2024-05-28 9:14 UTC (permalink / raw)
To: linux-gpio, brgl, Kent Gibson; +Cc: Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Sun, 26 May 2024 19:32:32 +0800, Kent Gibson wrote:
> Recently I couldn't work out how to run the test suite for the Python
> bindings. There were two problems, the make target did not run the
> tests correctly, and the tests need to be run as root. This series
> fixes the Makefile so the tests can be run via the make target, and
> documents how to call it as it isn't totally obvious.
>
> Patch 1 adds a Testing section to the README to clarify how to run the
> tests.
>
> [...]
Applied, thanks!
[1/2] bindings: python: add Testing section to README
commit: 8635780c1c21d7833c960d49a796be5553b3f624
[2/2] bindings: python: fix python-tests-run make target
commit: dee10f08070d97d9dc8b1dfde7576fb1a8d81cc6
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-28 9:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-26 11:32 [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile Kent Gibson
2024-05-26 11:32 ` [libgpiod][PATCH 1/2] bindings: python: add Testing section to README Kent Gibson
2024-05-26 11:32 ` [libgpiod][PATCH 2/2] bindings: python: fix python-tests-run make target Kent Gibson
2024-05-28 9:14 ` [libgpiod][PATCH 0/2] bindings: python: fix running tests via Makefile Bartosz Golaszewski
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.