5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 __revision__
= "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
28 Verify the -c option's ability to clean generated Visual Studio 6
29 project (.dsp) and solution (.dsw) files.
34 test
= TestSConsMSVS
.TestSConsMSVS()
35 host_arch
= test
.get_vs_host_arch()
37 # Make the test infrastructure think we have this version of MSVS installed.
38 test
._msvs
_versions
= ['6.0']
40 expected_dspfile
= TestSConsMSVS
.expected_dspfile_6_0
41 expected_dswfile
= TestSConsMSVS
.expected_dswfile_6_0
43 test
.write('SConstruct', """\
44 env=Environment(tools=['msvs'],
46 HOST_ARCH='%(HOST_ARCH)s')
50 testlocalincs = ['test.h']
51 testresources = ['test.rc']
52 testmisc = ['readme.txt']
54 p = env.MSVSProject(target = 'Test.dsp',
57 localincs = testlocalincs,
58 resources = testresources,
60 buildtarget = 'Test.exe',
62 auto_build_solution = 0)
64 env.MSVSSolution(target = 'Test.dsw',
65 slnguid = '{SLNGUID}',
68 """%{'HOST_ARCH':host_arch
})
72 test
.must_exist(test
.workpath('Test.dsp'))
73 dsp
= test
.read('Test.dsp', 'r')
74 expect
= test
.msvs_substitute(expected_dspfile
, '6.0', None, 'SConstruct')
75 # don't compare the pickled data
76 assert dsp
[:len(expect
)] == expect
, test
.diff_substr(expect
, dsp
)
78 test
.must_exist(test
.workpath('Test.dsw'))
79 dsw
= test
.read('Test.dsw', 'r')
80 expect
= test
.msvs_substitute(expected_dswfile
, '6.0', None, 'SConstruct')
81 assert dsw
== expect
, test
.diff_substr(expect
, dsw
)
83 test
.run(arguments
='-c .')
85 test
.must_not_exist(test
.workpath('Test.dsp'))
86 test
.must_not_exist(test
.workpath('Test.dsw'))
88 test
.run(arguments
='.')
90 test
.must_exist(test
.workpath('Test.dsp'))
91 test
.must_exist(test
.workpath('Test.dsw'))
93 test
.run(arguments
='-c Test.dsp')
95 test
.must_not_exist(test
.workpath('Test.dsp'))
96 test
.must_exist(test
.workpath('Test.dsw'))
98 test
.run(arguments
='-c Test.dsw')
100 test
.must_not_exist(test
.workpath('Test.dsw'))
106 # indent-tabs-mode:nil
108 # vim: set expandtab tabstop=4 shiftwidth=4: