summaryrefslogtreecommitdiff
path: root/test/Ghostscript
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-10-03 02:08:04 -0400
committerWilliam Blevins <wblevins001@gmail.com>2016-10-03 02:08:04 -0400
commit5587089a661a520a32c353ea886939cd63a0636a (patch)
tree22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/Ghostscript
parent6dd3fd8b838d18d65edd6e7adabf3a363437f8a9 (diff)
downloadscons-git-5587089a661a520a32c353ea886939cd63a0636a.tar.gz
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/Ghostscript')
-rw-r--r--test/Ghostscript/GSCOM.py16
-rw-r--r--test/Ghostscript/GSCOMSTR.py16
2 files changed, 4 insertions, 28 deletions
diff --git a/test/Ghostscript/GSCOM.py b/test/Ghostscript/GSCOM.py
index c86f8b61f..fd14ad82c 100644
--- a/test/Ghostscript/GSCOM.py
+++ b/test/Ghostscript/GSCOM.py
@@ -34,21 +34,11 @@ _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 [l for l in infile.readlines() if l != '/*gs*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'gs'],
- GSCOM = r'%(_python_)s mygs.py $TARGET $SOURCES')
+ GSCOM = r'%(_python_)s mycompile.py gs $TARGET $SOURCES')
env.PDF(target = 'aaa', source = 'aaa.ps')
""" % locals())
@@ -58,8 +48,6 @@ test.run(arguments = '.')
test.must_match('aaa.pdf', "aaa.ps\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/Ghostscript/GSCOMSTR.py b/test/Ghostscript/GSCOMSTR.py
index b39cf4f60..fd82bff9e 100644
--- a/test/Ghostscript/GSCOMSTR.py
+++ b/test/Ghostscript/GSCOMSTR.py
@@ -35,21 +35,11 @@ _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 [l for l in infile.readlines() if l != '/*gs*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'gs'],
- GSCOM = r'%(_python_)s mygs.py $TARGET $SOURCES',
+ GSCOM = r'%(_python_)s mycompile.py gs $TARGET $SOURCES',
GSCOMSTR = 'GSing $TARGET from $SOURCE')
env.PDF(target = 'aaa', source = 'aaa.ps')
""" % locals())
@@ -62,8 +52,6 @@ GSing aaa.pdf from aaa.ps
test.must_match('aaa.pdf', "aaa.ps\n")
-
-
test.pass_test()
# Local Variables: