All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/testing: add test for python-distro
@ 2022-01-30 17:21 Julien Olivain
  2022-02-12 12:51 ` Arnout Vandecappelle
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain @ 2022-01-30 17:21 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain, Ricardo Martincoski

This commit add a simple test checking the reported distro name and
id are Buildroot (as reported by /etc/os-release).

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 DEVELOPERS                                    |  2 ++
 .../tests/package/sample_python_distro.py     |  4 ++++
 .../tests/package/test_python_distro.py       | 21 +++++++++++++++++++
 3 files changed, 27 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_distro.py
 create mode 100644 support/testing/tests/package/test_python_distro.py

diff --git a/DEVELOPERS b/DEVELOPERS
index e17803f38a..368f95796b 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1612,7 +1612,9 @@ F:	package/python-gnupg/
 F:	package/python-pyalsa/
 F:	package/riscv-isa-sim/
 F:	package/zynaddsubfx/
+F:	support/testing/tests/package/sample_python_distro.py
 F:	support/testing/tests/package/sample_python_gnupg.py
+F:	support/testing/tests/package/test_python_distro.py
 F:	support/testing/tests/package/test_python_gnupg.py
 
 N:	Julien Viard de Galbert <julien@vdg.name>
diff --git a/support/testing/tests/package/sample_python_distro.py b/support/testing/tests/package/sample_python_distro.py
new file mode 100644
index 0000000000..b31f129718
--- /dev/null
+++ b/support/testing/tests/package/sample_python_distro.py
@@ -0,0 +1,4 @@
+import distro
+
+assert(distro.name() == 'Buildroot')
+assert(distro.id() == 'buildroot')
diff --git a/support/testing/tests/package/test_python_distro.py b/support/testing/tests/package/test_python_distro.py
new file mode 100644
index 0000000000..943b29e47e
--- /dev/null
+++ b/support/testing/tests/package/test_python_distro.py
@@ -0,0 +1,21 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy2Distro(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON=y
+        BR2_PACKAGE_PYTHON_DISTRO=y
+        """
+    sample_scripts = ["tests/package/sample_python_distro.py"]
+
+
+class TestPythonPy3Distro(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_DISTRO=y
+        """
+    sample_scripts = ["tests/package/sample_python_distro.py"]
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] support/testing: add test for python-distro
  2022-01-30 17:21 [Buildroot] [PATCH 1/1] support/testing: add test for python-distro Julien Olivain
@ 2022-02-12 12:51 ` Arnout Vandecappelle
  0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2022-02-12 12:51 UTC (permalink / raw)
  To: Julien Olivain, buildroot; +Cc: Ricardo Martincoski



On 30/01/2022 18:21, Julien Olivain wrote:
> This commit add a simple test checking the reported distro name and
> id are Buildroot (as reported by /etc/os-release).
> 
> Signed-off-by: Julien Olivain <ju.o@free.fr>

  Applied to master, thanks. I removed the python2 part of course.

  Regards,
  Arnout

> ---
>   DEVELOPERS                                    |  2 ++
>   .../tests/package/sample_python_distro.py     |  4 ++++
>   .../tests/package/test_python_distro.py       | 21 +++++++++++++++++++
>   3 files changed, 27 insertions(+)
>   create mode 100644 support/testing/tests/package/sample_python_distro.py
>   create mode 100644 support/testing/tests/package/test_python_distro.py
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index e17803f38a..368f95796b 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1612,7 +1612,9 @@ F:	package/python-gnupg/
>   F:	package/python-pyalsa/
>   F:	package/riscv-isa-sim/
>   F:	package/zynaddsubfx/
> +F:	support/testing/tests/package/sample_python_distro.py
>   F:	support/testing/tests/package/sample_python_gnupg.py
> +F:	support/testing/tests/package/test_python_distro.py
>   F:	support/testing/tests/package/test_python_gnupg.py
>   
>   N:	Julien Viard de Galbert <julien@vdg.name>
> diff --git a/support/testing/tests/package/sample_python_distro.py b/support/testing/tests/package/sample_python_distro.py
> new file mode 100644
> index 0000000000..b31f129718
> --- /dev/null
> +++ b/support/testing/tests/package/sample_python_distro.py
> @@ -0,0 +1,4 @@
> +import distro
> +
> +assert(distro.name() == 'Buildroot')
> +assert(distro.id() == 'buildroot')
> diff --git a/support/testing/tests/package/test_python_distro.py b/support/testing/tests/package/test_python_distro.py
> new file mode 100644
> index 0000000000..943b29e47e
> --- /dev/null
> +++ b/support/testing/tests/package/test_python_distro.py
> @@ -0,0 +1,21 @@
> +from tests.package.test_python import TestPythonPackageBase
> +
> +
> +class TestPythonPy2Distro(TestPythonPackageBase):
> +    __test__ = True
> +    config = TestPythonPackageBase.config + \
> +        """
> +        BR2_PACKAGE_PYTHON=y
> +        BR2_PACKAGE_PYTHON_DISTRO=y
> +        """
> +    sample_scripts = ["tests/package/sample_python_distro.py"]
> +
> +
> +class TestPythonPy3Distro(TestPythonPackageBase):
> +    __test__ = True
> +    config = TestPythonPackageBase.config + \
> +        """
> +        BR2_PACKAGE_PYTHON3=y
> +        BR2_PACKAGE_PYTHON_DISTRO=y
> +        """
> +    sample_scripts = ["tests/package/sample_python_distro.py"]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-12 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-30 17:21 [Buildroot] [PATCH 1/1] support/testing: add test for python-distro Julien Olivain
2022-02-12 12:51 ` Arnout Vandecappelle

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.