summaryrefslogtreecommitdiffstats
path: root/tools/export_tarball
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 18:04:06 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 18:04:06 +0000
commit6ae60b1a99f747618c637f1c1131127420d9446a (patch)
tree30ba9bfa430c18bb3fc393fb48a938bfc1b9fec2 /tools/export_tarball
parente484a3e8d697d401fcae805008f4b56d28535a53 (diff)
downloadchromium_src-6ae60b1a99f747618c637f1c1131127420d9446a.zip
chromium_src-6ae60b1a99f747618c637f1c1131127420d9446a.tar.gz
chromium_src-6ae60b1a99f747618c637f1c1131127420d9446a.tar.bz2
Add an option to package test data to export_tarball script.
It is helpful to have test data in a separate tarball, because then the main tarball (with everything needed to compile the browser) can be kept small while still allowing people to run tests as an option. BUG=none Review URL: https://codereview.chromium.org/12621004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/export_tarball')
-rwxr-xr-xtools/export_tarball/export_tarball.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/tools/export_tarball/export_tarball.py b/tools/export_tarball/export_tarball.py
index 518d097..de8edb5 100755
--- a/tools/export_tarball/export_tarball.py
+++ b/tools/export_tarball/export_tarball.py
@@ -27,14 +27,10 @@ NONESSENTIAL_DIRS = (
'breakpad/src/processor/testdata',
'chrome/browser/resources/tracing/tests',
'chrome/common/extensions/docs',
- 'chrome/test/data',
'chrome/tools/test/reference_build',
- 'content/test/data',
'courgette/testdata',
'data',
- 'media/test/data',
'native_client/src/trusted/service_runtime/testdata',
- 'net/data',
'src/chrome/test/data',
'o3d/documentation',
'o3d/samples',
@@ -71,6 +67,13 @@ NONESSENTIAL_DIRS = (
'webkit/tools/test/reference_build',
)
+TESTDIRS = (
+ 'chrome/test/data',
+ 'content/test/data',
+ 'media/test/data',
+ 'net/data',
+)
+
def GetSourceDirectory():
return os.path.realpath(
@@ -96,7 +99,7 @@ class MyTarFile(tarfile.TarFile):
# Remove contents of non-essential directories, but preserve gyp files,
# so that build/gyp_chromium can work.
- for nonessential_dir in NONESSENTIAL_DIRS:
+ for nonessential_dir in (NONESSENTIAL_DIRS + TESTDIRS):
dir_path = os.path.join(GetSourceDirectory(), nonessential_dir)
if (name.startswith(dir_path) and
os.path.isfile(name) and
@@ -108,9 +111,11 @@ class MyTarFile(tarfile.TarFile):
def main(argv):
parser = optparse.OptionParser()
+ parser.add_option("--basename")
parser.add_option("--remove-nonessential-files",
dest="remove_nonessential_files",
action="store_true", default=False)
+ parser.add_option("--test-data", action="store_true")
parser.add_option("--xz", action="store_true")
options, args = parser.parse_args(argv)
@@ -121,7 +126,7 @@ def main(argv):
return 1
if not os.path.exists(GetSourceDirectory()):
- print 'Cannot find the src directory.'
+ print 'Cannot find the src directory ' + GetSourceDirectory()
return 1
# This command is from src/DEPS; please keep them in sync.
@@ -135,7 +140,7 @@ def main(argv):
else:
output_fullname = args[0] + '.tar.bz2'
- output_basename = os.path.basename(args[0])
+ output_basename = options.basename or os.path.basename(args[0])
if options.xz:
archive = MyTarFile.open(output_fullname, 'w')
@@ -143,7 +148,12 @@ def main(argv):
archive = MyTarFile.open(output_fullname, 'w:bz2')
archive.set_remove_nonessential_files(options.remove_nonessential_files)
try:
- archive.add(GetSourceDirectory(), arcname=output_basename)
+ if options.test_data:
+ for directory in TESTDIRS:
+ archive.add(os.path.join(GetSourceDirectory(), directory),
+ arcname=os.path.join(output_basename, directory))
+ else:
+ archive.add(GetSourceDirectory(), arcname=output_basename)
finally:
archive.close()