15SCRIPT_DIR = os.path.dirname(sys.argv[0])
16DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR,
'..'))
17FUCHSIA_ROOT = os.path.realpath(os.path.join(DART_ROOT,
'..',
'..'))
19FUCHSIA_TEST_MANIFEST_PREFIX = os.path.join(
'test',
'dart')
21EXCLUDE_DIRS = [
'.git',
'out',
'.jiri']
23BINARY_FILES = [
'dart',
'run_vm_tests',
'process_test']
28 parser = argparse.ArgumentParser(
29 description=
'A script that generates Dart/Fuchsia test commands.')
35 help=
'Target architectures (comma-separated).',
43 metavar=
'[debug,release]',
46 '--output',
'-o', type=str, help=
'Path to output file prefix.')
50 help=
'Verbose output.',
54 return parser.parse_args(args)
66 manifest_output = args.output +
'.manifest'
67 with open(manifest_output,
'w')
as manifest:
69 for root, dirs, files
in os.walk(DART_ROOT):
70 dirs[:] = [d
for d
in dirs
if d
not in EXCLUDE_DIRS]
72 filepath = os.path.join(root, file)
73 relpath = filepath[
len(DART_ROOT) + 1:]
74 fuchsiapath = os.path.join(FUCHSIA_TEST_MANIFEST_PREFIX,
77 '%s=%s\n' % (fuchsiapath, os.path.join(root, file)))
80 dart_out = os.path.join(FUCHSIA_TEST_MANIFEST_PREFIX,
'out', dart_conf)
81 fuchsia_conf =
'%s-%s' % (args.mode,
fuchsia_arch(args.arch))
82 fuchsia_out = os.path.join(FUCHSIA_ROOT,
'out', fuchsia_conf)
83 for file
in BINARY_FILES:
84 manifest.write(
'%s=%s\n' % (os.path.join(dart_out, file),
85 os.path.join(fuchsia_out, file)))
90if __name__ ==
'__main__':
91 sys.exit(
main(sys.argv))
def GetBuildConf(mode, arch)