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/Fortran/SHF77COMSTR.py | |
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/Fortran/SHF77COMSTR.py')
-rw-r--r-- | test/Fortran/SHF77COMSTR.py | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/test/Fortran/SHF77COMSTR.py b/test/Fortran/SHF77COMSTR.py index 7a43a4a..37d2edf 100644 --- a/test/Fortran/SHF77COMSTR.py +++ b/test/Fortran/SHF77COMSTR.py @@ -30,17 +30,7 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() - - -test.write('myfc.py', r""" -import sys -fline = '#'+sys.argv[1]+'\n' -outfile = open(sys.argv[2], 'wb') -infile = open(sys.argv[3], 'rb') -for l in [l for l in infile.readlines() if l != fline]: - outfile.write(l) -sys.exit(0) -""") +test.file_fixture('mycompile.py') if not TestSCons.case_sensitive_suffixes('.f','.F'): f77pp = 'f77' @@ -49,25 +39,25 @@ else: test.write('SConstruct', """ -env = Environment(SHF77COM = r'%(_python_)s myfc.py f77 $TARGET $SOURCES', +env = Environment(SHF77COM = r'%(_python_)s mycompile.py f77 $TARGET $SOURCES', SHF77COMSTR = 'Building f77 $TARGET from $SOURCES', - SHF77PPCOM = r'%(_python_)s myfc.py f77pp $TARGET $SOURCES', + SHF77PPCOM = r'%(_python_)s mycompile.py f77pp $TARGET $SOURCES', SHF77PPCOMSTR = 'Building f77pp $TARGET from $SOURCES', SHOBJPREFIX='', SHOBJSUFFIX='.shobj') env.SharedObject(source = 'test09.f77') env.SharedObject(source = 'test10.F77') """ % locals()) -test.write('test01.f', "A .f file.\n#f77\n") -test.write('test02.F', "A .F file.\n#%s\n" % f77pp) -test.write('test03.for', "A .for file.\n#f77\n") -test.write('test04.FOR', "A .FOR file.\n#%s\n" % f77pp) -test.write('test05.ftn', "A .ftn file.\n#f77\n") -test.write('test06.FTN', "A .FTN file.\n#%s\n" % f77pp) -test.write('test07.fpp', "A .fpp file.\n#f77pp\n") -test.write('test08.FPP', "A .FPP file.\n#f77pp\n") -test.write('test09.f77', "A .f77 file.\n#f77\n") -test.write('test10.F77', "A .F77 file.\n#%s\n" % f77pp) +test.write('test01.f', "A .f file.\n/*f77*/\n") +test.write('test02.F', "A .F file.\n/*%s*/\n" % f77pp) +test.write('test03.for', "A .for file.\n/*f77*/\n") +test.write('test04.FOR', "A .FOR file.\n/*%s*/\n" % f77pp) +test.write('test05.ftn', "A .ftn file.\n/*f77*/\n") +test.write('test06.FTN', "A .FTN file.\n/*%s*/\n" % f77pp) +test.write('test07.fpp', "A .fpp file.\n/*f77pp*/\n") +test.write('test08.FPP', "A .FPP file.\n/*f77pp*/\n") +test.write('test09.f77', "A .f77 file.\n/*f77*/\n") +test.write('test10.F77', "A .F77 file.\n/*%s*/\n" % f77pp) test.run(stdout = test.wrap_stdout("""\ Building f77 test09.shobj from test09.f77 |