| 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 import cStringIO | 6 import cStringIO |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import shutil | 9 import shutil |
| 10 import subprocess | 10 import subprocess |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 # virtualenv usage. | 96 # virtualenv usage. |
| 97 self.assertEquals(expected_end, actual[-len(expected_end):]) | 97 self.assertEquals(expected_end, actual[-len(expected_end):]) |
| 98 | 98 |
| 99 def test_trace_gyp(self): | 99 def test_trace_gyp(self): |
| 100 import trace_inputs | 100 import trace_inputs |
| 101 expected_value = { | 101 expected_value = { |
| 102 'conditions': [ | 102 'conditions': [ |
| 103 ['OS=="%s"' % trace_inputs.get_flavor(), { | 103 ['OS=="%s"' % trace_inputs.get_flavor(), { |
| 104 'variables': { | 104 'variables': { |
| 105 'isolate_dependency_tracked': [ | 105 'isolate_dependency_tracked': [ |
| 106 '<(DEPTH)/trace_inputs.py', | 106 # It is run from data/trace_inputs. |
| 107 '<(DEPTH)/%s' % FILENAME, | 107 '../trace_inputs.py', |
| 108 '../%s' % FILENAME, |
| 108 ], | 109 ], |
| 109 'isolate_dependency_untracked': [ | 110 'isolate_dependency_untracked': [ |
| 110 'trace_inputs/', | 111 'trace_inputs/', |
| 111 ], | 112 ], |
| 112 }, | 113 }, |
| 113 }], | 114 }], |
| 114 ], | 115 ], |
| 115 } | 116 } |
| 116 expected_buffer = cStringIO.StringIO() | 117 expected_buffer = cStringIO.StringIO() |
| 117 trace_inputs.pretty_print(expected_value, expected_buffer) | 118 trace_inputs.pretty_print(expected_value, expected_buffer) |
| 118 | 119 |
| 119 actual = self._execute(True) | 120 actual = self._execute(True) |
| 120 self.assertEquals(expected_buffer.getvalue(), actual) | 121 self.assertEquals(expected_buffer.getvalue(), actual) |
| 121 | 122 |
| 122 | 123 |
| 123 if __name__ == '__main__': | 124 if __name__ == '__main__': |
| 124 VERBOSE = '-v' in sys.argv | 125 VERBOSE = '-v' in sys.argv |
| 125 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) | 126 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) |
| 126 unittest.main() | 127 unittest.main() |
| OLD | NEW |