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/Java | |
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/Java')
-rw-r--r-- | test/Java/JARCOM.py | 15 | ||||
-rw-r--r-- | test/Java/JARCOMSTR.py | 16 | ||||
-rw-r--r-- | test/Java/JAVACCOM.py | 16 | ||||
-rw-r--r-- | test/Java/JAVACCOMSTR.py | 16 | ||||
-rw-r--r-- | test/Java/JAVAHCOM.py | 16 | ||||
-rw-r--r-- | test/Java/JAVAHCOMSTR.py | 18 | ||||
-rw-r--r-- | test/Java/RMICCOM.py | 18 | ||||
-rw-r--r-- | test/Java/RMICCOMSTR.py | 18 |
8 files changed, 16 insertions, 117 deletions
diff --git a/test/Java/JARCOM.py b/test/Java/JARCOM.py index 9d93ba5..9146445 100644 --- a/test/Java/JARCOM.py +++ b/test/Java/JARCOM.py @@ -35,20 +35,11 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() - -test.write('myjar.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 != '/*jar*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'jar'], - JARCOM = r'%(_python_)s myjar.py $TARGET $SOURCES') + JARCOM = r'%(_python_)s mycompile.py jar $TARGET $SOURCES') env.Jar(target = 'test1', source = ['file1.in', 'file2.in', 'file3.in']) """ % locals()) @@ -60,8 +51,6 @@ test.run() test.must_match('test1.jar', "file1.in\nfile2.in\nfile3.in\n") - - test.pass_test() # Local Variables: diff --git a/test/Java/JARCOMSTR.py b/test/Java/JARCOMSTR.py index 069587f..4bdc45b 100644 --- a/test/Java/JARCOMSTR.py +++ b/test/Java/JARCOMSTR.py @@ -35,21 +35,11 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() - - -test.write('myjar.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 != '/*jar*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'jar'], - JARCOM = r'%(_python_)s myjar.py $TARGET $SOURCES', + JARCOM = r'%(_python_)s mycompile.py jar $TARGET $SOURCES', JARCOMSTR = "Jar'ing up $TARGET from $SOURCES") env.Jar(target = 'test1', source = ['file1.in', 'file2.in', 'file3.in']) """ % locals()) @@ -64,8 +54,6 @@ Jar'ing up test1.jar from file1.in file2.in file3.in test.must_match('test1.jar', "file1.in\nfile2.in\nfile3.in\n") - - test.pass_test() # Local Variables: diff --git a/test/Java/JAVACCOM.py b/test/Java/JAVACCOM.py index 064feed..0de173d 100644 --- a/test/Java/JAVACCOM.py +++ b/test/Java/JAVACCOM.py @@ -36,21 +36,11 @@ test = TestSCons.TestSCons() test.subdir('src') - - -test.write('myjavac.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 != '/*javac*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'javac'], - JAVACCOM = r'%(_python_)s myjavac.py $TARGET $SOURCES') + JAVACCOM = r'%(_python_)s mycompile.py javac $TARGET $SOURCES') env.Java(target = 'classes', source = 'src') """ % locals()) @@ -63,8 +53,6 @@ test.run() test.must_match(['classes', 'file1.class'], "file1.java\nfile2.java\nfile3.java\n") - - test.pass_test() # Local Variables: diff --git a/test/Java/JAVACCOMSTR.py b/test/Java/JAVACCOMSTR.py index 6440283..8540e13 100644 --- a/test/Java/JAVACCOMSTR.py +++ b/test/Java/JAVACCOMSTR.py @@ -39,21 +39,11 @@ test = TestSCons.TestSCons() test.subdir('src') - - -test.write('myjavac.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 != '/*javac*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'javac'], - JAVACCOM = r'%(_python_)s myjavac.py $TARGET $SOURCES', + JAVACCOM = r'%(_python_)s mycompile.py javac $TARGET $SOURCES', JAVACCOMSTR = "Compiling class(es) $TARGET from $SOURCES") env.Java(target = 'classes', source = 'src') """ % locals()) @@ -74,8 +64,6 @@ Compiling class(es) %(classes_file1_class)s from %(src_file1_java)s %(src_file2_ test.must_match(['classes', 'file1.class'], "file1.java\nfile2.java\nfile3.java\n") - - test.pass_test() # Local Variables: diff --git a/test/Java/JAVAHCOM.py b/test/Java/JAVAHCOM.py index 9db897a..801707e 100644 --- a/test/Java/JAVAHCOM.py +++ b/test/Java/JAVAHCOM.py @@ -34,21 +34,11 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() - - -test.write('myjavah.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 != '/*javah*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'javah'], - JAVAHCOM = r'%(_python_)s myjavah.py $TARGET $SOURCES') + JAVAHCOM = r'%(_python_)s mycompile.py javah $TARGET $SOURCES') env.JavaH(target = 'out', source = 'file1.class') env.JavaH(target = 'out', source = 'file2.class') env.JavaH(target = 'out', source = 'file3.class') @@ -64,8 +54,6 @@ test.must_match(['out', 'file1.h'], "file1.class\n") test.must_match(['out', 'file2.h'], "file2.class\n") test.must_match(['out', 'file3.h'], "file3.class\n") - - test.pass_test() # Local Variables: diff --git a/test/Java/JAVAHCOMSTR.py b/test/Java/JAVAHCOMSTR.py index f8120d6..c205890 100644 --- a/test/Java/JAVAHCOMSTR.py +++ b/test/Java/JAVAHCOMSTR.py @@ -39,27 +39,15 @@ test = TestSCons.TestSCons() test.subdir('src') - - out_file1_h = os.path.join('out', 'file1.h') out_file2_h = os.path.join('out', 'file2.h') out_file3_h = os.path.join('out', 'file3.h') - - -test.write('myjavah.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 != '/*javah*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'javah'], - JAVAHCOM = r'%(_python_)s myjavah.py $TARGET $SOURCES', + JAVAHCOM = r'%(_python_)s mycompile.py javah $TARGET $SOURCES', JAVAHCOMSTR = 'Building javah $TARGET from $SOURCES') env.JavaH(target = 'out', source = 'file1.class') env.JavaH(target = 'out', source = 'file2.class') @@ -80,8 +68,6 @@ test.must_match(['out', 'file1.h'], "file1.class\n") test.must_match(['out', 'file2.h'], "file2.class\n") test.must_match(['out', 'file3.h'], "file3.class\n") - - test.pass_test() # Local Variables: diff --git a/test/Java/RMICCOM.py b/test/Java/RMICCOM.py index ba7f965..9f6595d 100644 --- a/test/Java/RMICCOM.py +++ b/test/Java/RMICCOM.py @@ -38,27 +38,15 @@ test = TestSCons.TestSCons() test.subdir('src') - - out_file1 = os.path.join('out', 'file1', 'class_Stub.class') out_file2 = os.path.join('out', 'file2', 'class_Stub.class') out_file3 = os.path.join('out', 'file3', 'class_Stub.class') - - -test.write('myrmic.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 != '/*rmic*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'rmic'], - RMICCOM = r'%(_python_)s myrmic.py $TARGET $SOURCES') + RMICCOM = r'%(_python_)s mycompile.py rmic $TARGET $SOURCES') env.RMIC(target = 'out', source = 'file1.class') env.RMIC(target = 'out', source = 'file2.class') env.RMIC(target = 'out', source = 'file3.class') @@ -74,8 +62,6 @@ test.must_match(out_file1, "file1.class\n") test.must_match(out_file2, "file2.class\n") test.must_match(out_file3, "file3.class\n") - - test.pass_test() # Local Variables: diff --git a/test/Java/RMICCOMSTR.py b/test/Java/RMICCOMSTR.py index 8fe535a..d4d1904 100644 --- a/test/Java/RMICCOMSTR.py +++ b/test/Java/RMICCOMSTR.py @@ -39,27 +39,15 @@ test = TestSCons.TestSCons() test.subdir('src') - - out_file1 = os.path.join('out', 'file1', 'class_Stub.class') out_file2 = os.path.join('out', 'file2', 'class_Stub.class') out_file3 = os.path.join('out', 'file3', 'class_Stub.class') - - -test.write('myrmic.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 != '/*rmic*/\n']: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') test.write('SConstruct', """ env = Environment(TOOLS = ['default', 'rmic'], - RMICCOM = r'%(_python_)s myrmic.py $TARGET $SOURCES', + RMICCOM = r'%(_python_)s mycompile.py rmic $TARGET $SOURCES', RMICCOMSTR = 'Building rmic $TARGET from $SOURCES') env.RMIC(target = 'out', source = 'file1.class') env.RMIC(target = 'out', source = 'file2.class') @@ -80,8 +68,6 @@ test.must_match(out_file1, "file1.class\n") test.must_match(out_file2, "file2.class\n") test.must_match(out_file3, "file3.class\n") - - test.pass_test() # Local Variables: |