| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Unit tests for gclient.py. | 6 """Unit tests for gclient.py. |
| 7 | 7 |
| 8 See gclient_smoketest.py for integration tests. | 8 See gclient_smoketest.py for integration tests. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 fh = open(os.path.join(subdir_fn, 'fake.txt'), 'w') | 262 fh = open(os.path.join(subdir_fn, 'fake.txt'), 'w') |
| 263 print >> fh, 'bogus content' | 263 print >> fh, 'bogus content' |
| 264 fh.close() | 264 fh.close() |
| 265 | 265 |
| 266 os.chdir(topdir) | 266 os.chdir(topdir) |
| 267 | 267 |
| 268 parser = gclient.Parser() | 268 parser = gclient.Parser() |
| 269 options, _ = parser.parse_args([]) | 269 options, _ = parser.parse_args([]) |
| 270 options.force = True | 270 options.force = True |
| 271 client = gclient.GClient.LoadCurrentConfig(options) | 271 client = gclient.GClient.LoadCurrentConfig(options) |
| 272 work_queue = gclient_utils.ExecutionQueue(options.jobs, None) | 272 work_queue = gclient_utils.ExecutionQueue(options.jobs, None, False) |
| 273 for s in client.dependencies: | 273 for s in client.dependencies: |
| 274 work_queue.enqueue(s) | 274 work_queue.enqueue(s) |
| 275 work_queue.flush({}, None, [], options=options) | 275 work_queue.flush({}, None, [], options=options) |
| 276 self.assertEqual(client.GetHooks(options), [x['action'] for x in hooks]) | 276 self.assertEqual(client.GetHooks(options), [x['action'] for x in hooks]) |
| 277 | 277 |
| 278 def testTargetOS(self): | 278 def testTargetOS(self): |
| 279 """Verifies that specifying a target_os pulls in all relevant dependencies. | 279 """Verifies that specifying a target_os pulls in all relevant dependencies. |
| 280 | 280 |
| 281 The target_os variable allows specifying the name of an additional OS which | 281 The target_os variable allows specifying the name of an additional OS which |
| 282 should be considered when selecting dependencies from a DEPS' deps_os. The | 282 should be considered when selecting dependencies from a DEPS' deps_os. The |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) | 520 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) |
| 521 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) | 521 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) |
| 522 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) | 522 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) |
| 523 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) | 523 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) |
| 524 logging.basicConfig( | 524 logging.basicConfig( |
| 525 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ | 525 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ |
| 526 min(sys.argv.count('-v'), 3)], | 526 min(sys.argv.count('-v'), 3)], |
| 527 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' | 527 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' |
| 528 '%(lineno)d) %(message)s') | 528 '%(lineno)d) %(message)s') |
| 529 unittest.main() | 529 unittest.main() |
| OLD | NEW |