validate:tools: Rename files around and integrate into autotools

File distribution used to be messy, clean it all up. Also make sure the
launcher is integrated into the autotools.
This commit is contained in:
Thibault Saunier 2014-01-09 09:39:05 +01:00
parent ac9820a435
commit ea7ae57d3b
10 changed files with 67 additions and 17 deletions

View file

@ -240,6 +240,11 @@ dnl LDFLAGS modifier defining exported symbols from built libraries
GST_LIB_LDFLAGS="-export-symbols-regex \^[_]?\(gst_\|Gst\|GST_\).*"
AC_SUBST(GST_LIB_LDFLAGS)
AM_PATH_PYTHON(2.7.0)
AS_AC_EXPAND(LIBDIR, $libdir)
AC_MSG_NOTICE(Storing library files in $LIBDIR)
AC_CONFIG_FILES([tools/gst-validate-launcher], [chmod +x tools/gst-validate-launcher])
dnl this really should only contain flags, not libs - they get added before
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
@ -253,6 +258,8 @@ common/m4/Makefile
gst/Makefile
gst/validate/Makefile
tools/Makefile
tools/launcher/Makefile
tools/launcher/apps/Makefile
data/Makefile
pkgconfig/Makefile
pkgconfig/gst-validate-uninstalled.pc

View file

@ -1,9 +1,14 @@
SUBDIRS = \
launcher
bin_PROGRAMS = \
gst-validate-@GST_API_VERSION@ \
gst-validate-transcoding-@GST_API_VERSION@ \
gst-validate-media-check-@GST_API_VERSION@
bin_SCRIPTS = \
gst-validate-launcher
AM_CFLAGS = $(GST_ALL_CFLAGS) $(GST_PBUTILS_CFLAGS) $(GST_VIDEO_CFLAGS)
LDADD = $(top_builddir)/gst/validate/libgstvalidate-@GST_API_VERSION@.la $(GST_PBUTILS_LIBS) $(GST_LIBS) $(GST_VIDEO_LIBS)
@ -11,4 +16,4 @@ gst_validate_@GST_API_VERSION@_SOURCES = gst-validate.c
gst_validate_transcoding_@GST_API_VERSION@_SOURCES = gst-validate-transcoding.c
gst_validate_media_check_@GST_API_VERSION@_SOURCES = gst-validate-media-check.c
CLEANFILES =
CLEANFILES = $(bin_SCRIPTS)

View file

@ -1,6 +1,6 @@
#!/usr//bin/python
#
# Copyright (c) 2013,Thibault Saunier <thibault.saunier@collabora.com>
# Copyright (c) 2014,Thibault Saunier <thibault.saunier@collabora.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -18,15 +18,30 @@
# Boston, MA 02110-1301, USA.
import os
import loggable
import sys
import urlparse
from utils import printc, path2url
from optparse import OptionParser
from testdefinitions import _TestsLauncher, DEFAULT_GST_QA_ASSETS
LIBDIR = '@LIBDIR@'
def _in_devel():
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
return os.path.exists(os.path.join(root_dir, '.git'))
def _add_gst_launcher_path():
if not _in_devel():
root = os.path.join(LIBDIR, 'gst-validate-launcher', 'python')
sys.path.insert(0, root)
def main():
_add_gst_launcher_path()
from launcher import loggable
from launcher.baseclasses import _TestsLauncher
from launcher.utils import printc, path2url, DEFAULT_GST_QA_ASSETS
parser = OptionParser()
# FIXME:
#parser.add_option("-g", "--gdb", dest="gdb",
@ -79,10 +94,12 @@ def main():
options.dest = path2url(options.dest)
tests_launcher.set_settings(options, args)
tests_launcher.list_tests()
if options.list_tests:
for test in tests_launcher.tests:
printc(test)
return 0
tests_launcher.run_tests()
tests_launcher.final_report()
return 0

View file

@ -0,0 +1,18 @@
#!/usr//bin/python
#
# Copyright (c) 2014,Thibault Saunier <thibault.saunier@collabora.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.

View file

@ -21,8 +21,9 @@ import os
import urlparse
from urllib import unquote
from gi.repository import GES, Gst, GLib
from testdefinitions import GstValidateTest, DEFAULT_GST_QA_ASSETS, TestsManager
from utils import MediaFormatCombination, get_profile, Result, get_current_position, get_current_size
from baseclasses import GstValidateTest, TestsManager
from utils import MediaFormatCombination, get_profile, Result, get_current_position, \
get_current_size, DEFAULT_GST_QA_ASSETS
DURATION_TOLERANCE = Gst.SECOND / 2
DEFAULT_GES_LAUNCH = "ges-launch-1.0"

View file

@ -22,8 +22,10 @@ import subprocess
import ConfigParser
from loggable import Loggable
from testdefinitions import GstValidateTest, TestsManager, DEFAULT_TIMEOUT
from utils import MediaFormatCombination, get_profile, path2url, Result, get_current_position, get_current_size
from baseclasses import GstValidateTest, TestsManager
from utils import MediaFormatCombination, get_profile,\
path2url, get_current_position, get_current_size, \
DEFAULT_TIMEOUT
DEFAULT_GST_VALIDATE = "gst-validate-1.0"

View file

@ -24,15 +24,11 @@ import re
import time
import subprocess
import reporters
from loggable import Loggable
from loggable import Loggable
from optparse import OptionGroup
from utils import mkdir, Result, Colors, printc
from utils import mkdir, Result, Colors, printc, DEFAULT_TIMEOUT
DEFAULT_TIMEOUT = 10
DEFAULT_GST_QA_ASSETS = os.path.join(os.path.expanduser('~'), "Videos",
"gst-qa-assets")
class Test(Loggable):
@ -300,7 +296,8 @@ class _TestsLauncher(object):
env = globals().copy()
d = os.path.dirname(__file__)
for f in os.listdir(os.path.join(d, "apps")):
execfile(os.path.join(d, "apps", f), env)
if f.endswith(".py"):
execfile(os.path.join(d, "apps", f), env)
self.testers = [i() for i in get_subclasses(TestsManager, env)]

View file

@ -24,6 +24,9 @@ import urlparse
GST_SECOND = 1000000000
DEFAULT_TIMEOUT = 10
DEFAULT_GST_QA_ASSETS = os.path.join(os.path.expanduser('~'), "Videos",
"gst-qa-assets")
class Result(object):