Index: src/tests/test.py
===================================================================
--- src/tests/test.py	(revision ebcd82b72d9f146495d6f97c1dbf829142f52341)
+++ src/tests/test.py	(revision 0534c3c62f89ea073bf3310837febb1ddb9d2916)
@@ -3,5 +3,5 @@
 
 from os import listdir
-from os.path import isfile, join
+from os.path import isfile, join, splitext
 from subprocess import Popen, PIPE, STDOUT
 
@@ -13,8 +13,7 @@
 ################################################################################
 def listTests():
-	list = [f.rstrip('.c') for f in listdir('.')
-		if not f.startswith('.') and (
-			not isfile(f) or f.endswith('.c')
-		)]
+	list = [splitext(f)[0] for f in listdir('./.expect')
+		if not f.startswith('.') and f.endswith('.txt')
+		]
 
 	return list
@@ -51,7 +50,4 @@
 	retcode = 0
 	if not generate :
-		# touch expected files so empty output are supported by default
-		sh("touch .expect/%s.txt" % test, dry_run)
-
 		# diff the output of the files
 		retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run)
@@ -90,16 +86,37 @@
 parser = argparse.ArgumentParser(description='Script which runs cforall tests')
 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')
 parser.add_argument('--all', help='Run all test available', action='store_true')
-parser.add_argument('--generate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
+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('tests', metavar='test', type=str, nargs='*', help='a list of tests to run')
 
 options = parser.parse_args()
 
-if len(options.tests) > 0 and options.all :
+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) :
 	print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr)
 	parser.print_help()
 	sys.exit(1)
 
-tests = listTests() if options.all else options.tests
+allTests = listTests()
 
-sys.exit( run_tests(tests, options.generate_expected, options.dry_run) )
+if options.all or options.list :
+	tests = allTests
+
+else :
+	tests = []
+	for test in options.tests:
+		if allTests.contains( test ) :
+			tests.append(test)
+		else :
+			print('ERROR: No expected file for test %s, ignoring it' % test, file=sys.stderr)
+
+	if len(tests) == 0 :
+		print('ERROR: No valid test to run', file=sys.stderr)
+		sys.exit(1)
+
+if options.list :
+	print("\n".join(tests))
+
+else :
+	sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run) )
