summaryrefslogtreecommitdiff
path: root/test/TAR
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
commit19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8 (patch)
tree22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/TAR
parentfd8260b1ea1ec158bcabc8030d3a47eadf7c1255 (diff)
downloadscons-19a22ecca5a72d9f78c0bc8672e5bbe6f11e65c8.tar.gz
Moved common my<xxx>.py functions to global fixture and resolve byte/str.
Diffstat (limited to 'test/TAR')
-rw-r--r--test/TAR/TARCOM.py15
-rw-r--r--test/TAR/TARCOMSTR.py16
2 files changed, 4 insertions, 27 deletions
diff --git a/test/TAR/TARCOM.py b/test/TAR/TARCOM.py
index d1b3662a..aaf7b608 100644
--- a/test/TAR/TARCOM.py
+++ b/test/TAR/TARCOM.py
@@ -34,20 +34,11 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
-
-test.write('mytar.py', r"""
-import sys
-outfile = open(sys.argv[1], 'wb')
-infile = open(sys.argv[2], 'rb')
-for l in [l for l in infile.readlines() if l != '/*tar*/\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(TOOLS = ['tar'],
- TARCOM = r'%(_python_)s mytar.py $TARGET $SOURCE')
+ TARCOM = r'%(_python_)s mycompile.py tar $TARGET $SOURCE')
env.Tar('test1.tar', 'test1.in')
""" % locals())
@@ -60,8 +51,6 @@ test.run()
test.must_match('test1.tar', "test1.in\n")
-
-
test.pass_test()
# Local Variables:
diff --git a/test/TAR/TARCOMSTR.py b/test/TAR/TARCOMSTR.py
index 339f0ca9..817dc59e 100644
--- a/test/TAR/TARCOMSTR.py
+++ b/test/TAR/TARCOMSTR.py
@@ -35,21 +35,11 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
-
-test.write('mytar.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 != '/*tar*/\\n']:
- outfile.write(l)
-sys.exit(0)
-""")
+test.file_fixture('mycompile.py')
test.write('SConstruct', """
env = Environment(tools=['tar'],
- TARCOM = r'%(_python_)s mytar.py $TARGET $SOURCES',
+ TARCOM = r'%(_python_)s mycompile.py tar $TARGET $SOURCES',
TARCOMSTR = 'Taring $TARGET from $SOURCE')
env.Tar('aaa.tar', 'aaa.in')
""" % locals())
@@ -62,8 +52,6 @@ Taring aaa.tar from aaa.in
test.must_match('aaa.tar', "aaa.in\n")
-
-
test.pass_test()
# Local Variables: