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

Side by Side Diff: tools/mb/mb_unittest.py

Issue 1082323004: Make sure 'mb analyze' handles "all" correctly as a target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch for landing Created 5 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 unified diff | Download patch
« no previous file with comments | « tools/mb/mb.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Tests for mb.py.""" 5 """Tests for mb.py."""
6 6
7 import json 7 import json
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 self.check(['analyze', '-c', 'gn_debug', '//out/Default', 132 self.check(['analyze', '-c', 'gn_debug', '//out/Default',
133 '/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0) 133 '/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0)
134 out = json.loads(mbw.files['/tmp/out.json']) 134 out = json.loads(mbw.files['/tmp/out.json'])
135 self.assertEqual(out, { 135 self.assertEqual(out, {
136 'status': 'Found dependency', 136 'status': 'Found dependency',
137 'targets': ['foo_unittests'], 137 'targets': ['foo_unittests'],
138 'build_targets': ['foo_unittests'] 138 'build_targets': ['foo_unittests']
139 }) 139 })
140 140
141 def test_gn_analyze_all(self):
142 files = {'/tmp/in.json': """{\
143 "files": ["foo/foo_unittest.cc"],
144 "targets": ["all", "bar_unittests"]
145 }"""}
146 mbw = self.fake_mbw(files)
147 mbw.Call = lambda cmd: (0, 'out/Default/foo_unittests\n', '')
148
149 self.check(['analyze', '-c', 'gn_debug', '//out/Default',
150 '/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0)
151 out = json.loads(mbw.files['/tmp/out.json'])
152 self.assertEqual(out, {
153 'status': 'Found dependency (all)',
154 })
155
141 def test_gyp_analyze(self): 156 def test_gyp_analyze(self):
142 self.check(['analyze', '-c', 'gyp_rel_bot', '//out/Release', 157 self.check(['analyze', '-c', 'gyp_rel_bot', '//out/Release',
143 '/tmp/in.json', '/tmp/out.json'], 158 '/tmp/in.json', '/tmp/out.json'],
144 ret=0) 159 ret=0)
145 160
146 def test_gen(self): 161 def test_gen(self):
147 self.check(['gen', '-c', 'gn_debug', '//out/Default'], ret=0) 162 self.check(['gen', '-c', 'gn_debug', '//out/Default'], ret=0)
148 self.check(['gen', '-c', 'gyp_rel_bot', '//out/Release'], ret=0) 163 self.check(['gen', '-c', 'gyp_rel_bot', '//out/Release'], ret=0)
149 164
150 def test_goma_dir_expansion(self): 165 def test_goma_dir_expansion(self):
(...skipping 12 matching lines...) Expand all
163 178
164 def test_lookup(self): 179 def test_lookup(self):
165 self.check(['lookup', '-c', 'gn_debug'], ret=0) 180 self.check(['lookup', '-c', 'gn_debug'], ret=0)
166 181
167 def test_validate(self): 182 def test_validate(self):
168 self.check(['validate'], ret=0) 183 self.check(['validate'], ret=0)
169 184
170 185
171 if __name__ == '__main__': 186 if __name__ == '__main__':
172 unittest.main() 187 unittest.main()
OLDNEW
« no previous file with comments | « tools/mb/mb.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698