1 #!/usr/bin/env python
\r
5 # Permission is hereby granted, free of charge, to any person obtaining
\r
6 # a copy of this software and associated documentation files (the
\r
7 # "Software"), to deal in the Software without restriction, including
\r
8 # without limitation the rights to use, copy, modify, merge, publish,
\r
9 # distribute, sublicense, and/or sell copies of the Software, and to
\r
10 # permit persons to whom the Software is furnished to do so, subject to
\r
11 # the following conditions:
\r
13 # The above copyright notice and this permission notice shall be included
\r
14 # in all copies or substantial portions of the Software.
\r
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
\r
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
\r
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
25 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
\r
28 Verify use of Visual Studio with a hierarchical build.
\r
35 test = TestSCons.TestSCons(match = TestSCons.match_re)
\r
37 if sys.platform != 'win32':
\r
38 msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
\r
43 test.subdir('src', 'build', 'out')
\r
45 test.write('SConstruct', """
\r
46 VariantDir('build', 'src', duplicate=0)
\r
47 SConscript('build/SConscript')
\r
50 test.write('src/SConscript',"""
\r
53 env.Append(CPPPATH=os.environ.get('INCLUDE', ''),
\r
54 LIBPATH=os.environ.get('LIB', ''))
\r
55 env['PCH'] = 'StdAfx.pch'
\r
56 env['PDB'] = '#out/test.pdb'
\r
57 env['PCHSTOP'] = 'StdAfx.h'
\r
58 env.PCH('StdAfx.cpp')
\r
59 env.Program('#out/test.exe', 'test.cpp')
\r
62 test.write('src/test.cpp', '''
\r
71 test.write('src/StdAfx.h', '''
\r
72 #include <windows.h>
\r
75 test.write('src/StdAfx.cpp', '''
\r
79 test.run(arguments='out', stderr=None)
\r
81 test.must_exist(test.workpath('out/test.pdb'))
\r
82 test.must_exist(test.workpath('build/StdAfx.pch'))
\r
83 test.must_exist(test.workpath('build/StdAfx.obj'))
\r
85 test.run(arguments='-c out')
\r
87 test.must_not_exist(test.workpath('out/test.pdb'))
\r
88 test.must_not_exist(test.workpath('build/StdAfx.pch'))
\r
89 test.must_not_exist(test.workpath('build/StdAfx.obj'))
\r
97 # indent-tabs-mode:nil
99 # vim: set expandtab tabstop=4 shiftwidth=4: