From af5785459388547e0cf4ee616b6ad93d877a91ec Mon Sep 17 00:00:00 2001 From: Aayush Ahuja Date: Sun, 9 Nov 2014 22:19:21 +0530 Subject: [PATCH 1/6] Upgrading packages if available --- .travis-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis-setup.sh b/.travis-setup.sh index c3702eb..c24c642 100644 --- a/.travis-setup.sh +++ b/.travis-setup.sh @@ -1,10 +1,10 @@ #! /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 ffmpeg From 1d7e9d669af408f8935e6b347cdb5316ca5c827a Mon Sep 17 00:00:00 2001 From: Aayush Ahuja Date: Sat, 6 Dec 2014 17:42:06 +0530 Subject: [PATCH 2/6] Fixing paths to use local version of gst-switch instead of global --- .../tests/integrationtests/test_controller.py | 4 +- .../tests/integrationtests/test_helpers.py | 2 +- .../tests/integrationtests/test_server.py | 2 +- .../performancetests/performance_dbus.py | 2 +- test-driver | 139 ++++++++++++++++++ 5 files changed, 144 insertions(+), 5 deletions(-) create mode 100755 test-driver diff --git a/python-api/tests/integrationtests/test_controller.py b/python-api/tests/integrationtests/test_controller.py index e136e0b..d7cb775 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): @@ -255,7 +255,7 @@ class VideoFileSink(object): """ def __init__(self, path, port, filename): - cmd = "{0}/gst-launch-1.0 tcpclientsrc port={1} ! gdpdepay ! jpegenc \ + cmd = "gst-launch-1.0 tcpclientsrc port={1} ! gdpdepay ! jpegenc \ ! avimux ! filesink location={2}".format(path, port, filename) with open(os.devnull, 'w') as tempf: self.proc = subprocess.Popen( 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..a209dfe 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/' diff --git a/test-driver b/test-driver new file mode 100755 index 0000000..d306056 --- /dev/null +++ b/test-driver @@ -0,0 +1,139 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: From e9456d5397f10e567822e22158969ca192f266b7 Mon Sep 17 00:00:00 2001 From: Aayush Ahuja Date: Sun, 7 Dec 2014 11:55:20 +0530 Subject: [PATCH 3/6] Correcting method calls --- .../tests/integrationtests/test_controller.py | 18 +++++++++--------- .../tests/performancetests/performance_dbus.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python-api/tests/integrationtests/test_controller.py b/python-api/tests/integrationtests/test_controller.py index d7cb775..41d049e 100644 --- a/python-api/tests/integrationtests/test_controller.py +++ b/python-api/tests/integrationtests/test_controller.py @@ -254,9 +254,9 @@ class VideoFileSink(object): """Sink the video to a file """ - def __init__(self, path, port, filename): - cmd = "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/performancetests/performance_dbus.py b/python-api/tests/performancetests/performance_dbus.py index a209dfe..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 = '../../../tools/' +PATH = '../tools/' From bd43693b833b03e6ae58d390fb9c18bf5b9a2edc Mon Sep 17 00:00:00 2001 From: Aayush Ahuja Date: Sun, 7 Dec 2014 12:26:13 +0530 Subject: [PATCH 4/6] Adding test-driver to gitignore --- .gitignore | 1 + test-driver | 139 ---------------------------------------------------- 2 files changed, 1 insertion(+), 139 deletions(-) delete mode 100755 test-driver 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/test-driver b/test-driver deleted file mode 100755 index d306056..0000000 --- a/test-driver +++ /dev/null @@ -1,139 +0,0 @@ -#! /bin/sh -# test-driver - basic testsuite driver script. - -scriptversion=2013-07-13.22; # UTC - -# Copyright (C) 2011-2013 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -# Make unconditional expansion of undefined variables an error. This -# helps a lot in preventing typo-related bugs. -set -u - -usage_error () -{ - echo "$0: $*" >&2 - print_usage >&2 - exit 2 -} - -print_usage () -{ - cat <$log_file 2>&1 -estatus=$? -if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 -fi - -case $estatus:$expect_failure in - 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; - 0:*) col=$grn res=PASS recheck=no gcopy=no;; - 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; - 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; - *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; - *:*) col=$red res=FAIL recheck=yes gcopy=yes;; -esac - -# Report outcome to console. -echo "${col}${res}${std}: $test_name" - -# Register the test result, and other relevant metadata. -echo ":test-result: $res" > $trs_file -echo ":global-test-result: $res" >> $trs_file -echo ":recheck: $recheck" >> $trs_file -echo ":copy-in-global-log: $gcopy" >> $trs_file - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: From d5a5898be1a6be6e267cce5b760372cddd851c3a Mon Sep 17 00:00:00 2001 From: Aayush Ahuja Date: Sun, 7 Dec 2014 13:04:39 +0530 Subject: [PATCH 5/6] Adding libvo-aacenc-dev to the setup --- .travis-setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis-setup.sh b/.travis-setup.sh index f5346f1..729d9b2 100644 --- a/.travis-setup.sh +++ b/.travis-setup.sh @@ -9,6 +9,7 @@ sudo apt-get -y install libglib2.0-dev gir1.2-glib-2.0 libgirepository1.0-dev li 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/ From fc0c3d3893618b0098accf816fe60086f296e632 Mon Sep 17 00:00:00 2001 From: Aayush Ahuja Date: Sun, 7 Dec 2014 17:24:16 +0530 Subject: [PATCH 6/6] GCOV_PREFIX not working. Applying coveralls to tools directory --- .travis-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"