~hjd/ubuntu/wily/gyp/debian-merged

« back to all changes in this revision

Viewing changes to test/msvs/filters/gyptest-filters-2008.py

  • Committer: Hans Joachim Desserud
  • Date: 2015-10-31 12:46:59 UTC
  • mfrom: (6.2.6 sid)
  • Revision ID: hans_joachim_desserud-20151031124659-lzxekr6woskh4k0b
Merge latest Debian version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
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
 
5
# found in the LICENSE file.
 
6
 
 
7
"""
 
8
Verifies that extra filters are pruned correctly for Visual Studio 2008.
 
9
"""
 
10
 
 
11
import re
 
12
import TestGyp
 
13
 
 
14
 
 
15
def strip_ws(str):
 
16
    return re.sub('^ +', '', str, flags=re.M).replace('\n', '')
 
17
 
 
18
 
 
19
test = TestGyp.TestGyp(formats=['msvs'])
 
20
 
 
21
test.run_gyp('filters.gyp', '-G', 'standalone', '-G', 'msvs_version=2008')
 
22
 
 
23
test.must_contain('no_source_files.vcproj', '<Files/>')
 
24
 
 
25
test.must_contain('one_source_file.vcproj', strip_ws('''\
 
26
<Files>
 
27
  <File RelativePath="..\\folder\\a.c"/>
 
28
</Files>
 
29
'''))
 
30
 
 
31
test.must_contain('two_source_files.vcproj', strip_ws('''\
 
32
<Files>
 
33
  <File RelativePath="..\\folder\\a.c"/>
 
34
  <File RelativePath="..\\folder\\b.c"/>
 
35
</Files>
 
36
'''))
 
37
 
 
38
test.must_contain('three_files_in_two_folders.vcproj', strip_ws('''\
 
39
<Files>
 
40
  <Filter Name="folder1">
 
41
    <File RelativePath="..\\folder1\\a.c"/>
 
42
    <File RelativePath="..\\folder1\\b.c"/>
 
43
  </Filter>
 
44
  <Filter Name="folder2">
 
45
    <File RelativePath="..\\folder2\\c.c"/>
 
46
  </Filter>
 
47
</Files>
 
48
'''))
 
49
 
 
50
test.must_contain('nested_folders.vcproj', strip_ws('''\
 
51
<Files>
 
52
  <Filter Name="folder1">
 
53
    <Filter Name="nested">
 
54
      <File RelativePath="..\\folder1\\nested\\a.c"/>
 
55
      <File RelativePath="..\\folder1\\nested\\b.c"/>
 
56
    </Filter>
 
57
    <Filter Name="other">
 
58
      <File RelativePath="..\\folder1\\other\\c.c"/>
 
59
    </Filter>
 
60
  </Filter>
 
61
  <Filter Name="folder2">
 
62
    <File RelativePath="..\\folder2\\d.c"/>
 
63
  </Filter>
 
64
</Files>
 
65
'''))
 
66
 
 
67
 
 
68
test.pass_test()