Index: src/tests/test.py
===================================================================
--- src/tests/test.py	(revision 86c8fd65e0fdb013cf4825300a25cdf3c4b1ddca)
+++ src/tests/test.py	(revision b98c9137b581e4b6b3af1105ae4413162c335ac8)
@@ -268,4 +268,8 @@
 #               main loop
 ################################################################################
+abspath = os.path.abspath(__file__)
+dname = os.path.dirname(abspath)
+os.chdir(dname)
+
 # create a parser with the arguments for the tests script
 parser = argparse.ArgumentParser(description='Script which runs cforall tests')
@@ -277,12 +281,15 @@
 parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
 parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int, default='8')
+parser.add_argument('--list-comp', help='List all valide arguments', action='store_true')
 parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run')
+
 
 # parse the command line arguments
 options = parser.parse_args()
+do_list = options.list or options.list_comp
 
 # script must have at least some tests to run
-if (len(options.tests) > 0  and     options.all and not options.list) \
-or (len(options.tests) == 0 and not options.all and not options.list) :
+if (len(options.tests) > 0  and     options.all and not do_list) \
+or (len(options.tests) == 0 and not options.all and not do_list) :
 	print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr)
 	parser.print_help()
@@ -293,5 +300,5 @@
 
 # if user wants all tests than no other treatement of the test list is required
-if options.all or options.list :
+if options.all or do_list :
 	tests = allTests
 
@@ -328,29 +335,33 @@
 tests.sort(key=lambda t: t.name)
 
-# check if the user already passed in a number of jobs for multi-threading
-make_flags = environ.get('MAKEFLAGS')
-make_jobs_fds = re.search("--jobserver-(auth|fds)=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None
-if make_jobs_fds :
-	tokens = os.read(int(make_jobs_fds.group(2)), 1024)
-	options.jobs = len(tokens)
-	os.write(int(make_jobs_fds.group(3)), tokens)
+# users may want to simply list the tests
+if options.list_comp :
+	print("-h --help --debug --concurrent --dry-run --list --all --regenerate-expected -j --jobs ", end='')
+	print(" ".join(map(lambda t: "%s" % (t.name), tests)))
+
+elif options.list :
+	print("\n".join(map(lambda t: "%s (%s)" % (t.name, t.path), tests)))
+
 else :
-	options.jobs = multiprocessing.cpu_count()
-
-# make sure we have a valid number of jobs that corresponds to user input
-if options.jobs <= 0 :
-	print('ERROR: Invalid number of jobs', file=sys.stderr)
-	sys.exit(1)
-
-options.jobs = min( options.jobs, len(tests) )
-
-print('Running (%s) on %i cores' % ("debug" if options.debug else "no debug", options.jobs))
-make_cmd = "make" if make_flags else ("make -j%i" % options.jobs)
-
-# users may want to simply list the tests
-if options.list :
-	print("\n".join(map(lambda t: "%s (%s)" % (t.name, t.path), tests)))
-
-else :
+	# check if the user already passed in a number of jobs for multi-threading
+	make_flags = environ.get('MAKEFLAGS')
+	make_jobs_fds = re.search("--jobserver-(auth|fds)=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None
+	if make_jobs_fds :
+		tokens = os.read(int(make_jobs_fds.group(2)), 1024)
+		options.jobs = len(tokens)
+		os.write(int(make_jobs_fds.group(3)), tokens)
+	else :
+		options.jobs = multiprocessing.cpu_count()
+
+	# make sure we have a valid number of jobs that corresponds to user input
+	if options.jobs <= 0 :
+		print('ERROR: Invalid number of jobs', file=sys.stderr)
+		sys.exit(1)
+
+	options.jobs = min( options.jobs, len(tests) )
+
+	print('Running (%s) on %i cores' % ("debug" if options.debug else "no debug", options.jobs))
+	make_cmd = "make" if make_flags else ("make -j%i" % options.jobs)
+
 	# otherwise run all tests and make sure to return the correct error code
 	sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run, options.jobs, options.debug) )
