diff options
author | William Blevins <wblevins001@gmail.com> | 2016-10-03 06:08:04 (GMT) |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-10-03 06:08:04 (GMT) |
commit | 5587089a661a520a32c353ea886939cd63a0636a (patch) | |
tree | 22bf17e710505ff6f6bcf5cc4aa7badfc958d5f2 /test/ZIP | |
parent | 6dd3fd8b838d18d65edd6e7adabf3a363437f8a9 (diff) | |
download | SCons-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/ZIP')
-rw-r--r-- | test/ZIP/ZIPCOM-fixture/.exclude_tests | 1 | ||||
-rw-r--r-- | test/ZIP/ZIPCOM-fixture/myzip.py | 6 | ||||
-rw-r--r-- | test/ZIP/ZIPCOM-fixture/test1.in | 2 | ||||
-rw-r--r-- | test/ZIP/ZIPCOM.py | 6 | ||||
-rw-r--r-- | test/ZIP/ZIPCOMSTR-fixture/.exclude_tests | 1 | ||||
-rw-r--r-- | test/ZIP/ZIPCOMSTR-fixture/aaa.in | 2 | ||||
-rw-r--r-- | test/ZIP/ZIPCOMSTR-fixture/myzip.py | 7 | ||||
-rw-r--r-- | test/ZIP/ZIPCOMSTR.py | 6 |
8 files changed, 8 insertions, 23 deletions
diff --git a/test/ZIP/ZIPCOM-fixture/.exclude_tests b/test/ZIP/ZIPCOM-fixture/.exclude_tests deleted file mode 100644 index dae6f60..0000000 --- a/test/ZIP/ZIPCOM-fixture/.exclude_tests +++ /dev/null @@ -1 +0,0 @@ -myzip.py diff --git a/test/ZIP/ZIPCOM-fixture/myzip.py b/test/ZIP/ZIPCOM-fixture/myzip.py deleted file mode 100644 index adbc6ac..0000000 --- a/test/ZIP/ZIPCOM-fixture/myzip.py +++ /dev/null @@ -1,6 +0,0 @@ -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 != b'/*zip*/\n']: - outfile.write(l) -sys.exit(0) diff --git a/test/ZIP/ZIPCOM-fixture/test1.in b/test/ZIP/ZIPCOM-fixture/test1.in deleted file mode 100644 index 0546626..0000000 --- a/test/ZIP/ZIPCOM-fixture/test1.in +++ /dev/null @@ -1,2 +0,0 @@ -test1.in -/*zip*/ diff --git a/test/ZIP/ZIPCOM.py b/test/ZIP/ZIPCOM.py index 4d84ccf..c6c1412 100644 --- a/test/ZIP/ZIPCOM.py +++ b/test/ZIP/ZIPCOM.py @@ -34,14 +34,16 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -test.dir_fixture('ZIPCOM-fixture') +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['zip'], - ZIPCOM = r'%(_python_)s myzip.py $TARGET $SOURCE') + ZIPCOM = r'%(_python_)s mycompile.py zip $TARGET $SOURCE') env.Zip('test1.zip', 'test1.in') """ % locals()) +test.write('test1.in', 'test1.in\n/*zip*/\n') + test.run() test.must_match('test1.zip', "test1.in\n") diff --git a/test/ZIP/ZIPCOMSTR-fixture/.exclude_tests b/test/ZIP/ZIPCOMSTR-fixture/.exclude_tests deleted file mode 100644 index dae6f60..0000000 --- a/test/ZIP/ZIPCOMSTR-fixture/.exclude_tests +++ /dev/null @@ -1 +0,0 @@ -myzip.py diff --git a/test/ZIP/ZIPCOMSTR-fixture/aaa.in b/test/ZIP/ZIPCOMSTR-fixture/aaa.in deleted file mode 100644 index 8474a29..0000000 --- a/test/ZIP/ZIPCOMSTR-fixture/aaa.in +++ /dev/null @@ -1,2 +0,0 @@ -aaa.in -/*zip*/ diff --git a/test/ZIP/ZIPCOMSTR-fixture/myzip.py b/test/ZIP/ZIPCOMSTR-fixture/myzip.py deleted file mode 100644 index f0fcc51..0000000 --- a/test/ZIP/ZIPCOMSTR-fixture/myzip.py +++ /dev/null @@ -1,7 +0,0 @@ -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 != b'/*zip*/\n']: - outfile.write(l) -sys.exit(0) diff --git a/test/ZIP/ZIPCOMSTR.py b/test/ZIP/ZIPCOMSTR.py index a26ed49..af9ba57 100644 --- a/test/ZIP/ZIPCOMSTR.py +++ b/test/ZIP/ZIPCOMSTR.py @@ -35,15 +35,17 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -test.dir_fixture('ZIPCOMSTR-fixture') +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(tools=['zip'], - ZIPCOM = r'%(_python_)s myzip.py $TARGET $SOURCES', + ZIPCOM = r'%(_python_)s mycompile.py zip $TARGET $SOURCES', ZIPCOMSTR = 'Zipping $TARGET from $SOURCE') env.Zip('aaa.zip', 'aaa.in') """ % locals()) +test.write('aaa.in', 'aaa.in\n/*zip*/\n') + test.run(stdout = test.wrap_stdout("""\ Zipping aaa.zip from aaa.in """)) |