Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 08ce416e36758f72c422ed161fb97b9477c4af70)
+++ tests/Makefile.am	(revision a468e1e9a78661c54fb73817d6b3b744e10c5a29)
@@ -68,5 +68,24 @@
 .INTERMEDIATE: .validate .validate.cfa
 EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
-EXTRA_DIST = pybin
+EXTRA_DIST = test.py \
+	pybin/__init__.py \
+	pybin/print-core.gdb \
+	pybin/settings.py \
+	pybin/test_run.py \
+	pybin/tools.py \
+	long_tests.hfa \
+	avltree/avl.h \
+	avltree/avl-private.h \
+	exceptions/with-threads.hfa \
+	exceptions/except-io.hfa
+
+dist-hook:
+	echo "Gathering test files"
+	for file in `${TEST_PY} --list-dist`; do \
+		if test -f ${srcdir}/$${file}; then \
+			$(MKDIR_P) $$(dirname ${distdir}/$${file}); \
+			cp -df ${srcdir}/$${file} ${distdir}/$${file}; \
+		fi; \
+	done
 
 avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
Index: tests/pybin/tools.py
===================================================================
--- tests/pybin/tools.py	(revision 08ce416e36758f72c422ed161fb97b9477c4af70)
+++ tests/pybin/tools.py	(revision a468e1e9a78661c54fb73817d6b3b744e10c5a29)
@@ -191,4 +191,15 @@
 	cmd = [s for s in cmd if s]
 	return sh(*cmd, output_file=output_file, error=error)
+
+def make_recon(target):
+	cmd = [
+		*settings.make,
+		'-W',
+		os.path.abspath(os.path.join(settings.BUILDDIR, '../driver/cfa')),
+		'--recon',
+		target
+	]
+	cmd = [s for s in cmd if s]
+	return sh(*cmd, output_file=subprocess.PIPE)
 
 def which(program):
Index: tests/test.py
===================================================================
--- tests/test.py	(revision 08ce416e36758f72c422ed161fb97b9477c4af70)
+++ tests/test.py	(revision a468e1e9a78661c54fb73817d6b3b744e10c5a29)
@@ -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 )
