This commit is contained in:
Akkariin Meiko
2022-03-12 03:16:09 +08:00
Unverified
parent 12b76e0c7a
commit 27c4ec74a1
10075 changed files with 5122287 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
gst_python = subproject('gst-python', required: false)
gir = find_program('g-ir-scanner', required : get_option('introspection'))
if not gst_python.found() or not gir.found()
message('Not running python devenv tests: gst_python: @0@ gir: @1@'.format(gst_python.found(), gir.found()))
subdir_done()
endif
root_rel = '../..'
python = import('python').find_installation()
if run_command(python, '-c', 'import gi', check: false).returncode() != 0
message('PyGObject not found, not running PyGObject tests')
subdir_done()
endif
test('python-overrides-devenv', setenv, args: ['--builddir=@0@'.format(meson.project_build_root()),
'--srcdir=@0@'.format(meson.project_source_root()),
meson.current_source_dir() / 'python-devenv-overrides.py'])
env = environment()
env.set('GI_TYPELIB_PATH', meson.current_build_dir() / root_rel)
if build_machine.system() == 'windows'
env.append('PATH', meson.current_build_dir() / root_rel)
elif build_machine.system() == 'linux'
env.append('LD_LIBRARY_PATH', meson.current_build_dir() / root_rel)
else
env.append('DYLD_LIBRARY_PATH', meson.current_build_dir() / root_rel)
endif
env.set('GST_OVERRIDE_SRC_PATH', meson.current_source_dir() / root_rel / 'subprojects/gst-python/gi/overrides')
env.set('GST_OVERRIDE_BUILD_PATH', meson.current_build_dir() / root_rel / 'subprojects/gst-python/gi/overrides')
test('python-full', python, args: [meson.current_source_dir() / 'python-full.py'], env: env)
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/python3
import unittest
from pathlib import Path
from unittest import TestCase
from gi.repository import Gst
class TestBin(TestCase):
def test_overrides(self):
from gi.overrides import Gst
self.assertEqual(Path(Gst.__file__), Path(__file__).parents[2] / "subprojects/gst-python/gi/overrides/Gst.py")
def simple_functional_test(self):
Gst.init(None)
self.assertEqual(Gst.ElementFactory.make("bin", None).sinkpads, [])
self.assertEqual(float(Gst.Fraction(1, 2)), 0.5)
if __name__ == "__main__":
unittest.main()
+22
View File
@@ -0,0 +1,22 @@
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent / "../../subprojects/gst-python/testsuite"))
import overrides_hack
overrides_hack
from common import TestCase, unittest
from gi.repository import Gst
class TestBin(TestCase):
def test(self):
Gst.init(None)
self.assertEqual(Gst.ElementFactory.make("bin", None).sinkpads, [])
self.assertEqual(float(Gst.Fraction(1, 2)), 0.5)
if __name__ == "__main__":
unittest.main()