diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 7 | ||||
-rw-r--r-- | src/engine/SCons/Tool/wix.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/wixTests.py | 62 |
3 files changed, 72 insertions, 5 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2378ba0..13d8f7c 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,8 +6,11 @@ RELEASE 2.X.X - - From anatoly techtonik: - + Ability to run scripts/scons.py directly from source checkout. + From Anatoly Techtonik: + - Added ability to run scripts/scons.py directly from source checkout + + From Juan Lang: + - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output From Alexey Klimkin: - Fix nested LIBPATH expansion by flattening sequences in subst_path. diff --git a/src/engine/SCons/Tool/wix.py b/src/engine/SCons/Tool/wix.py index 32cc1f1..c898949 100644 --- a/src/engine/SCons/Tool/wix.py +++ b/src/engine/SCons/Tool/wix.py @@ -47,15 +47,17 @@ def generate(env): env['WIXLIGHTFLAGS'].append( '-nologo' ) env['WIXLIGHTCOM'] = "$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}" + env['WIXSRCSUF'] = '.wxs' + env['WIXOBJSUF'] = '.wixobj' object_builder = SCons.Builder.Builder( action = '$WIXCANDLECOM', - suffix = '.wxiobj', - src_suffix = '.wxs') + suffix = '$WIXOBJSUF', + src_suffix = '$WIXSRCSUF') linker_builder = SCons.Builder.Builder( action = '$WIXLIGHTCOM', - src_suffix = '.wxiobj', + src_suffix = '$WIXOBJSUF', src_builder = object_builder) env['BUILDERS']['WiX'] = linker_builder diff --git a/src/engine/SCons/Tool/wixTests.py b/src/engine/SCons/Tool/wixTests.py new file mode 100644 index 0000000..8240d68 --- /dev/null +++ b/src/engine/SCons/Tool/wixTests.py @@ -0,0 +1,62 @@ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +import unittest +import os.path +import os +import sys + +import SCons.Errors +from SCons.Tool.wix import * +from SCons.Environment import Environment + +import TestCmd + +# create fake candle and light, so the tool's exists() method will succeed +test = TestCmd.TestCmd(workdir = '') +test.write('candle.exe', 'rem this is candle') +test.write('light.exe', 'rem this is light') +os.environ['PATH'] += os.pathsep + test.workdir + +class WixTestCase(unittest.TestCase): + def test_vars(self): + """Test that WiX tool adds vars""" + env = Environment(tools=['wix']) + assert env['WIXCANDLE'] is not None + assert env['WIXCANDLEFLAGS'] is not None + assert '-loc' in env['WIXLIGHTFLAGS'] + assert env.subst('$WIXOBJSUF') == '.wixobj' + assert env.subst('$WIXSRCSUF') == '.wxs' + +if __name__ == "__main__": + suite = unittest.makeSuite(WixTestCase, 'test_') + if not unittest.TextTestRunner().run(suite).wasSuccessful(): + sys.exit(1) + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: |