Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: aduskett at gmail.com <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 6/6] support/testing: add gst1-python test case
Date: Sun, 15 Mar 2020 13:10:33 -0700	[thread overview]
Message-ID: <20200315201034.1552960-6-aduskett@gmail.com> (raw)
In-Reply-To: <20200315201034.1552960-1-aduskett@gmail.com>

From: Adam Duskett <Aduskett@gmail.com>

This test case runs a simple pipeline for 100 frames to ensure that
gst1-python works properly.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 .gitlab-ci.yml                                |  1 +
 DEVELOPERS                                    |  1 +
 .../tests/package/sample_gst1_python.py       | 21 ++++++++++++++
 .../testing/tests/package/test_gst1_python.py | 29 +++++++++++++++++++
 4 files changed, 52 insertions(+)
 create mode 100644 support/testing/tests/package/sample_gst1_python.py
 create mode 100644 support/testing/tests/package/test_gst1_python.py

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4b84a5b709..e6363014e9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -383,6 +383,7 @@ tests.package.test_crudini.TestCrudiniPy3: { extends: .runtime_test }
 tests.package.test_docker_compose.TestDockerCompose: { extends: .runtime_test }
 tests.package.test_dropbear.TestDropbear: { extends: .runtime_test }
 tests.package.test_glxinfo.TestGlxinfo: { extends: .runtime_test }
+tests.package.test_gst1_python.TestGst1Python: { extends: .runtime_test }
 tests.package.test_ipython.TestIPythonPy3: { extends: .runtime_test }
 tests.package.test_libftdi1.TestPythonPy2Libftdi1: { extends: .runtime_test }
 tests.package.test_libftdi1.TestPythonPy3Libftdi1: { extends: .runtime_test }
diff --git a/DEVELOPERS b/DEVELOPERS
index 36b7f618aa..ec33506c08 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -85,6 +85,7 @@ F:	package/setools/
 F:	package/sngrep/
 F:	package/spidermonkey/
 F:	package/systemd/
+F:	support/testing/tests/package/test_gst1_python.py
 F:	support/testing/tests/package/test_python_gobject.py
 
 N:	Adam Heinrich <adam@adamh.cz>
diff --git a/support/testing/tests/package/sample_gst1_python.py b/support/testing/tests/package/sample_gst1_python.py
new file mode 100644
index 0000000000..41eccbe5fd
--- /dev/null
+++ b/support/testing/tests/package/sample_gst1_python.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+"""A simple test that uses gst1-python to run a fake videotestsrc for 100 frames"""
+import sys
+import gi
+import time
+gi.require_version('Gst', '1.0')
+from gi.repository import Gst, GLib
+
+
+def main():
+    # Initializes Gstreamer
+    Gst.init(sys.argv)
+    pipeline = Gst.parse_launch("videotestsrc num-buffers=100 ! autovideosink")
+    bus = pipeline.get_bus()
+    bus.add_signal_watch()
+    pipeline.set_state(Gst.State.PLAYING)
+    loop = GLib.MainLoop()
+    bus.connect("message", on_message, loop)
+    loop.run()
+    pipeline.set_state(Gst.State.EOS)
+    exit(0)
\ No newline at end of file
diff --git a/support/testing/tests/package/test_gst1_python.py b/support/testing/tests/package/test_gst1_python.py
new file mode 100644
index 0000000000..8d6efcbe4a
--- /dev/null
+++ b/support/testing/tests/package/test_gst1_python.py
@@ -0,0 +1,29 @@
+import os
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestGst1Python(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        BR2_cortex_a9=y
+        BR2_ARM_ENABLE_VFP=y
+        BR2_ARM_EABIHF=y
+        BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM=y
+        BR2_PACKAGE_GOBJECT_INTROSPECTION=y
+        BR2_PACKAGE_GSTREAMER1=y
+        BR2_PACKAGE_GST1_PYTHON=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_GOBJECT=y
+        """
+
+    def login(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv7",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+    sample_scripts = ["tests/package/sample_gst1_python.py"]
+
-- 
2.24.1

  parent reply	other threads:[~2020-03-15 20:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-15 20:10 [Buildroot] [PATCH 1/6] package/gstreamer1/gstreamer1: add introspection support aduskett at gmail.com
2020-03-15 20:10 ` [Buildroot] [PATCH 2/6] package/gstreamer1/gst1-plugins-base: " aduskett at gmail.com
2020-03-15 20:10 ` [Buildroot] [PATCH 3/6] package/gstreamer1/gst1-plugins-bad: " aduskett at gmail.com
2020-03-15 20:10 ` [Buildroot] [PATCH 4/6] package/gstreamer1/gst1-rtsp-server: " aduskett at gmail.com
2020-03-15 20:10 ` [Buildroot] [PATCH 5/6] package/gstreamer1/gst1-python: new package aduskett at gmail.com
2020-03-15 20:42   ` Adam Duskett
2020-03-15 20:10 ` aduskett at gmail.com [this message]
2020-03-22 13:19 ` [Buildroot] [PATCH 1/6] package/gstreamer1/gstreamer1: add introspection support Yann E. MORIN

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=20200315201034.1552960-6-aduskett@gmail.com \
    --to=aduskett@gmail.com \
    --cc=buildroot@busybox.net \
    /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