| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2014 Google Inc. All rights reserved. | 3 # Copyright (c) 2014 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 Verifies that extra filters are pruned correctly for Visual Studio 2010 | 8 Verifies that extra filters are pruned correctly for Visual Studio 2010 |
| 9 and later. | 9 and later. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import TestGyp | 12 import TestGyp |
| 13 import os |
| 13 | 14 |
| 14 | 15 |
| 15 test = TestGyp.TestGyp(formats=['msvs']) | 16 test = TestGyp.TestGyp(formats=['msvs']) |
| 16 | 17 |
| 17 test.run_gyp('filters.gyp', '-G', 'standalone', '-G', 'msvs_version=2010') | 18 test.run_gyp('filters.gyp', '-G', 'standalone', '-G', 'msvs_version=2010') |
| 18 | 19 |
| 19 test.must_not_exist('no_source_files.vcxproj.filters') | 20 test.must_not_exist('no_source_files.vcxproj.filters') |
| 20 | 21 |
| 21 test.must_not_exist('one_source_file.vcxproj.filters') | 22 test.must_not_exist('one_source_file.vcxproj.filters') |
| 22 | 23 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 46 </ClCompile> | 47 </ClCompile> |
| 47 <ClCompile Include="..\\folder1\\nested\\b.c"> | 48 <ClCompile Include="..\\folder1\\nested\\b.c"> |
| 48 <Filter>folder1\\nested</Filter> | 49 <Filter>folder1\\nested</Filter> |
| 49 </ClCompile> | 50 </ClCompile> |
| 50 <ClCompile Include="..\\folder1\\other\\c.c"> | 51 <ClCompile Include="..\\folder1\\other\\c.c"> |
| 51 <Filter>folder1\\other</Filter> | 52 <Filter>folder1\\other</Filter> |
| 52 </ClCompile> | 53 </ClCompile> |
| 53 </ItemGroup> | 54 </ItemGroup> |
| 54 '''.replace('\n', '\r\n')) | 55 '''.replace('\n', '\r\n')) |
| 55 | 56 |
| 57 subdir_gyp = os.path.join('subdir', 'subdir.gyp') |
| 58 test.run_gyp(subdir_gyp, '-G', 'standalone', '-G', 'msvs_version=2010') |
| 59 |
| 60 test.must_contain(os.path.join('subdir', 'normalize.vcxproj.filters'), '''\ |
| 61 <ItemGroup> |
| 62 <ClCompile Include="folder1\\a.c"> |
| 63 <Filter>folder1</Filter> |
| 64 </ClCompile> |
| 65 <ClCompile Include="folder2\\b.c"> |
| 66 <Filter>folder2</Filter> |
| 67 </ClCompile> |
| 68 </ItemGroup> |
| 69 '''.replace('\n', '\r\n')) |
| 56 | 70 |
| 57 test.pass_test() | 71 test.pass_test() |
| OLD | NEW |