diff options
-rw-r--r-- | doc/man/scons.1 | 45 | ||||
-rw-r--r-- | src/CHANGES.txt | 11 | ||||
-rw-r--r-- | src/engine/SCons/Tool/midl.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/mingw.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/mslink.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvc.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Tool/qt.py | 12 | ||||
-rw-r--r-- | test/Ghostscript/GSFLAGS.py (renamed from test/GSFLAGS.py) | 0 | ||||
-rw-r--r-- | test/IDL/IDLSUFFIXES.py (renamed from test/IDLSUFFIXES.py) | 0 | ||||
-rw-r--r-- | test/IDL/MIDLCOM.py | 63 | ||||
-rw-r--r-- | test/IDL/MIDLCOMSTR.py | 67 | ||||
-rw-r--r-- | test/IDL/midl.py (renamed from test/midl.py) | 0 | ||||
-rw-r--r-- | test/MSVC/PCHCOM.py | 63 | ||||
-rw-r--r-- | test/MSVC/PCHCOMSTR.py | 67 | ||||
-rw-r--r-- | test/MSVC/RCCOM.py | 64 | ||||
-rw-r--r-- | test/MSVC/RCCOMSTR.py | 67 | ||||
-rw-r--r-- | test/MSVC/msvc.py (renamed from test/msvc.py) | 0 | ||||
-rw-r--r-- | test/MinGW/RCCOM.py | 64 | ||||
-rw-r--r-- | test/MinGW/RCCOMSTR.py | 67 | ||||
-rw-r--r-- | test/QT/QT.py (renamed from test/QT.py) | 0 | ||||
-rw-r--r-- | test/QT/QTFLAGS.py (renamed from test/QTFLAGS.py) | 0 | ||||
-rw-r--r-- | test/rpcgen.py | 99 |
22 files changed, 593 insertions, 119 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1 index f195c62..449eace 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -6068,6 +6068,15 @@ dependencies for the PCH file. Example: env['PCH'] = 'StdAfx.pch' .EE +.IP PCHCOM +The command line used by the +.B PCH +builder to generated a precompiled header. + +.IP PCHCOMSTR +The string displayed when generating a precompiled header. +If this is not set, then $PCHCOM (the command line) is displayed. + .IP PCHSTOP This variable specifies how much of a source file is precompiled. This variable is ignored by tools other than Microsoft Visual C++, or when @@ -6267,9 +6276,17 @@ cpp file. .IP QT_MOCFROMCXXCOM Command to generate a moc file from a cpp file. +.IP QT_MOCFROMCXXCOMSTR +The string displayed when generating a moc file from a cpp file. +If this is not set, then $QT_MOCFROMCXXCOM (the command line) is displayed. + .IP QT_MOCFROMHCOM Command to generate a moc file from a header. +.IP QT_MOCFROMHCOMSTR +The string displayed when generating a moc file from a cpp file. +If this is not set, then $QT_MOCFROMHCOM (the command line) is displayed. + .IP QT_MOCFROMHFLAGS Default value is ''. These flags are passed to moc, when moccing a header file. @@ -6284,9 +6301,13 @@ a header. .IP QT_UIC Default value is '$QT_BINPATH/uic'. -.IP QT_UICDECLCOM +.IP QT_UICCOM Command to generate header files from .ui files. +.IP QT_UICCOMSTR +The string displayed when generating header files from .ui files. +If this is not set, then $QT_UICCOM (the command line) is displayed. + .IP QT_UICDECLFLAGS Default value is ''. These flags are passed to uic, when creating a a h file from a .ui file. @@ -6297,9 +6318,6 @@ Default value is ''. Prefix for uic generated header files. .IP QT_UICDECLSUFFIX Default value is '.h'. Suffix for uic generated header files. -.IP QT_UICIMPLCOM -Command to generate cxx files from .ui files. - .IP QT_UICIMPLFLAGS Default value is ''. These flags are passed to uic, when creating a cxx file from a .ui file. @@ -6326,6 +6344,10 @@ The resource compiler used by the RES builder. .IP RCCOM The command line used by the RES builder. +.IP RCCOMSTR +The string displayed when invoking the resource compiler. +If this is not set, then $RCCOM (the command line) is displayed. + .IP RCFLAGS The flags passed to the resource compiler by the RES builder. @@ -6354,6 +6376,21 @@ If this is not set, then $RCS_COCOM .IP RCS_COFLAGS Options that are passed to the $RCS_CO command. +.IP REGSVR +The program used to register DLLs on Windows systems. + +.IP REGSVRCOM +The command line used to register a newly-built DLL file +on Windows systems. +Invoked when the "register=1" +keyword argument is passed to the +.B SharedLibrary +Builder. + +.IP REGSVRCOMSTR +The string displayed when registering a newly-built DLL file. +If this is not set, then $REGSVRCOM (the command line) is displayed. + .IP RDirs A function that converts a file name into a list of Dir instances by searching the repositories. diff --git a/src/CHANGES.txt b/src/CHANGES.txt index c2801bd..11c8e62 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -141,11 +141,12 @@ RELEASE 0.97 - XXX $CVSCOMSTR, $CXXCOMSTR, $DCOMSTR, $DVIPDFCOMSTR, $F77COMSTR, $F90COMSTR, $F95COMSTR, $FORTRANCOMSTR, $GSCOMSTR, $JARCOMSTR, $JAVACCOMSTR, $JAVAHCOMSTR, $LATEXCOMSTR, $LEXCOMSTR, $LINKCOMSTR, - $M4COMSTR, $P4COMSTR, $PDFLATEXCOMSTR, $PDFTEXCOMSTR, $PSCOMSTR, - $RCSCOMSTR, $RMICCOMSTR, $SCCSCOMSTR, $SHCCCOMSTR, $SHCXXCOMSTR, - $SHF77COMSTR, $SHF90COMSTR, $SHF95COMSTR, $SHFORTRANCOMSTR, - $SHLINKCOMSTR, $SWIGCOMSTR, $TARCOMSTR, $TEXCOMSTR, $YACCCOMSTR - and $ZIPCOMSTR. + $M4COMSTR, $MIDLCOMSTR, $P4COMSTR, $PCHCOMSTR, $PDFLATEXCOMSTR, + $PDFTEXCOMSTR, $PSCOMSTR, $QT_MOCFROMCXXCOMSTR, $QT_MOCFROMHCOMSTR, + $QT_UICCOMSTR, $RCCOMSTR, $REGSVRCOMSTR, $RCS_COCOMSTR, $RMICCOMSTR, + $SCCSCOMSTR, $SHCCCOMSTR, $SHCXXCOMSTR, $SHF77COMSTR, $SHF90COMSTR, + $SHF95COMSTR, $SHFORTRANCOMSTR, $SHLINKCOMSTR, $SWIGCOMSTR, + $TARCOMSTR, $TEXCOMSTR, $YACCCOMSTR and $ZIPCOMSTR. - Add an optional "map" keyword argument to ListOption() that takes a dictionary to map user-specified values to legal values from the list diff --git a/src/engine/SCons/Tool/midl.py b/src/engine/SCons/Tool/midl.py index 6be91ef..67579e9 100644 --- a/src/engine/SCons/Tool/midl.py +++ b/src/engine/SCons/Tool/midl.py @@ -33,6 +33,8 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Action +import SCons.Builder import SCons.Defaults import SCons.Scanner.IDL import SCons.Util @@ -53,7 +55,9 @@ def midl_emitter(target, source, env): idl_scanner = SCons.Scanner.IDL.IDLScan() -midl_builder = SCons.Builder.Builder(action='$MIDLCOM', +midl_action = SCons.Action.Action('$MIDLCOM', '$MIDLCOMSTR') + +midl_builder = SCons.Builder.Builder(action = midl_action, src_suffix = '.idl', suffix='.tlb', emitter = midl_emitter, @@ -73,5 +77,3 @@ def exists(env): return 1 else: return env.Detect('midl') - - diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py index debb873..99a5574 100644 --- a/src/engine/SCons/Tool/mingw.py +++ b/src/engine/SCons/Tool/mingw.py @@ -37,6 +37,8 @@ import os import os.path import string +import SCons.Action +import SCons.Builder import SCons.Tool import SCons.Util @@ -94,7 +96,9 @@ def shlib_emitter(target, source, env): shlib_action = SCons.Action.CommandGenerator(shlib_generator) -res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o', +res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') + +res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', source_scanner=SCons.Defaults.ObjSourceScan) SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan) diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index 0c7b7dc..98258c2 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -124,7 +124,7 @@ def RegServerFunc(target, source, env): return ret return 0 -regServerAction = SCons.Action.Action("$REGSVRCOM") +regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR") regServerCheck = SCons.Action.Action(RegServerFunc, None) shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}') compositeLinkAction = shlibLinkAction + regServerCheck diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index 34a1b94..e0ed26d 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -397,9 +397,12 @@ def shared_object_emitter(target, source, env): return object_emitter(target, source, env, SCons.Defaults.SharedObjectEmitter) -pch_builder = SCons.Builder.Builder(action='$PCHCOM', suffix='.pch', emitter=pch_emitter, +pch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR') +pch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch', + emitter=pch_emitter, source_scanner=SCons.Defaults.ObjSourceScan) -res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res', +res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') +res_builder = SCons.Builder.Builder(action=res_action, suffix='.res', source_scanner=SCons.Defaults.ObjSourceScan) SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan) diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py index 9bb0438..bc2d41b 100644 --- a/src/engine/SCons/Tool/qt.py +++ b/src/engine/SCons/Tool/qt.py @@ -1,7 +1,7 @@ """SCons.Tool.qt -Tool-specific initialization for qt. +Tool-specific initialization for Qt. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -37,6 +37,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os.path import re +import SCons.Action +import SCons.Builder import SCons.Defaults import SCons.Scanner import SCons.Tool @@ -294,7 +296,7 @@ def generate(env): Action(checkMocIncluded,None)]) # ... and the corresponding builders - uicBld = Builder(action='$QT_UICCOM', + uicBld = Builder(action=SCons.Action.Action('$QT_UICCOM', '$QT_UICCOMSTR'), emitter=uicEmitter, src_suffix='$QT_UISUFFIX', suffix='$QT_UICDECLSUFFIX', @@ -302,11 +304,13 @@ def generate(env): source_scanner=uicScanner) mocBld = Builder(action={}, prefix={}, suffix={}) for h in header_extensions: - mocBld.add_action(h, '$QT_MOCFROMHCOM') + act = SCons.Action.Action('$QT_MOCFROMHCOM', '$QT_MOCFROMHCOMSTR') + mocBld.add_action(h, act) mocBld.prefix[h] = '$QT_MOCHPREFIX' mocBld.suffix[h] = '$QT_MOCHSUFFIX' for cxx in cxx_suffixes: - mocBld.add_action(cxx, '$QT_MOCFROMCXXCOM') + act = SCons.Action.Action('$QT_MOCFROMCXXCOM', '$QT_MOCFROMCXXCOMSTR') + mocBld.add_action(cxx, act) mocBld.prefix[cxx] = '$QT_MOCCXXPREFIX' mocBld.suffix[cxx] = '$QT_MOCCXXSUFFIX' diff --git a/test/GSFLAGS.py b/test/Ghostscript/GSFLAGS.py index 14ce769..14ce769 100644 --- a/test/GSFLAGS.py +++ b/test/Ghostscript/GSFLAGS.py diff --git a/test/IDLSUFFIXES.py b/test/IDL/IDLSUFFIXES.py index 2aaf9fe..2aaf9fe 100644 --- a/test/IDLSUFFIXES.py +++ b/test/IDL/IDLSUFFIXES.py diff --git a/test/IDL/MIDLCOM.py b/test/IDL/MIDLCOM.py new file mode 100644 index 0000000..d3f6420 --- /dev/null +++ b/test/IDL/MIDLCOM.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test the ability to configure the $MIDLCOM construction variable. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mymidl.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*midl*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'midl'], + MIDLCOM = r'%s mymidl.py $TARGET $SOURCES') +env.TypeLibrary(target = 'aaa', source = 'aaa.idl') +""" % python) + +test.write('aaa.idl', "aaa.idl\n/*midl*/\n") + +test.run(arguments = '.') + +test.must_match('aaa.tlb', "aaa.idl\n") + + + +test.pass_test() diff --git a/test/IDL/MIDLCOMSTR.py b/test/IDL/MIDLCOMSTR.py new file mode 100644 index 0000000..89a6e25 --- /dev/null +++ b/test/IDL/MIDLCOMSTR.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that the $MIDLCOMSTR construction variable allows you to customize +the displayed string when midl is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mymidl.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*midl*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'midl'], + MIDLCOM = r'%s mymidl.py $TARGET $SOURCES', + MIDLCOMSTR = 'MIDLing $TARGET from $SOURCE') +env.TypeLibrary(target = 'aaa', source = 'aaa.idl') +""" % python) + +test.write('aaa.idl', "aaa.idl\n/*midl*/\n") + +test.run(stdout = test.wrap_stdout("""\ +MIDLing aaa.tlb from aaa.idl +""")) + +test.must_match('aaa.tlb', "aaa.idl\n") + + + +test.pass_test() diff --git a/test/midl.py b/test/IDL/midl.py index a41ac01..a41ac01 100644 --- a/test/midl.py +++ b/test/IDL/midl.py diff --git a/test/MSVC/PCHCOM.py b/test/MSVC/PCHCOM.py new file mode 100644 index 0000000..593a1c1 --- /dev/null +++ b/test/MSVC/PCHCOM.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test the ability to configure the $MIDLCOM construction variable. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mypch.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*pch*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'msvc'], + PCHCOM = r'%s mypch.py $TARGET $SOURCES') +env.PCH(target = 'aaa', source = 'aaa.h') +""" % python) + +test.write('aaa.h', "aaa.h\n/*pch*/\n") + +test.run(arguments = ".") + +test.must_match('aaa.pch', "aaa.h\n") + + + +test.pass_test() diff --git a/test/MSVC/PCHCOMSTR.py b/test/MSVC/PCHCOMSTR.py new file mode 100644 index 0000000..c5ab9f5 --- /dev/null +++ b/test/MSVC/PCHCOMSTR.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that the $PCHCOMSTR construction variable allows you to customize +the displayed string when pch is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mypch.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*pch*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'msvc'], + PCHCOM = r'%s mypch.py $TARGET $SOURCES', + PCHCOMSTR = 'PCHing $TARGET from $SOURCE') +env.PCH(target = 'aaa', source = 'aaa.h') +""" % python) + +test.write('aaa.h', "aaa.h\n/*pch*/\n") + +test.run(stdout = test.wrap_stdout("""\ +PCHing aaa.pch from aaa.h +""")) + +test.must_match('aaa.pch', "aaa.h\n") + + + +test.pass_test() diff --git a/test/MSVC/RCCOM.py b/test/MSVC/RCCOM.py new file mode 100644 index 0000000..3262f0c --- /dev/null +++ b/test/MSVC/RCCOM.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test the ability to configure the $RCCOM construction variable +when using MSVC. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myrc.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'msvc'], + RCCOM = r'%(python)s myrc.py $TARGET $SOURCES') +env.RES(target = 'aaa', source = 'aaa.rc') +""" % locals()) + +test.write('aaa.rc', "aaa.rc\n/*rc*/\n") + +test.run(arguments = ".") + +test.must_match('aaa.res', "aaa.rc\n") + + + +test.pass_test() diff --git a/test/MSVC/RCCOMSTR.py b/test/MSVC/RCCOMSTR.py new file mode 100644 index 0000000..33e192b --- /dev/null +++ b/test/MSVC/RCCOMSTR.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that the $RCCOMSTR construction variable allows you to customize +the displayed string when rc is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myrc.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'msvc'], + RCCOM = r'%(python)s myrc.py $TARGET $SOURCES', + RCCOMSTR = 'RCing $TARGET from $SOURCE') +env.RES(target = 'aaa', source = 'aaa.rc') +""" % locals()) + +test.write('aaa.rc', "aaa.rc\n/*rc*/\n") + +test.run(stdout = test.wrap_stdout("""\ +RCing aaa.res from aaa.rc +""")) + +test.must_match('aaa.res', "aaa.rc\n") + + + +test.pass_test() diff --git a/test/msvc.py b/test/MSVC/msvc.py index fe5bfee..fe5bfee 100644 --- a/test/msvc.py +++ b/test/MSVC/msvc.py diff --git a/test/MinGW/RCCOM.py b/test/MinGW/RCCOM.py new file mode 100644 index 0000000..4ddcd91 --- /dev/null +++ b/test/MinGW/RCCOM.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test the ability to configure the $RCCOM construction variable +when using MinGW. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myrc.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'mingw'], + RCCOM = r'%(python)s myrc.py $TARGET $SOURCES') +env.RES(target = 'aaa', source = 'aaa.rc') +""" % locals()) + +test.write('aaa.rc', "aaa.rc\n/*rc*/\n") + +test.run(arguments = ".") + +test.must_match('aaa.o', "aaa.rc\n") + + + +test.pass_test() diff --git a/test/MinGW/RCCOMSTR.py b/test/MinGW/RCCOMSTR.py new file mode 100644 index 0000000..e095847 --- /dev/null +++ b/test/MinGW/RCCOMSTR.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that the $RCCOMSTR construction variable allows you to customize +the displayed string when rc is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myrc.py', """ +import sys +outfile = open(sys.argv[1], 'wb') +for f in sys.argv[2:]: + infile = open(f, 'rb') + for l in filter(lambda l: l != '/*rc*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'mingw'], + RCCOM = r'%(python)s myrc.py $TARGET $SOURCES', + RCCOMSTR = 'RCing $TARGET from $SOURCE') +env.RES(target = 'aaa', source = 'aaa.rc') +""" % locals()) + +test.write('aaa.rc', "aaa.rc\n/*rc*/\n") + +test.run(stdout = test.wrap_stdout("""\ +RCing aaa.o from aaa.rc +""")) + +test.must_match('aaa.o', "aaa.rc\n") + + + +test.pass_test() diff --git a/test/QT.py b/test/QT/QT.py index 680784f..680784f 100644 --- a/test/QT.py +++ b/test/QT/QT.py diff --git a/test/QTFLAGS.py b/test/QT/QTFLAGS.py index f9cb917..f9cb917 100644 --- a/test/QTFLAGS.py +++ b/test/QT/QTFLAGS.py diff --git a/test/rpcgen.py b/test/rpcgen.py deleted file mode 100644 index 7c9f8ec..0000000 --- a/test/rpcgen.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python -# -# __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 os -import string -import sys -import TestSCons - -_exe = TestSCons._exe -test = TestSCons.TestSCons() - -rpcgen = test.where_is('rpcgen') -if not rpcgen: - print "rpcgen not found, skipping test" - test.pass_test(1) - -test.subdir('do_rpcgen') - -test.write('SConstruct', """\ -import os -env = Environment(ENV=os.environ) -env.Program('rpcclnt', ['rpcclnt.c', 'do_rpcgen/rpcif_clnt.c']) -env.RPCGenHeader('do_rpcgen/rpcif') -env.RPCGenClient('do_rpcgen/rpcif') -env.RPCGenService('do_rpcgen/rpcif') -env.RPCGenXDR('do_rpcgen/rpcif') -""") - -test.write(['do_rpcgen', 'rpcif.x'], """\ -program RPCTEST_IF -{ - version RPCTEST_IF_VERSION - { - int START(unsigned long) = 1; - int STOP(unsigned long) = 2; - int STATUS(unsigned long) = 3; - } = 1; /* version */ -} = 0xfeedf00d; /* portmap program ID */ -""") - -# Following test tries to make sure it can compile and link, but when -# it's run it doesn't actually invoke any rpc operations because that -# would have significant dependencies on network configuration, -# portmapper, etc. that aren't necessarily appropriate for an scons -# test. - -test.write('rpcclnt.c', """\ -#include <rpc/rpc.h> -#include <rpc/pmap_clnt.h> -#include "do_rpcgen/rpcif.h" - -int main(int argc, char **args) { - const char* const SERVER = "localhost"; - CLIENT *cl; - int *rslt; - unsigned long arg = 0; - if (argc > 2) { - cl = clnt_create( SERVER, RPCTEST_IF, RPCTEST_IF_VERSION, "udp" ); - if (cl == 0 ) { return 1; } - rslt = start_1(&arg, cl); - if (*rslt == 0) { clnt_perror( cl, SERVER ); return 1; } - clnt_destroy(cl); - } else - printf("Hello!\\n"); - return 0; -} -""") - - -test.run() - -test.run(program=test.workpath('rpcclnt'+_exe)) - -test.fail_test(not test.stdout() in ["Hello!\n", "Hello!\r\n"]) - -test.pass_test() |