diff options
author | William Blevins <wblevins001@gmail.com> | 2016-10-03 02:08:04 -0400 |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-10-03 02:08:04 -0400 |
commit | 19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8 (patch) | |
tree | 22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/DVIPDF | |
parent | fd8260b1ea1ec158bcabc8030d3a47eadf7c1255 (diff) | |
download | scons-19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8.tar.gz |
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/DVIPDF')
-rw-r--r-- | test/DVIPDF/DVIPDFCOM.py | 16 | ||||
-rw-r--r-- | test/DVIPDF/DVIPDFCOMSTR.py | 16 |
2 files changed, 4 insertions, 28 deletions
diff --git a/test/DVIPDF/DVIPDFCOM.py b/test/DVIPDF/DVIPDFCOM.py index 362279e9..ddc42b60 100644 --- a/test/DVIPDF/DVIPDFCOM.py +++ b/test/DVIPDF/DVIPDFCOM.py @@ -34,21 +34,11 @@ _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 [l for l in infile.readlines() if l != '/*pdf*/\\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(tools=['default', 'dvipdf'], - DVIPDFCOM = r'%(_python_)s mypdf.py $TARGET $SOURCES') + DVIPDFCOM = r'%(_python_)s mycompile.py pdf $TARGET $SOURCES') env.PDF(target = 'aaa', source = 'aaa.dvi') """ % locals()) @@ -58,8 +48,6 @@ test.run() test.must_match('aaa.pdf', "aaa.dvi\n") - - test.pass_test() # Local Variables: diff --git a/test/DVIPDF/DVIPDFCOMSTR.py b/test/DVIPDF/DVIPDFCOMSTR.py index 0063e84b..7cf221cd 100644 --- a/test/DVIPDF/DVIPDFCOMSTR.py +++ b/test/DVIPDF/DVIPDFCOMSTR.py @@ -35,21 +35,11 @@ _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 [l for l in infile.readlines() if l != '/*pdf*/\\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(tools=['default', 'dvipdf'], - DVIPDFCOM = r'%(_python_)s mypdf.py $TARGET $SOURCES', + DVIPDFCOM = r'%(_python_)s mycompile.py pdf $TARGET $SOURCES', DVIPDFCOMSTR = 'DVIPDFing $TARGET from $SOURCE') env.PDF(target = 'aaa', source = 'aaa.dvi') """ % locals()) @@ -62,8 +52,6 @@ DVIPDFing aaa.pdf from aaa.dvi test.must_match('aaa.pdf', "aaa.dvi\n") - - test.pass_test() # Local Variables: |