Index: tests/test.py
===================================================================
--- tests/test.py	(revision ad4832f1e82f11b7d41be2a374faf227d42690a9)
+++ tests/test.py	(revision c131a027b25acccd0ac9645890d8369d04c0a782)
@@ -143,4 +143,5 @@
 	parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int)
 	parser.add_argument('--list-comp', help='List all valide arguments', action='store_true')
+	parser.add_argument('--list-dist', help='List all tests for distribution', action='store_true')
 	parser.add_argument('-I','--include', help='Directory of test to include, can be used multiple time, All  if omitted', action='append')
 	parser.add_argument('-E','--exclude', help='Directory of test to exclude, can be used multiple time, None if omitted', action='append')
@@ -155,5 +156,5 @@
 
 	# script must have at least some tests to run or be listing
-	listing    = options.list or options.list_comp
+	listing    = options.list or options.list_comp or options.list_dist
 	all_tests  = options.all
 	some_tests = len(options.tests) > 0
@@ -334,5 +335,7 @@
 	settings.init( options )
 
-	# users may want to simply list the tests
+	# --------------------------------------------------
+	# list all the test for auto completion programs
+	# not pretty, single line, with the command line options
 	if options.list_comp :
 		# fetch the liest of all valid tests
@@ -340,8 +343,36 @@
 
 		# 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 -I --include -E --exclude --continue ", end='')
+		print("-h --help --debug --dry-run --list --ast=new --ast=old --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='')
 		print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
 
-	elif options.list :
+		# done
+		sys.exit(0)
+
+	# --------------------------------------------------
+	# list all the test for auto completion programs
+	if options.list_dist :
+		# fetch the liest of all valid tests
+		tests = list_tests( None, None )
+
+		for t in tests:
+			print(os.path.relpath(t.expect(), settings.SRCDIR), end=' ')
+			print(os.path.relpath(t.input() , settings.SRCDIR), end=' ')
+			code, out = make_recon(t.target())
+
+			if code != 0:
+				print('ERROR: recond failed for test {}'.format(t.target()), file=sys.stderr)
+				sys.exit(1)
+
+			print(' '.join(re.findall('([^\s]+\.cfa)', out)), end=' ')
+
+		print('')
+
+		# done
+		sys.exit(0)
+
+
+	# --------------------------------------------------
+	# list all the tests for users, in a pretty format
+	if options.list :
 		# fetch the liest of all valid tests
 		tests = list_tests( options.include, options.exclude )
@@ -350,69 +381,71 @@
 		fancy_print("\n".join(map(lambda t: t.toString(), tests)))
 
+		# done
+		sys.exit(0)
+
+	# 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 :
-		# 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)
-
-		# prep invariants
-		settings.prep_output(tests)
-		failed = 0
-
-		# check if the expected files aren't empty
-		if not options.regenerate_expected:
-			for t in tests:
-				if is_empty(t.expect()):
-					print('WARNING: test "{}" has empty .expect file'.format(t.target()), file=sys.stderr)
-
-		# for each build configurations, run the test
-		with Timed() as total_dur:
-			for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install):
-				settings.ast     = ast
-				settings.arch    = arch
-				settings.debug   = debug
-				settings.install = install
-
-				# filter out the tests for a different architecture
-				# tests are the same across debug/install
-				local_tests = settings.ast.filter( tests )
-				local_tests = settings.arch.filter( local_tests )
-				options.jobs, forceJobs = job_count( options, local_tests )
-				settings.update_make_cmd(forceJobs, options.jobs)
-
-				# check the build configuration works
-				settings.validate()
-
-				# print configuration
-				print('%s %i tests on %i cores (%s:%s - %s)' % (
-					'Regenerating' if settings.generating else 'Running',
-					len(local_tests),
-					options.jobs,
-					settings.ast.string,
-					settings.arch.string,
-					settings.debug.string
-				))
-				if not local_tests :
-					print('WARNING: No tests for this configuration')
-					continue
-
-				# otherwise run all tests and make sure to return the correct error code
-				failed = run_tests(local_tests, options.jobs)
-				if failed:
-					result = 1
-					if not settings.continue_:
-						break
-
-		print('Tests took %s' % fmtDur( total_dur.duration ))
-		sys.exit( failed )
+		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)
+
+	# prep invariants
+	settings.prep_output(tests)
+	failed = 0
+
+	# check if the expected files aren't empty
+	if not options.regenerate_expected:
+		for t in tests:
+			if is_empty(t.expect()):
+				print('WARNING: test "{}" has empty .expect file'.format(t.target()), file=sys.stderr)
+
+	# for each build configurations, run the test
+	with Timed() as total_dur:
+		for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install):
+			settings.ast     = ast
+			settings.arch    = arch
+			settings.debug   = debug
+			settings.install = install
+
+			# filter out the tests for a different architecture
+			# tests are the same across debug/install
+			local_tests = settings.ast.filter( tests )
+			local_tests = settings.arch.filter( local_tests )
+			options.jobs, forceJobs = job_count( options, local_tests )
+			settings.update_make_cmd(forceJobs, options.jobs)
+
+			# check the build configuration works
+			settings.validate()
+
+			# print configuration
+			print('%s %i tests on %i cores (%s:%s - %s)' % (
+				'Regenerating' if settings.generating else 'Running',
+				len(local_tests),
+				options.jobs,
+				settings.ast.string,
+				settings.arch.string,
+				settings.debug.string
+			))
+			if not local_tests :
+				print('WARNING: No tests for this configuration')
+				continue
+
+			# otherwise run all tests and make sure to return the correct error code
+			failed = run_tests(local_tests, options.jobs)
+			if failed:
+				result = 1
+				if not settings.continue_:
+					break
+
+	print('Tests took %s' % fmtDur( total_dur.duration ))
+	sys.exit( failed )
