summaryrefslogtreecommitdiffstats
path: root/tools/purify/chrome_tests.py
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 16:39:50 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 16:39:50 +0000
commita03b35d338543e83233a59d829239c8199803a18 (patch)
tree1ff762a1c415d1caf24f9c956f5c30e73144aa7c /tools/purify/chrome_tests.py
parent19e726f5e3454b52014cb020d9f817c12905c8f8 (diff)
downloadchromium_src-a03b35d338543e83233a59d829239c8199803a18.zip
chromium_src-a03b35d338543e83233a59d829239c8199803a18.tar.gz
chromium_src-a03b35d338543e83233a59d829239c8199803a18.tar.bz2
Fix a few bugs in purify layout test chunks:
* When the chunk number is reset, test for existence of directory rather than throwing trying to recreate it. * When the chunk directory already exists, delete existing data files so it starts clean. * Store the chunk number counter in %TEMP% so that it doesn't get reset with a clobber build. It's OK for this to be reset, but it's better if it doesn't happen that frequently. TBR=nsylvain Review URL: http://codereview.chromium.org/14844 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/purify/chrome_tests.py')
-rw-r--r--tools/purify/chrome_tests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/purify/chrome_tests.py b/tools/purify/chrome_tests.py
index 2d4bb60..5b2c535 100644
--- a/tools/purify/chrome_tests.py
+++ b/tools/purify/chrome_tests.py
@@ -8,6 +8,7 @@
''' Runs various chrome tests through purify_test.py
'''
+import glob
import logging
import optparse
import os
@@ -161,7 +162,12 @@ class ChromeTests:
"latest")
if out_dir_extra:
out = os.path.join(out, out_dir_extra)
- os.makedirs(out)
+ if os.path.exists(out):
+ old_files = glob.glob(os.path.join(out, "*.txt"))
+ for f in old_files:
+ os.remove(f)
+ else:
+ os.makedirs(out)
out = os.path.join(out, "%s%%5d.txt" % name)
cmd.append("--out_file=%s" % out)
if cmd_args:
@@ -214,7 +220,7 @@ class ChromeTests:
chunk_num = 0
# Tests currently seem to take about 20-30s each.
chunk_size = 120 # so about 40-60 minutes per run
- chunk_file = "purify_layout_chunk.txt"
+ chunk_file = os.path.join(os.environ["TEMP"], "purify_layout_chunk.txt")
if not run_all:
try:
f = open(chunk_file)