Index: tests/test.py
===================================================================
--- tests/test.py	(revision ae663481b425267fa525cf57f1c7d142873a3514)
+++ tests/test.py	(revision 29806675e245a4300bb8eeae405bb961d95519f6)
@@ -293,35 +293,47 @@
 	settings.init( options )
 
-	# fetch the liest of all valid tests
-	all_tests = list_tests( options.include, options.exclude )
-
-
-	# if user wants all tests than no other treatement of the test list is required
-	if options.all or options.list or options.list_comp or options.include :
-		tests = all_tests
-
-	#otherwise we need to validate that the test list that was entered is valid
-	else :
-		tests = valid_tests( options )
-
-	# make sure we have at least some test to run
-	if not tests :
-		print('ERROR: No valid test to run', file=sys.stderr)
-		sys.exit(1)
-
-
-	# sort the test alphabetically for convenience
-	tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
-
 	# users may want to simply list the tests
 	if options.list_comp :
+		# fetch the liest of all valid tests
+		tests = list_tests( None, None )
+
+		# sort the test alphabetically for convenience
+		tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
+
+		# print the possible options
 		print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs ", end='')
 		print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
 
 	elif options.list :
+		# fetch the liest of all valid tests
+		tests = list_tests( options.include, options.exclude )
+
+		# sort the test alphabetically for convenience
+		tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
+
+		# print the available tests
 		print("Listing for %s:%s"% (settings.arch.string, settings.debug.string))
 		fancy_print("\n".join(map(lambda t: t.toString(), tests)))
 
 	else :
+		# fetch the liest of all valid tests
+		all_tests = list_tests( options.include, options.exclude )
+
+		# if user wants all tests than no other treatement of the test list is required
+		if options.all or options.include :
+			tests = all_tests
+
+		#otherwise we need to validate that the test list that was entered is valid
+		else :
+			tests = valid_tests( options )
+
+		# make sure we have at least some test to run
+		if not tests :
+			print('ERROR: No valid test to run', file=sys.stderr)
+			sys.exit(1)
+
+		# sort the test alphabetically for convenience
+		tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
+
 		# check the build configuration works
 		settings.prep_output(tests)
