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

Unified Diff: tools/isolate/isolate_smoke_test.py

Issue 10080013: Makes the code simpler by automatically deducing the root directory to use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix file sharing on windows Created 8 years, 8 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
Index: tools/isolate/isolate_smoke_test.py
diff --git a/tools/isolate/isolate_smoke_test.py b/tools/isolate/isolate_smoke_test.py
index 83c16ee8e7770c0162d3d40406db9e33c1a7ee0b..d376ffd1ac86c27a8e3d99ee267c88420847f3cc 100755
--- a/tools/isolate/isolate_smoke_test.py
+++ b/tools/isolate/isolate_smoke_test.py
@@ -119,13 +119,21 @@ class IsolateBase(unittest.TestCase):
files[filename][u'sha-1'] = unicode(h.hexdigest())
return files
- def _expected_result(self, args, read_only):
+ def _expected_result(self, args, read_only, extra_vars=None):
"""Verifies self.result contains the expected data."""
+ flavor = isolate.trace_inputs.get_flavor()
expected = {
u'files': self._gen_files(read_only),
- u'relative_cwd': unicode(RELATIVE_CWD[self.case()]),
u'read_only': read_only,
+ u'relative_cwd': unicode(RELATIVE_CWD[self.case()]),
+ u'resultdir': os.path.dirname(self.result),
+ u'resultfile': self.result,
+ u'variables': {
+ u'EXECUTABLE_SUFFIX': '.exe' if flavor == 'win' else '',
+ u'OS': unicode(flavor),
+ },
}
+ expected['variables'].update(extra_vars or {})
if args:
expected[u'command'] = [u'python'] + [unicode(x) for x in args]
else:
@@ -268,7 +276,7 @@ class Isolate_check(IsolateBase):
def test_with_flag(self):
self._execute(['-V', 'FLAG=gyp'])
self._expect_no_tree()
- self._expected_result(['with_flag.py', 'gyp'], None)
+ self._expected_result(['with_flag.py', 'gyp'], None, {u'FLAG': u'gyp'})
class Isolate_hashtable(IsolateBase):
@@ -315,7 +323,7 @@ class Isolate_hashtable(IsolateBase):
def test_with_flag(self):
self._execute(['-V', 'FLAG=gyp'])
self._expected_hash_tree()
- self._expected_result(['with_flag.py', 'gyp'], None)
+ self._expected_result(['with_flag.py', 'gyp'], None, {u'FLAG': u'gyp'})
class Isolate_remap(IsolateBase):
@@ -357,7 +365,7 @@ class Isolate_remap(IsolateBase):
def test_with_flag(self):
self._execute(['-V', 'FLAG=gyp'])
self._expected_tree()
- self._expected_result(['with_flag.py', 'gyp'], None)
+ self._expected_result(['with_flag.py', 'gyp'], None, {u'FLAG': u'gyp'})
class Isolate_run(IsolateBase):
@@ -411,7 +419,7 @@ class Isolate_run(IsolateBase):
self._execute(['-V', 'FLAG=run'])
# Not sure about the empty tree, should be deleted.
self._expect_empty_tree()
- self._expected_result(['with_flag.py', 'run'], None)
+ self._expected_result(['with_flag.py', 'run'], None, {u'FLAG': u'run'})
class Isolate_trace(IsolateBase):
@@ -490,7 +498,7 @@ class Isolate_trace(IsolateBase):
def test_with_flag(self):
out = self._execute(['-V', 'FLAG=trace'], True)
self._expect_no_tree()
- self._expected_result(['with_flag.py', 'trace'], None)
+ self._expected_result(['with_flag.py', 'trace'], None, {u'FLAG': u'trace'})
expected = {
'conditions': [
['OS=="%s"' % isolate.trace_inputs.get_flavor(), {

Powered by Google App Engine
This is Rietveld 408576698