Index: tests/config.py.in
===================================================================
--- tests/config.py.in	(revision 202ad7213dd90adde71c8d41deb86d0a8093bd95)
+++ tests/config.py.in	(revision afe8882d4abe48a8b80915cca915209de65e6d15)
@@ -5,5 +5,5 @@
 """
 
-SRCDIR   = "@srcdir@"
-BUILDDIR = "@builddir@"
+SRCDIR   = "@abs_srcdir@"
+BUILDDIR = "@abs_builddir@"
 HOSTARCH = "@host_cpu@"
Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision 202ad7213dd90adde71c8d41deb86d0a8093bd95)
+++ tests/pybin/settings.py	(revision afe8882d4abe48a8b80915cca915209de65e6d15)
@@ -6,9 +6,12 @@
 
 try :
-	sys.path.append(os.getcwd())
+	testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0])))
+	sys.path.append(testpath)
 	import config
 
 	SRCDIR = os.path.abspath(config.SRCDIR)
 	BUILDDIR = os.path.abspath(config.BUILDDIR)
+	os.chdir(testpath)
+
 except:
 	print('ERROR: missing config.py, re-run configure script.', file=sys.stderr)
@@ -88,4 +91,17 @@
 		self.flags  = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree")
 
+class Timeouts:
+	def __init__(self, ts, tg):
+		self.single = Timeouts.check(ts)
+		self.total  = Timeouts.check(tg)
+
+	@classmethod
+	def check(_, value):
+		if value < 1:
+			print("Timeouts must be at least 1 second", file=sys.stderr)
+			sys.exit(1)
+
+		return value
+
 def init( options ):
 	global arch
@@ -95,4 +111,5 @@
 	global debug
 	global install
+	global timeout
 
 	dry_run    = options.dry_run
@@ -102,4 +119,5 @@
 	install    = Install(options.install)
 	arch       = Architecture(options.arch)
+	timeout    = Timeouts(options.timeout, options.global_timeout)
 
 
@@ -110,12 +128,13 @@
 
 def validate():
-	make_ret, _ = tools.make( ".validate", error_file = ".validate.err", redirects  = "2> /dev/null 1> /dev/null", )
+	errf = os.path.join(BUILDDIR, ".validate.err")
+	make_ret, _ = tools.make( ".validate", error_file = errf, redirects  = "2> /dev/null 1> /dev/null", )
 	if make_ret != 0:
-		with open (".validate.err", "r") as myfile:
+		with open (errf, "r") as myfile:
 			error=myfile.read()
 		print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr)
 		print("       verify returned : \n%s" % error, file=sys.stderr)
-		tools.rm("%s/.validate.err" % BUILDDIR)
+		tools.rm(errf)
 		sys.exit(1)
 
-	tools.rm("%s/.validate.err" % BUILDDIR)
+	tools.rm(errf)
Index: tests/test.py
===================================================================
--- tests/test.py	(revision 202ad7213dd90adde71c8d41deb86d0a8093bd95)
+++ tests/test.py	(revision afe8882d4abe48a8b80915cca915209de65e6d15)
@@ -88,4 +88,6 @@
 	parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=yes_no, default='no')
 	parser.add_argument('--arch', help='Test for specific architecture', type=str, default='')
+	parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=60)
+	parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
 	parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
 	parser.add_argument('--list', help='List all test available', action='store_true')
@@ -160,5 +162,5 @@
 		if settings.dry_run or fileIsExecutable(exe_file) :
 			# run test
-			retcode, _ = sh("timeout 60 %s > %s 2>&1" % (exe_file, out_file), input = in_file)
+			retcode, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe_file, out_file), input = in_file)
 		else :
 			# simply cat the result into the output
@@ -234,5 +236,5 @@
 			tests,
 			chunksize = 1
-		).get(7200)
+		).get(settings.timeout.total)
 	except KeyboardInterrupt:
 		pool.terminate()
@@ -283,5 +285,5 @@
 	# users may want to simply list the tests
 	if options.list_comp :
-		print("-h --help --debug --dry-run --list --arch --all --regenerate-expected -j --jobs ", end='')
+		print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --install --timeout --global-timeout -j --jobs ", end='')
 		print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
 
