diff options
author | William Blevins <wblevins001@gmail.com> | 2016-09-22 17:19:50 -0400 |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-09-22 17:19:50 -0400 |
commit | c656843961d92cf79f14a2298054d255de67afab (patch) | |
tree | da169366f448026e53f19b21c854a9c53be79644 /test/LINK | |
parent | 2d15eeac923a7f8e2d2d1c7e1feb0f7eac95a9e7 (diff) | |
download | scons-c656843961d92cf79f14a2298054d255de67afab.tar.gz |
Yet another batch of test fixes.
Diffstat (limited to 'test/LINK')
-rw-r--r-- | test/LINK/LINK.py | 6 | ||||
-rw-r--r-- | test/LINK/LINKCOM.py | 5 | ||||
-rw-r--r-- | test/LINK/LINKCOMSTR.py | 4 | ||||
-rw-r--r-- | test/LINK/LINKFLAGS.py | 4 | ||||
-rw-r--r-- | test/LINK/SHLINK.py | 6 | ||||
-rw-r--r-- | test/LINK/SHLINKCOM.py | 4 | ||||
-rw-r--r-- | test/LINK/SHLINKCOMSTR.py | 4 | ||||
-rw-r--r-- | test/LINK/SHLINKFLAGS.py | 4 |
8 files changed, 17 insertions, 20 deletions
diff --git a/test/LINK/LINK.py b/test/LINK/LINK.py index 25d9efb8..54c75fa3 100644 --- a/test/LINK/LINK.py +++ b/test/LINK/LINK.py @@ -36,7 +36,7 @@ test = TestSCons.TestSCons() test.write("wrapper.py", """import os import sys -open('%s', 'wb').write("wrapper.py\\n") +open('%s', 'wb').write(("wrapper.py\\n").encode()) os.system(" ".join(sys.argv[1:])) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) @@ -75,11 +75,11 @@ main(int argc, char *argv[]) test.run(arguments = 'foo' + _exe) -test.fail_test(os.path.exists(test.workpath('wrapper.out'))) +test.must_not_exist(test.workpath('wrapper.out')) test.run(arguments = 'bar' + _exe) -test.fail_test(test.read('wrapper.out') != "wrapper.py\n") +test.must_match('wrapper.out', "wrapper.py\n") test.pass_test() diff --git a/test/LINK/LINKCOM.py b/test/LINK/LINKCOM.py index f09e8f87..996e727d 100644 --- a/test/LINK/LINKCOM.py +++ b/test/LINK/LINKCOM.py @@ -31,18 +31,15 @@ Test the ability to configure the $LINKCOM construction variable. import TestSCons _python_ = TestSCons._python_ -_exe = TestSCons._exe test = TestSCons.TestSCons() - - test.write('mylink.py', r""" 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 != '/*link*/\n']: + for l in [l for l in infile.readlines() if l != b'/*link*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/LINK/LINKCOMSTR.py b/test/LINK/LINKCOMSTR.py index 8fd8adcf..8163016f 100644 --- a/test/LINK/LINKCOMSTR.py +++ b/test/LINK/LINKCOMSTR.py @@ -32,7 +32,6 @@ the displayed linker string. import TestSCons _python_ = TestSCons._python_ -_exe = TestSCons._exe test = TestSCons.TestSCons() @@ -43,7 +42,7 @@ 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 != '/*link*/\n']: + for l in [l for l in infile.readlines() if l != b'/*link*/\n']: outfile.write(l) sys.exit(0) """) @@ -80,6 +79,7 @@ env = Environment(CXXCOMSTR = 'Compiling $TARGET ...', LINKCOMSTR = 'Linking $TARGET ...') env.Program('test', 'test.cpp') """) + test.write('test.cpp', """ int main(int argc, char **argv) {} """) diff --git a/test/LINK/LINKFLAGS.py b/test/LINK/LINKFLAGS.py index 442baf72..f0c75183 100644 --- a/test/LINK/LINKFLAGS.py +++ b/test/LINK/LINKFLAGS.py @@ -36,7 +36,7 @@ test = TestSCons.TestSCons() test.write("wrapper.py", """import os import sys -open('%s', 'wb').write("wrapper.py\\n") +open('%s', 'wb').write(("wrapper.py\\n").encode()) args = [s for s in sys.argv[1:] if s != 'fake_link_flag'] os.system(" ".join(args)) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) @@ -80,7 +80,7 @@ test.must_not_exist(test.workpath('wrapper.out')) test.run(arguments = 'bar' + _exe) -test.fail_test(test.read('wrapper.out') != "wrapper.py\n") +test.must_match('wrapper.out', "wrapper.py\n") test.pass_test() diff --git a/test/LINK/SHLINK.py b/test/LINK/SHLINK.py index bc1239bd..7353996f 100644 --- a/test/LINK/SHLINK.py +++ b/test/LINK/SHLINK.py @@ -37,7 +37,7 @@ test = TestSCons.TestSCons() test.write("wrapper.py", """import os import sys -open('%s', 'wb').write("wrapper.py\\n") +open('%s', 'wb').write(b"wrapper.py\\n") os.system(" ".join(sys.argv[1:])) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) @@ -73,11 +73,11 @@ test() test.run(arguments = dll_ + 'foo' + _shlib) -test.fail_test(os.path.exists(test.workpath('wrapper.out'))) +test.must_not_exist(test.workpath('wrapper.out')) test.run(arguments = dll_ + 'bar' + _shlib) -test.fail_test(test.read('wrapper.out') != "wrapper.py\n") +test.must_match('wrapper.out', "wrapper.py\n") test.pass_test() diff --git a/test/LINK/SHLINKCOM.py b/test/LINK/SHLINKCOM.py index 8bdb9b53..1204ed1d 100644 --- a/test/LINK/SHLINKCOM.py +++ b/test/LINK/SHLINKCOM.py @@ -41,7 +41,7 @@ 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 != '/*cc*/\n']: + for l in [l for l in infile.readlines() if l != b'/*cc*/\n']: outfile.write(l) sys.exit(0) @@ -51,7 +51,7 @@ 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 != '/*link*/\n']: + for l in [l for l in infile.readlines() if l != b'/*link*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/LINK/SHLINKCOMSTR.py b/test/LINK/SHLINKCOMSTR.py index db407324..5663a1e4 100644 --- a/test/LINK/SHLINKCOMSTR.py +++ b/test/LINK/SHLINKCOMSTR.py @@ -43,7 +43,7 @@ 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 != '/*cc*/\n']: + for l in [l for l in infile.readlines() if l != b'/*cc*/\n']: outfile.write(l) sys.exit(0) @@ -53,7 +53,7 @@ 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 != '/*link*/\n']: + for l in [l for l in infile.readlines() if l != b'/*link*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/LINK/SHLINKFLAGS.py b/test/LINK/SHLINKFLAGS.py index 57766de9..51b6e22b 100644 --- a/test/LINK/SHLINKFLAGS.py +++ b/test/LINK/SHLINKFLAGS.py @@ -37,7 +37,7 @@ test = TestSCons.TestSCons() test.write("wrapper.py", """import os import sys -open('%s', 'wb').write("wrapper.py\\n") +open('%s', 'wb').write(("wrapper.py\\n").encode()) args = [s for s in sys.argv[1:] if s != 'fake_shlink_flag'] os.system(" ".join(args)) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) @@ -78,7 +78,7 @@ test.must_not_exist(test.workpath('wrapper.out')) test.run(arguments = lib_ + 'bar' + _shlib) -test.fail_test(test.read('wrapper.out') != "wrapper.py\n") +test.must_match('wrapper.out', "wrapper.py\n") test.pass_test() |