Skip to content

Commit

Permalink
test adding multiple input video streams
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Aug 13, 2013
1 parent 748bbad commit f45c872
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 37 deletions.
31 changes: 0 additions & 31 deletions python-api/tests/integrationtests/driver.py

This file was deleted.

6 changes: 3 additions & 3 deletions python-api/tests/integrationtests/test.py
Expand Up @@ -47,9 +47,9 @@
for mode in modes:
print 'composite mode=', mode
test_set_composite_mode(mode)
time.sleep(0.5)

sources.terminate()
time.sleep(0.6)
output.terminate()
sources.terminate_video()
s.terminate()

finally:
Expand Down
41 changes: 41 additions & 0 deletions python-api/tests/integrationtests/test_helpers.py
@@ -0,0 +1,41 @@
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../../")))

from gstswitch.server import Server
from gstswitch.helpers import *
import time

from multiprocessing import Pool

PATH = '/home/hyades/gst/stage/bin/'


class TestTestSourcesPreviews(object):

NUM = 1

def new_video(self, x):
self.sources.new_test_video()

def sourcepreview(self, num, video_port):
self.sources = TestSources(video_port)
p = Pool(num)
p.map(self.new_video, range(num))
time.sleep(2)
self.sources.terminate_video()

def test_sources(self):
video_port = 3000
s = Server(PATH, video_port=video_port)
try:
s.run()
preview = PreviewSinks()
preview.run()
for i in range(self.NUM):
self.sourcepreview(i+10, video_port)
preview.terminate()
s.terminate()
finally:
if s.proc:
s.kill()
13 changes: 10 additions & 3 deletions python-api/tests/integrationtests/test_server.py
Expand Up @@ -10,9 +10,12 @@

PATH = '/home/hyades/gst/stage/bin/'


class TestServerStartStop(object):

def __init__(self, num):
NUM = 5

def startstop(self):
s = Server(path=PATH)
try:
s.run()
Expand All @@ -24,6 +27,10 @@ def __init__(self, num):
if s.proc:
s.kill()
assert s.proc is None
print "Test Failed"


def test_start_stop(self):
for i in range(self.NUM):
self.startstop()
# remove all .data files generated
for f1 in glob.glob(os.getcwd()+'/*.data'):
os.remove(f1)

0 comments on commit f45c872

Please sign in to comment.