Skip to content

Commit

Permalink
Change --variable argument, must now be spaced, -V foo bar, instead o…
Browse files Browse the repository at this point in the history
…f -V foo=bar.

Otherwise, path quoting gets in the way on windows in a way that is very hard to
fix, as the 'bar' value could have double-quote in it, resulting in something like foo="bar".

R=nsylvain@chromium.org
R=mark@chromium.org
R=rsleevi@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10139020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133398 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
maruel@chromium.org committed Apr 23, 2012
1 parent 2b61b68 commit 5b79035
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions base/base.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@
'python',
'../tools/isolate/isolate.py',
'--mode', '<(tests_run)',
'--variable', 'PRODUCT_DIR=<(PRODUCT_DIR)',
'--variable', 'OS=<(OS)',
'--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR)',
'--variable', 'OS', '<(OS)',
'--result', '<@(_outputs)',
'base_unittests.isolate',
],
Expand Down
4 changes: 2 additions & 2 deletions net/net.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,8 @@
'python',
'../tools/isolate/isolate.py',
'--mode', '<(tests_run)',
'--variable', 'PRODUCT_DIR=<(PRODUCT_DIR)',
'--variable', 'OS=<(OS)',
'--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR)',
'--variable', 'OS', '<(OS)',
'--result', '<@(_outputs)',
'net_unittests.isolate',
],
Expand Down
2 changes: 1 addition & 1 deletion third_party/cacheinvalidation/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Description:
This is the API to talk to the Google Cache Invalidation service.

Local Modifications:
None.
None
6 changes: 3 additions & 3 deletions third_party/cacheinvalidation/cacheinvalidation.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@
'python',
'../../tools/isolate/isolate.py',
'--mode', '<(tests_run)',
'--variable', 'DEPTH=<(DEPTH)',
'--variable', 'PRODUCT_DIR=<(PRODUCT_DIR)',
'--variable', 'OS=<(OS)',
'--variable', 'DEPTH', '<(DEPTH)',
'--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR)',
'--variable', 'OS', '<(OS)',
'--result', '<@(_outputs)',
'cacheinvalidation_unittests.isolate',
],
Expand Down
11 changes: 6 additions & 5 deletions tools/isolate/isolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ def get_valid_modes():


def main():
default_variables = ['OS=%s' % trace_inputs.get_flavor()]
default_variables = [('OS', trace_inputs.get_flavor())]
if sys.platform in ('win32', 'cygwin'):
default_variables.append('EXECUTABLE_SUFFIX=.exe')
default_variables.append(('EXECUTABLE_SUFFIX', '.exe'))
else:
default_variables.append('EXECUTABLE_SUFFIX=')
default_variables.append(('EXECUTABLE_SUFFIX', ''))
valid_modes = get_valid_modes()
parser = optparse.OptionParser(
usage='%prog [options] [.isolate file]',
Expand All @@ -443,10 +443,11 @@ def main():
help='Result file to store the json manifest')
parser.add_option(
'-V', '--variable',
nargs=2,
action='append',
default=default_variables,
dest='variables',
metavar='FOO=BAR',
metavar='FOO BAR',
help='Variables to process in the .isolate file, default: %default')
parser.add_option(
'-o', '--outdir', metavar='DIR',
Expand All @@ -470,7 +471,7 @@ def main():
isolate_dir = os.path.dirname(input_file)

# Extract the variables.
variables = dict(i.split('=', 1) for i in options.variables)
variables = dict(options.variables)
# Process path variables as a special case. First normalize it, verifies it
# exists, convert it to an absolute path, then set it as relative to
# isolate_dir.
Expand Down
11 changes: 6 additions & 5 deletions tools/isolate/isolate_smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_touch_root(self):
self._expected_result(['touch_root.py'], None)

def test_with_flag(self):
self._execute('check', 'with_flag.isolate', ['-V', 'FLAG=gyp'], False)
self._execute('check', 'with_flag.isolate', ['-V', 'FLAG', 'gyp'], False)
self._expect_no_tree()
self._expected_result(['with_flag.py', 'gyp'], None)

Expand Down Expand Up @@ -317,7 +317,8 @@ def test_touch_root(self):
self._expected_result(['touch_root.py'], None)

def test_with_flag(self):
self._execute('hashtable', 'with_flag.isolate', ['-V', 'FLAG=gyp'], False)
self._execute(
'hashtable', 'with_flag.isolate', ['-V', 'FLAG', 'gyp'], False)
self._expected_hash_tree()
self._expected_result(['with_flag.py', 'gyp'], None)

Expand Down Expand Up @@ -359,7 +360,7 @@ def test_touch_root(self):
self._expected_result(['touch_root.py'], None)

def test_with_flag(self):
self._execute('remap', 'with_flag.isolate', ['-V', 'FLAG=gyp'], False)
self._execute('remap', 'with_flag.isolate', ['-V', 'FLAG', 'gyp'], False)
self._expected_tree()
self._expected_result(['with_flag.py', 'gyp'], None)

Expand Down Expand Up @@ -412,7 +413,7 @@ def test_touch_root(self):
self._expected_result(['touch_root.py'], None)

def test_with_flag(self):
self._execute('run', 'with_flag.isolate', ['-V', 'FLAG=run'], False)
self._execute('run', 'with_flag.isolate', ['-V', 'FLAG', 'run'], False)
# Not sure about the empty tree, should be deleted.
self._expect_empty_tree()
self._expected_result(['with_flag.py', 'run'], None)
Expand Down Expand Up @@ -493,7 +494,7 @@ def test_touch_root(self):

def test_with_flag(self):
out = self._execute(
'trace', 'with_flag.isolate', ['-V', 'FLAG=trace'], True)
'trace', 'with_flag.isolate', ['-V', 'FLAG', 'trace'], True)
self._expect_no_tree()
self._expected_result(['with_flag.py', 'trace'], None)
expected = {
Expand Down

0 comments on commit 5b79035

Please sign in to comment.