OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 """ |
| 8 Make sure paths are normalized with VS macros properly expanded on Windows. |
| 9 """ |
| 10 |
| 11 import TestGyp |
| 12 |
| 13 import sys |
| 14 |
| 15 if sys.platform == 'win32': |
| 16 test = TestGyp.TestGyp(formats=['ninja']) |
| 17 |
| 18 test.run_gyp('normalize-paths.gyp') |
| 19 |
| 20 # We can't use existence tests because any case will pass, so we check the |
| 21 # contents of ninja files directly since that's what we're most concerned |
| 22 # with anyway. |
| 23 subninja = open(test.built_file_path('obj/some_target.ninja')).read() |
| 24 if '$!product_dir' in subninja: |
| 25 test.fail_test() |
| 26 if 'out\\Default' in subninja: |
| 27 test.fail_test() |
| 28 |
| 29 second = open(test.built_file_path('obj/second.ninja')).read() |
| 30 if ('..\\..\\things\\AnotherName.exe' in second or |
| 31 'AnotherName.exe' not in second): |
| 32 test.fail_test() |
| 33 |
| 34 action = open(test.built_file_path('obj/action.ninja')).read() |
| 35 if '..\\..\\out\\Default' in action: |
| 36 test.fail_test() |
| 37 if '..\\..\\SomethingElse' in action or 'SomethingElse' not in action: |
| 38 test.fail_test() |
| 39 if '..\\..\\SomeOtherInput' in action or 'SomeOtherInput' not in action: |
| 40 test.fail_test() |
| 41 |
| 42 test.pass_test() |
OLD | NEW |