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/ZIP | |
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/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 dae6f605..00000000 --- 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 adbc6acb..00000000 --- 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 0546626b..00000000 --- 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 4d84ccfe..c6c1412f 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 dae6f605..00000000 --- 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 8474a294..00000000 --- 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 f0fcc513..00000000 --- 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 a26ed497..af9ba57b 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 """)) |