Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: tools/test.py

Issue 155161: Add automatic tests for Tick Processor, take two. (Closed)
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/linux-tick-processor ('k') | tools/tickprocessor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/test.py
diff --git a/tools/test.py b/tools/test.py
index f701ceb7784a2ece546631a58666ea10c01c2154..05eb9fdc006459ab487cf1a11d5df5d004b0a450 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -356,11 +356,15 @@ class TestCase(object):
def RunCommand(self, command):
full_command = self.context.processor(command)
output = Execute(full_command, self.context, self.context.timeout)
+ self.Cleanup()
return TestOutput(self, full_command, output)
def Run(self):
return self.RunCommand(self.GetCommand())
+ def Cleanup(self):
+ return
+
class TestOutput(object):
@@ -473,6 +477,13 @@ def PrintError(str):
sys.stderr.write('\n')
+def CheckedUnlink(name):
+ try:
+ os.unlink(name)
+ except OSError, e:
+ PrintError("os.unlink() " + str(e))
+
+
def Execute(args, context, timeout=None):
(fd_out, outname) = tempfile.mkstemp()
(fd_err, errname) = tempfile.mkstemp()
@@ -487,11 +498,6 @@ def Execute(args, context, timeout=None):
os.close(fd_err)
output = file(outname).read()
errors = file(errname).read()
- def CheckedUnlink(name):
- try:
- os.unlink(name)
- except OSError, e:
- PrintError("os.unlink() " + str(e))
CheckedUnlink(outname)
CheckedUnlink(errname)
return CommandOutput(exit_code, timed_out, output, errors)
« no previous file with comments | « tools/linux-tick-processor ('k') | tools/tickprocessor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698