| 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 test_env # pylint: disable=W0403,W0611 |
| 6 | 7 |
| 7 import os | |
| 8 import sys | |
| 9 import unittest | 8 import unittest |
| 10 | 9 |
| 11 here = os.path.dirname(sys.argv[0]) | |
| 12 sys.path.insert(0, os.path.join(here, '..', '..', 'site_config')) | |
| 13 sys.path.insert(0, os.path.join(here, '..')) | |
| 14 sys.path.insert(0, here) | |
| 15 | |
| 16 import slave.slave_utils as slave_utils | 10 import slave.slave_utils as slave_utils |
| 17 | 11 |
| 18 | 12 |
| 19 class TestGypFlags(unittest.TestCase): | 13 class TestGypFlags(unittest.TestCase): |
| 20 | 14 |
| 21 # So that python 2.6 can test this. | 15 # So that python 2.6 can test this. |
| 22 def AssertIsNone(self, x, msg=None): | 16 def AssertIsNone(self, x, msg=None): |
| 23 self.assertTrue(x is None, msg=msg) | 17 self.assertTrue(x is None, msg=msg) |
| 24 | 18 |
| 25 def test_single_gyp_flag_one(self): | 19 def test_single_gyp_flag_one(self): |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 sample = {'factory_properties': {'gclient_env': { 'GYP_DEFINES' : | 71 sample = {'factory_properties': {'gclient_env': { 'GYP_DEFINES' : |
| 78 'tiger=1 buffalo=0 giraffe' }}} | 72 'tiger=1 buffalo=0 giraffe' }}} |
| 79 self.assertTrue(slave_utils.GypFlagIsOn(sample, 'tiger')) | 73 self.assertTrue(slave_utils.GypFlagIsOn(sample, 'tiger')) |
| 80 self.assertFalse(slave_utils.GypFlagIsOn(sample, 'buffalo')) | 74 self.assertFalse(slave_utils.GypFlagIsOn(sample, 'buffalo')) |
| 81 self.assertTrue(slave_utils.GypFlagIsOn(sample, 'giraffe')) | 75 self.assertTrue(slave_utils.GypFlagIsOn(sample, 'giraffe')) |
| 82 self.assertFalse(slave_utils.GypFlagIsOn(sample, 'monkey')) | 76 self.assertFalse(slave_utils.GypFlagIsOn(sample, 'monkey')) |
| 83 | 77 |
| 84 | 78 |
| 85 if __name__ == '__main__': | 79 if __name__ == '__main__': |
| 86 unittest.main() | 80 unittest.main() |
| OLD | NEW |