diff options
author | Steven Knight <knight@baldmt.com> | 2005-01-06 01:39:03 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-01-06 01:39:03 (GMT) |
commit | 8209788c5d6a2554317a13416bb953b6c3f572ab (patch) | |
tree | 94c9d4e2e123a270c35f30c4b8691f1feeb0f2e3 /test | |
parent | 1344c9c2297d5e0931bfcd15a853b13d8e5caf34 (diff) | |
download | SCons-8209788c5d6a2554317a13416bb953b6c3f572ab.zip SCons-8209788c5d6a2554317a13416bb953b6c3f572ab.tar.gz SCons-8209788c5d6a2554317a13416bb953b6c3f572ab.tar.bz2 |
More command-line customizability: , , , , , , .
Diffstat (limited to 'test')
-rw-r--r-- | test/DVIPDF/DVIPDF.py (renamed from test/DVIPDF.py) | 0 | ||||
-rw-r--r-- | test/DVIPDF/DVIPDFCOM.py | 63 | ||||
-rw-r--r-- | test/DVIPDF/DVIPDFCOMSTR.py | 67 | ||||
-rw-r--r-- | test/DVIPDF/DVIPDFFLAGS.py (renamed from test/DVIPDFFLAGS.py) | 0 | ||||
-rw-r--r-- | test/DVIPS/DVIPS.py (renamed from test/DVIPS.py) | 0 | ||||
-rw-r--r-- | test/DVIPS/DVIPSFLAGS.py (renamed from test/DVIPSFLAGS.py) | 0 | ||||
-rw-r--r-- | test/DVIPS/PSCOM.py | 63 | ||||
-rw-r--r-- | test/DVIPS/PSCOMSTR.py | 67 | ||||
-rw-r--r-- | test/Ghostscript/GS.py (renamed from test/GS.py) | 0 | ||||
-rw-r--r-- | test/Ghostscript/GSCOM.py | 63 | ||||
-rw-r--r-- | test/Ghostscript/GSCOMSTR.py | 67 | ||||
-rw-r--r-- | test/M4/M4.py (renamed from test/M4.py) | 0 | ||||
-rw-r--r-- | test/M4/M4COM.py | 63 | ||||
-rw-r--r-- | test/M4/M4COMSTR.py | 67 | ||||
-rw-r--r-- | test/Perforce/P4COM.py | 121 | ||||
-rw-r--r-- | test/Perforce/P4COMSTR.py | 122 | ||||
-rw-r--r-- | test/Perforce/Perforce.py (renamed from test/Perforce.py) | 0 | ||||
-rw-r--r-- | test/SWIG/SWIG.py (renamed from test/SWIG.py) | 0 | ||||
-rw-r--r-- | test/SWIG/SWIGCOM.py | 66 | ||||
-rw-r--r-- | test/SWIG/SWIGCOMSTR.py | 71 |
20 files changed, 900 insertions, 0 deletions
diff --git a/test/DVIPDF.py b/test/DVIPDF/DVIPDF.py index a140c3a..a140c3a 100644 --- a/test/DVIPDF.py +++ b/test/DVIPDF/DVIPDF.py diff --git a/test/DVIPDF/DVIPDFCOM.py b/test/DVIPDF/DVIPDFCOM.py new file mode 100644 index 0000000..61d5ce7 --- /dev/null +++ b/test/DVIPDF/DVIPDFCOM.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 $DVIPDFCOM construction variable. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mypdf.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 != '/*pdf*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'dvipdf'], + DVIPDFCOM = r'%s mypdf.py $TARGET $SOURCES') +env.PDF(target = 'aaa', source = 'aaa.dvi') +""" % python) + +test.write('aaa.dvi', "aaa.dvi\n/*pdf*/\n") + +test.run() + +test.must_match('aaa.pdf', "aaa.dvi\n") + + + +test.pass_test() diff --git a/test/DVIPDF/DVIPDFCOMSTR.py b/test/DVIPDF/DVIPDFCOMSTR.py new file mode 100644 index 0000000..6e57adb --- /dev/null +++ b/test/DVIPDF/DVIPDFCOMSTR.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 $DVIPDFCOMSTR construction variable allows you to customize +the displayed string when is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mypdf.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 != '/*pdf*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'dvipdf'], + DVIPDFCOM = r'%s mypdf.py $TARGET $SOURCES', + DVIPDFCOMSTR = 'DVIPDFing $TARGET from $SOURCE') +env.PDF(target = 'aaa', source = 'aaa.dvi') +""" % python) + +test.write('aaa.dvi', "aaa.dvi\n/*pdf*/\n") + +test.run(stdout = test.wrap_stdout("""\ +DVIPDFing aaa.pdf from aaa.dvi +""")) + +test.must_match('aaa.pdf', "aaa.dvi\n") + + + +test.pass_test() diff --git a/test/DVIPDFFLAGS.py b/test/DVIPDF/DVIPDFFLAGS.py index e9bd8ba..e9bd8ba 100644 --- a/test/DVIPDFFLAGS.py +++ b/test/DVIPDF/DVIPDFFLAGS.py diff --git a/test/DVIPS.py b/test/DVIPS/DVIPS.py index 2ae856a..2ae856a 100644 --- a/test/DVIPS.py +++ b/test/DVIPS/DVIPS.py diff --git a/test/DVIPSFLAGS.py b/test/DVIPS/DVIPSFLAGS.py index 82e57c5..82e57c5 100644 --- a/test/DVIPSFLAGS.py +++ b/test/DVIPS/DVIPSFLAGS.py diff --git a/test/DVIPS/PSCOM.py b/test/DVIPS/PSCOM.py new file mode 100644 index 0000000..65e66a2 --- /dev/null +++ b/test/DVIPS/PSCOM.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 $PSCOM construction variable. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myps.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 != '/*ps*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'dvips'], + PSCOM = r'%s myps.py $TARGET $SOURCES') +env.PostScript(target = 'aaa', source = 'aaa.dvi') +""" % python) + +test.write('aaa.dvi', "aaa.dvi\n/*ps*/\n") + +test.run() + +test.must_match('aaa.ps', "aaa.dvi\n") + + + +test.pass_test() diff --git a/test/DVIPS/PSCOMSTR.py b/test/DVIPS/PSCOMSTR.py new file mode 100644 index 0000000..9a565a4 --- /dev/null +++ b/test/DVIPS/PSCOMSTR.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 $PSCOMSTR construction variable allows you to customize +the displayed string when is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myps.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 != '/*ps*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'dvips'], + PSCOM = r'%s myps.py $TARGET $SOURCES', + PSCOMSTR = 'PostScripting $TARGET from $SOURCE') +env.PostScript(target = 'aaa', source = 'aaa.dvi') +""" % python) + +test.write('aaa.dvi', "aaa.dvi\n/*ps*/\n") + +test.run(stdout = test.wrap_stdout("""\ +PostScripting aaa.ps from aaa.dvi +""")) + +test.must_match('aaa.ps', "aaa.dvi\n") + + + +test.pass_test() diff --git a/test/GS.py b/test/Ghostscript/GS.py index a836cf6..a836cf6 100644 --- a/test/GS.py +++ b/test/Ghostscript/GS.py diff --git a/test/Ghostscript/GSCOM.py b/test/Ghostscript/GSCOM.py new file mode 100644 index 0000000..acd46f2 --- /dev/null +++ b/test/Ghostscript/GSCOM.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 $GSCOM construction variable. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mygs.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 != '/*gs*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'gs'], + GSCOM = r'%s mygs.py $TARGET $SOURCES') +env.PDF(target = 'aaa', source = 'aaa.ps') +""" % python) + +test.write('aaa.ps', "aaa.ps\n/*gs*/\n") + +test.run(arguments = '.') + +test.must_match('aaa.pdf', "aaa.ps\n") + + + +test.pass_test() diff --git a/test/Ghostscript/GSCOMSTR.py b/test/Ghostscript/GSCOMSTR.py new file mode 100644 index 0000000..9f7aee8 --- /dev/null +++ b/test/Ghostscript/GSCOMSTR.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 $GSCOMSTR construction variable allows you to customize +the displayed string when Ghostscript is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mygs.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 != '/*gs*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'gs'], + GSCOM = r'%s mygs.py $TARGET $SOURCES', + GSCOMSTR = 'GSing $TARGET from $SOURCE') +env.PDF(target = 'aaa', source = 'aaa.ps') +""" % python) + +test.write('aaa.ps', "aaa.ps\n/*gs*/\n") + +test.run(stdout = test.wrap_stdout("""\ +GSing aaa.pdf from aaa.ps +""")) + +test.must_match('aaa.pdf', "aaa.ps\n") + + + +test.pass_test() diff --git a/test/M4.py b/test/M4/M4.py index bf56e74..bf56e74 100644 --- a/test/M4.py +++ b/test/M4/M4.py diff --git a/test/M4/M4COM.py b/test/M4/M4COM.py new file mode 100644 index 0000000..d1c53b4 --- /dev/null +++ b/test/M4/M4COM.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 $M4COM construction variable. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mym4.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 != '/*m4*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'm4'], + M4COM = r'%s mym4.py $TARGET $SOURCES') +env.M4(target = 'aaa.out', source = 'aaa.in') +""" % python) + +test.write('aaa.in', "aaa.in\n/*m4*/\n") + +test.run(arguments = '.') + +test.must_match('aaa.out', "aaa.in\n") + + + +test.pass_test() diff --git a/test/M4/M4COMSTR.py b/test/M4/M4COMSTR.py new file mode 100644 index 0000000..0e14495 --- /dev/null +++ b/test/M4/M4COMSTR.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 $M4COMSTR construction variable allows you to customize +the displayed string when m4 is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('mym4.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 != '/*m4*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'm4'], + M4COM = r'%s mym4.py $TARGET $SOURCES', + M4COMSTR = 'M4ing $TARGET from $SOURCE') +env.M4(target = 'aaa.out', source = 'aaa.in') +""" % python) + +test.write('aaa.in', "aaa.in\n/*m4*/\n") + +test.run(stdout = test.wrap_stdout("""\ +M4ing aaa.out from aaa.in +""")) + +test.must_match('aaa.out', "aaa.in\n") + + + +test.pass_test() diff --git a/test/Perforce/P4COM.py b/test/Perforce/P4COM.py new file mode 100644 index 0000000..c33254a --- /dev/null +++ b/test/Perforce/P4COM.py @@ -0,0 +1,121 @@ +#!/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 setting the $P4COM variable. +""" + +import os.path + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + +test.subdir('Perforce', ['Perforce', 'sub'], 'sub') + +sub_Perforce = os.path.join('sub', 'Perforce') +sub_SConscript = os.path.join('sub', 'SConscript') +sub_all = os.path.join('sub', 'all') +sub_ddd_in = os.path.join('sub', 'ddd.in') +sub_ddd_out = os.path.join('sub', 'ddd.out') +sub_eee_in = os.path.join('sub', 'eee.in') +sub_eee_out = os.path.join('sub', 'eee.out') +sub_fff_in = os.path.join('sub', 'fff.in') +sub_fff_out = os.path.join('sub', 'fff.out') + +test.write('my-p4.py', """ +import shutil +import sys +for f in sys.argv[1:]: + shutil.copy('Perforce/'+f, f) +""") + +test.write('SConstruct', """ +def cat(env, source, target): + target = str(target[0]) + source = map(str, source) + f = open(target, "wb") + for src in source: + f.write(open(src, "rb").read()) + f.close() +env = Environment(TOOLS = ['default', 'Perforce'], + BUILDERS={'Cat':Builder(action=cat)}, + P4COM='%(python)s my-p4.py $TARGET') +env.Cat('aaa.out', 'aaa.in') +env.Cat('bbb.out', 'bbb.in') +env.Cat('ccc.out', 'ccc.in') +env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) +env.SourceCode('.', env.Perforce()) +SConscript('sub/SConscript', "env") +""" % locals()) + +test.write(['Perforce', 'sub', 'SConscript'], """\ +Import("env") +env.Cat('ddd.out', 'ddd.in') +env.Cat('eee.out', 'eee.in') +env.Cat('fff.out', 'fff.in') +env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) +""") + +test.write(['Perforce', 'aaa.in'], "Perforce/aaa.in\n") +test.write('bbb.in', "checked-out bbb.in\n") +test.write(['Perforce', 'ccc.in'], "Perforce/ccc.in\n") + +test.write(['Perforce', 'sub', 'ddd.in'], "Perforce/sub/ddd.in\n") +test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") +test.write(['Perforce', 'sub', 'fff.in'], "Perforce/sub/fff.in\n") + +test.run(arguments = '.', + stdout = test.wrap_stdout(read_str = """\ +%(python)s my-p4.py %(sub_SConscript)s +""" % locals(), + build_str = """\ +%(python)s my-p4.py aaa.in +cat(["aaa.out"], ["aaa.in"]) +cat(["bbb.out"], ["bbb.in"]) +%(python)s my-p4.py ccc.in +cat(["ccc.out"], ["ccc.in"]) +cat(["all"], ["aaa.out", "bbb.out", "ccc.out"]) +%(python)s my-p4.py %(sub_ddd_in)s +cat(["%(sub_ddd_out)s"], ["%(sub_ddd_in)s"]) +cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) +%(python)s my-p4.py %(sub_fff_in)s +cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) +cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) +""" % locals())) + +test.must_match('all', + "Perforce/aaa.in\nchecked-out bbb.in\nPerforce/ccc.in\n") + +test.must_match(['sub', 'all'], + "Perforce/sub/ddd.in\nchecked-out sub/eee.in\nPerforce/sub/fff.in\n") + + + +# +test.pass_test() diff --git a/test/Perforce/P4COMSTR.py b/test/Perforce/P4COMSTR.py new file mode 100644 index 0000000..d9a3bc0 --- /dev/null +++ b/test/Perforce/P4COMSTR.py @@ -0,0 +1,122 @@ +#!/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 setting the $P4COMSTR variable. +""" + +import os.path + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + +test.subdir('Perforce', ['Perforce', 'sub'], 'sub') + +sub_Perforce = os.path.join('sub', 'Perforce') +sub_SConscript = os.path.join('sub', 'SConscript') +sub_all = os.path.join('sub', 'all') +sub_ddd_in = os.path.join('sub', 'ddd.in') +sub_ddd_out = os.path.join('sub', 'ddd.out') +sub_eee_in = os.path.join('sub', 'eee.in') +sub_eee_out = os.path.join('sub', 'eee.out') +sub_fff_in = os.path.join('sub', 'fff.in') +sub_fff_out = os.path.join('sub', 'fff.out') + +test.write('my-p4.py', """ +import shutil +import sys +for f in sys.argv[1:]: + shutil.copy('Perforce/'+f, f) +""") + +test.write('SConstruct', """ +def cat(env, source, target): + target = str(target[0]) + source = map(str, source) + f = open(target, "wb") + for src in source: + f.write(open(src, "rb").read()) + f.close() +env = Environment(TOOLS = ['default', 'Perforce'], + BUILDERS={'Cat':Builder(action=cat)}, + P4COM='%(python)s my-p4.py $TARGET', + P4COMSTR='Checking out $TARGET from our fake Perforce') +env.Cat('aaa.out', 'aaa.in') +env.Cat('bbb.out', 'bbb.in') +env.Cat('ccc.out', 'ccc.in') +env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) +env.SourceCode('.', env.Perforce()) +SConscript('sub/SConscript', "env") +""" % locals()) + +test.write(['Perforce', 'sub', 'SConscript'], """\ +Import("env") +env.Cat('ddd.out', 'ddd.in') +env.Cat('eee.out', 'eee.in') +env.Cat('fff.out', 'fff.in') +env.Cat('all', ['ddd.out', 'eee.out', 'fff.out']) +""") + +test.write(['Perforce', 'aaa.in'], "Perforce/aaa.in\n") +test.write('bbb.in', "checked-out bbb.in\n") +test.write(['Perforce', 'ccc.in'], "Perforce/ccc.in\n") + +test.write(['Perforce', 'sub', 'ddd.in'], "Perforce/sub/ddd.in\n") +test.write(['sub', 'eee.in'], "checked-out sub/eee.in\n") +test.write(['Perforce', 'sub', 'fff.in'], "Perforce/sub/fff.in\n") + +test.run(arguments = '.', + stdout = test.wrap_stdout(read_str = """\ +Checking out %(sub_SConscript)s from our fake Perforce +""" % locals(), + build_str = """\ +Checking out aaa.in from our fake Perforce +cat(["aaa.out"], ["aaa.in"]) +cat(["bbb.out"], ["bbb.in"]) +Checking out ccc.in from our fake Perforce +cat(["ccc.out"], ["ccc.in"]) +cat(["all"], ["aaa.out", "bbb.out", "ccc.out"]) +Checking out %(sub_ddd_in)s from our fake Perforce +cat(["%(sub_ddd_out)s"], ["%(sub_ddd_in)s"]) +cat(["%(sub_eee_out)s"], ["%(sub_eee_in)s"]) +Checking out %(sub_fff_in)s from our fake Perforce +cat(["%(sub_fff_out)s"], ["%(sub_fff_in)s"]) +cat(["%(sub_all)s"], ["%(sub_ddd_out)s", "%(sub_eee_out)s", "%(sub_fff_out)s"]) +""" % locals())) + +test.must_match('all', + "Perforce/aaa.in\nchecked-out bbb.in\nPerforce/ccc.in\n") + +test.must_match(['sub', 'all'], + "Perforce/sub/ddd.in\nchecked-out sub/eee.in\nPerforce/sub/fff.in\n") + + + +# +test.pass_test() diff --git a/test/Perforce.py b/test/Perforce/Perforce.py index 5808b23..5808b23 100644 --- a/test/Perforce.py +++ b/test/Perforce/Perforce.py diff --git a/test/SWIG.py b/test/SWIG/SWIG.py index 2a0ee32..2a0ee32 100644 --- a/test/SWIG.py +++ b/test/SWIG/SWIG.py diff --git a/test/SWIG/SWIGCOM.py b/test/SWIG/SWIGCOM.py new file mode 100644 index 0000000..22e217a --- /dev/null +++ b/test/SWIG/SWIGCOM.py @@ -0,0 +1,66 @@ +#!/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 $SWIGCOM construction variable. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myswig.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 != '/*swig*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'swig'], + SWIGCOM = r'%s myswig.py $TARGET $SOURCES') +env.CFile(target = 'aaa', source = 'aaa.i') +env.CXXFile(target = 'bbb', source = 'bbb.i', SWIGFLAGS='-c++') +""" % python) + +test.write('aaa.i', "aaa.i\n/*swig*/\n") +test.write('bbb.i', "bbb.i\n/*swig*/\n") + +test.run(arguments = '.') + +test.must_match('aaa_wrap.c', "aaa.i\n") +test.must_match('bbb_wrap.cc', "bbb.i\n") + + + +test.pass_test() diff --git a/test/SWIG/SWIGCOMSTR.py b/test/SWIG/SWIGCOMSTR.py new file mode 100644 index 0000000..3ffcdbf --- /dev/null +++ b/test/SWIG/SWIGCOMSTR.py @@ -0,0 +1,71 @@ +#!/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 $SWIGCOMSTR construction variable allows you to customize +the displayed string when swig is called. +""" + +import TestSCons + +python = TestSCons.python + +test = TestSCons.TestSCons() + + + +test.write('myswig.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 != '/*swig*/\\n', infile.readlines()): + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['default', 'swig'], + SWIGCOM = r'%s myswig.py $TARGET $SOURCES', + SWIGCOMSTR = 'Swigging $TARGET from $SOURCE') +env.CFile(target = 'aaa', source = 'aaa.i') +env.CXXFile(target = 'bbb', source = 'bbb.i', SWIGFLAGS='-c++') +""" % python) + +test.write('aaa.i', "aaa.i\n/*swig*/\n") +test.write('bbb.i', "bbb.i\n/*swig*/\n") + +test.run(stdout = test.wrap_stdout("""\ +Swigging aaa_wrap.c from aaa.i +Swigging bbb_wrap.cc from bbb.i +""")) + +test.must_match('aaa_wrap.c', "aaa.i\n") +test.must_match('bbb_wrap.cc', "bbb.i\n") + + + +test.pass_test() |