summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-07-24 20:02:19 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-07-24 20:02:19 +0200
commit7ba100e927d388e378d5b9e89883f28add3abf8a (patch)
treeb33c05f2e3ece65ab1cf88a8f6ee2b4423f6bef3
parentd15318d80f5b3f038492f8def042f8353ddf425e (diff)
insanity: Remember default test installation directory and use by default
-rwxr-xr-xbin/insanity-inspect5
-rwxr-xr-xbin/insanity-run7
-rw-r--r--configure.ac1
-rw-r--r--insanity/Makefile.am10
-rw-r--r--insanity/config.py26
5 files changed, 42 insertions, 7 deletions
diff --git a/bin/insanity-inspect b/bin/insanity-inspect
index cd036be..1444c4a 100755
--- a/bin/insanity-inspect
+++ b/bin/insanity-inspect
@@ -28,6 +28,7 @@ import os
import argparse
import insanity
+import insanity.config
import insanity.utils
from insanity.client import CommandLineTesterClient
from insanity.testrun import TestRun
@@ -42,9 +43,9 @@ class ArgumentParser(argparse.ArgumentParser):
"--tests",
dest="tests",
action="store",
- help="tests directory (default: current)",
+ help="tests directory (default: %s)" % insanity.config.Config.test_dir,
metavar="TESTS",
- default=".")
+ default=insanity.config.Config.test_dir)
self.add_argument("-t",
"--test",
dest="test",
diff --git a/bin/insanity-run b/bin/insanity-run
index 3e6d1a0..3d2130a 100755
--- a/bin/insanity-run
+++ b/bin/insanity-run
@@ -30,6 +30,7 @@ pygtk.require("2.0")
del pygtk
import insanity
+import insanity.config
from insanity.client import CommandLineTesterClient
from insanity.testrun import TestRun, XmlTestRun
@@ -86,9 +87,9 @@ class ArgumentParser(argparse.ArgumentParser):
"--tests",
dest="tests",
action="store",
- help="tests directory (default: current)",
+ help="tests directory (default: %s)" % insanity.config.Config.test_dir,
metavar="TESTS",
- default=".")
+ default=insanity.config.Config.test_dir)
self.add_argument("-l",
"--substitutes-list",
dest="substitutes",
@@ -180,7 +181,7 @@ class ArgumentParser(argparse.ArgumentParser):
(arg_name, rest) = arg.split(":", 1)
found = False
- for generator in generators.keys():
+ for generator in generators.keys():
if rest.startswith(generator + ":"):
found = True
break
diff --git a/configure.ac b/configure.ac
index 8106fa4..87d0360 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,7 @@ AC_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_PROG_GREP
AC_CHECK_PROGS(GTKDOC_REBASE,[gtkdoc-rebase])
+AC_PROG_SED
AC_C_CONST
diff --git a/insanity/Makefile.am b/insanity/Makefile.am
index c4f9a06..3ff9022 100644
--- a/insanity/Makefile.am
+++ b/insanity/Makefile.am
@@ -1,6 +1,7 @@
SUBDIRS=generators storage
-modules = __init__ arguments client dbustest dbustools environment generator log monitor profile scenario test testmetadata testrun threads type utils
+dist_modules = __init__ arguments client dbustest dbustools environment generator log monitor profile scenario test testmetadata testrun threads type utils
+modules = $(dist_modules) config
# dummy - this is just for automake to copy py-compile, as it won't do it
# if it doesn't see anything in a PYTHON variable. KateDJ is Python, but
@@ -28,5 +29,10 @@ uninstall-local:
done
rmdir "$(DESTDIR)$(pythondir)/insanity"
-EXTRA_DIST=$(foreach module, $(modules), $(module).py)
+config.py: config.py.in
+ $(SED) 's;@INSANITY_TEST_DIR@;$(libexecdir)/insanity-1.0;g' config.py.in > config.py
+
+all: config.py
+
+EXTRA_DIST=$(foreach module, $(dist_modules), $(module).py) config.py.in
diff --git a/insanity/config.py b/insanity/config.py
new file mode 100644
index 0000000..2398756
--- /dev/null
+++ b/insanity/config.py
@@ -0,0 +1,26 @@
+# GStreamer QA system
+#
+# config.py
+#
+# Copyright (c) 2012 Collabora Ltd.
+# Author: Sebastian Droege <sebastian.droege@collabora.co.uk>
+#
+#
+# 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., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+class Config:
+ test_dir = '/usr/local/libexec/insanity-1.0'
+