diff --git a/.gitignore b/.gitignore index 97d393f..7f926cb 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ imgurbash.sh.* *.data *.log /tools/gst-switch-ptz +test-driver diff --git a/.travis-run.sh b/.travis-run.sh index a09bbcd..e07b88b 100755 --- a/.travis-run.sh +++ b/.travis-run.sh @@ -45,7 +45,7 @@ case $TEST in printf "Tests failed!\n" exit -1 } - coveralls -n -r $HOME/gst-switch-coverage + coveralls -n -r ../tools esac esac || { printf "Failed!\n!\n" diff --git a/.travis-setup.sh b/.travis-setup.sh index 1b805fa..729d9b2 100644 --- a/.travis-setup.sh +++ b/.travis-setup.sh @@ -1,14 +1,15 @@ #! /bin/bash -ex sudo apt-get update -sudo pip install mock -sudo pip install pytest-cov -sudo pip install pytest-pep8 -sudo pip install pylint +sudo pip install mock --upgrade +sudo pip install pytest-cov --upgrade +sudo pip install pytest-pep8 --upgrade +sudo pip install pylint --upgrade sudo apt-get -y install libglib2.0-dev gir1.2-glib-2.0 libgirepository1.0-dev libglib2.0-0 python-gi sudo apt-get -y install gstreamer0.10-plugins-good sudo apt-get -y install python-scipy sudo apt-get -y install ffmpeg || sudo apt-get -y install libav-tools +sudo apt-get -y install libvo-aacenc-dev sudo apt-get -y install autoconf automake autopoint libbz2-dev libdv4-dev libfaac-dev libfaad-dev libgtk-3-dev libmjpegtools-dev libtag1-dev libasound2-dev libtool libvpx-dev libxv-dev libx11-dev libogg-dev libvorbis-dev libopencv-dev libcv-dev libhighgui-dev libv4l-dev pkg-config zlib1g-dev gtk-doc-tools yasm bison flex export PKG_CONFIG_PATH=/usr/lib/pkgconfig/ export LD_LIBRARY_PATH=/usr/lib/ diff --git a/python-api/tests/integrationtests/test_controller.py b/python-api/tests/integrationtests/test_controller.py index e136e0b..41d049e 100644 --- a/python-api/tests/integrationtests/test_controller.py +++ b/python-api/tests/integrationtests/test_controller.py @@ -17,7 +17,7 @@ import subprocess # PATH = os.getenv("HOME") + '/gst/stage/bin/' -PATH = '/usr/bin/' +PATH = '../tools/' class TestEstablishConnection(object): @@ -254,9 +254,9 @@ class VideoFileSink(object): """Sink the video to a file """ - def __init__(self, path, port, filename): - cmd = "{0}/gst-launch-1.0 tcpclientsrc port={1} ! gdpdepay ! jpegenc \ - ! avimux ! filesink location={2}".format(path, port, filename) + def __init__(self, port, filename): + cmd = "gst-launch-1.0 tcpclientsrc port={0} ! gdpdepay ! jpegenc \ + ! avimux ! filesink location={1}".format(port, filename) with open(os.devnull, 'w') as tempf: self.proc = subprocess.Popen( cmd.split(), @@ -288,7 +288,7 @@ def set_composite_mode(self, mode, generate_frames=False): preview.run() out_file = 'output-{0}.data'.format(mode) - video_sink = VideoFileSink(PATH, serv.video_port + 1, out_file) + video_sink = VideoFileSink(serv.video_port + 1, out_file) sources = TestSources(video_port=3000) sources.new_test_video(pattern=4) @@ -421,7 +421,7 @@ def adjust_pip(self, preview = PreviewSinks() preview.run() out_file = "output-{0}.data".format(index) - video_sink = VideoFileSink(PATH, 3001, out_file) + video_sink = VideoFileSink(3001, out_file) sources.new_test_video(pattern=4) sources.new_test_video(pattern=5) controller = Controller() @@ -492,7 +492,7 @@ def switch(self, channel, port, index): preview = PreviewSinks(3001) preview.run() out_file = "output-{0}.data".format(index) - video_sink = VideoFileSink(PATH, 3001, out_file) + video_sink = VideoFileSink(3001, out_file) time.sleep(3) controller = Controller() res = controller.switch(channel, port) @@ -546,7 +546,7 @@ def click_video(self, preview = PreviewSinks() preview.run() out_file = "output-{0}.data".format(index) - video_sink = VideoFileSink(PATH, 3001, out_file) + video_sink = VideoFileSink(3001, out_file) sources.new_test_video(pattern=4) sources.new_test_video(pattern=5) controller = Controller() @@ -615,7 +615,7 @@ def mark_face(self, faces, index, generate_frames=False): preview = PreviewSinks() preview.run() out_file = "output-{0}.data".format(index) - video_sink = VideoFileSink(PATH, 3001, out_file) + video_sink = VideoFileSink(3001, out_file) sources.new_test_video(pattern=4) sources.new_test_video(pattern=5) controller = Controller() @@ -678,7 +678,7 @@ def mark_tracking(self, faces, index, generate_frames=False): preview = PreviewSinks() preview.run() out_file = "output-{0}.data".format(index) - video_sink = VideoFileSink(PATH, 3001, out_file) + video_sink = VideoFileSink(3001, out_file) sources.new_test_video(pattern=4) sources.new_test_video(pattern=5) controller = Controller() diff --git a/python-api/tests/integrationtests/test_helpers.py b/python-api/tests/integrationtests/test_helpers.py index cc67f9b..aa73378 100644 --- a/python-api/tests/integrationtests/test_helpers.py +++ b/python-api/tests/integrationtests/test_helpers.py @@ -11,7 +11,7 @@ # PATH = os.getenv("HOME") + '/gst/stage/bin/' -PATH = '/usr/bin/' +PATH = '../tools/' class TestTestSourcesPreviews(object): diff --git a/python-api/tests/integrationtests/test_server.py b/python-api/tests/integrationtests/test_server.py index b03a4d0..5b5feb6 100644 --- a/python-api/tests/integrationtests/test_server.py +++ b/python-api/tests/integrationtests/test_server.py @@ -8,7 +8,7 @@ from gstswitch.server import Server # PATH = os.getenv("HOME") + '/gst/stage/bin/' -PATH = '/usr/bin/' +PATH = '../tools/' class TestServerStartStop(object): diff --git a/python-api/tests/performancetests/performance_dbus.py b/python-api/tests/performancetests/performance_dbus.py index dc65de0..24ceb24 100644 --- a/python-api/tests/performancetests/performance_dbus.py +++ b/python-api/tests/performancetests/performance_dbus.py @@ -12,7 +12,7 @@ from gstswitch.controller import Controller import time -PATH = '/usr/bin/' +PATH = '../tools/'