summaryrefslogtreecommitdiffstats
path: root/test/DVIPS
diff options
context:
space:
mode:
authorWilliam Blevins <wblevins001@gmail.com>2016-10-03 06:08:04 (GMT)
committerWilliam Blevins <wblevins001@gmail.com>2016-10-03 06:08:04 (GMT)
commit5587089a661a520a32c353ea886939cd63a0636a (patch)
tree22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/DVIPS
parent6dd3fd8b838d18d65edd6e7adabf3a363437f8a9 (diff)
downloadSCons-5587089a661a520a32c353ea886939cd63a0636a.zip
SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.gz
SCons-5587089a661a520a32c353ea886939cd63a0636a.tar.bz2
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/DVIPS')
-rw-r--r--test/DVIPS/PSCOM.py16
-rw-r--r--test/DVIPS/PSCOMSTR.py16
2 files changed, 4 insertions, 28 deletions
diff --git a/test/DVIPS/PSCOM.py b/test/DVIPS/PSCOM.py
index fe4832b..1b90736 100644
--- a/test/DVIPS/PSCOM.py
+++ b/test/DVIPS/PSCOM.py
@@ -34,21 +34,11 @@ _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 [l for l in infile.readlines() if l != '/*ps*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'dvips'],
- PSCOM = r'%(_python_)s myps.py $TARGET $SOURCES')
+ PSCOM = r'%(_python_)s mycompile.py ps $TARGET $SOURCES')
env.PostScript(target = 'aaa', source = 'aaa.dvi')
""" % locals())
@@ -58,8 +48,6 @@ test.run()
test.must_match('aaa.ps', "aaa.dvi\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/DVIPS/PSCOMSTR.py b/test/DVIPS/PSCOMSTR.py
index 7c57ded..0d754d2 100644
--- a/test/DVIPS/PSCOMSTR.py
+++ b/test/DVIPS/PSCOMSTR.py
@@ -35,21 +35,11 @@ _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 [l for l in infile.readlines() if l != '/*ps*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['default', 'dvips'],
- PSCOM = r'%(_python_)s myps.py $TARGET $SOURCES',
+ PSCOM = r'%(_python_)s mycompile.py ps $TARGET $SOURCES',
PSCOMSTR = 'PostScripting $TARGET from $SOURCE')
env.PostScript(target = 'aaa', source = 'aaa.dvi')
""" % locals())
@@ -62,8 +52,6 @@ PostScripting aaa.ps from aaa.dvi
test.must_match('aaa.ps', "aaa.dvi\n")
-
-
test.pass_test()
# Local Variables: