diff options
author | William Blevins <wblevins001@gmail.com> | 2016-11-28 02:27:10 (GMT) |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-11-28 02:27:10 (GMT) |
commit | 51abbd22089b2274161ee95d48d00525d7905b01 (patch) | |
tree | 52c998b0a8faf434f306c5498199e6ba468ff261 /test/Fortran/SHF90FLAGS.py | |
parent | e3d5fdee7267b8e07873f77afe4f2ecc46f82f16 (diff) | |
download | SCons-51abbd22089b2274161ee95d48d00525d7905b01.zip SCons-51abbd22089b2274161ee95d48d00525d7905b01.tar.gz SCons-51abbd22089b2274161ee95d48d00525d7905b01.tar.bz2 |
Python3 test fixes for Fortran/Side-effect.
Diffstat (limited to 'test/Fortran/SHF90FLAGS.py')
-rw-r--r-- | test/Fortran/SHF90FLAGS.py | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/test/Fortran/SHF90FLAGS.py b/test/Fortran/SHF90FLAGS.py index 0f9e2ba3..6f7ee00 100644 --- a/test/Fortran/SHF90FLAGS.py +++ b/test/Fortran/SHF90FLAGS.py @@ -24,6 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import os import TestSCons _python_ = TestSCons._python_ @@ -32,32 +33,11 @@ _obj = TestSCons._shobj obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() - - - -test.write('myfortran.py', r""" -import getopt -import sys -comment = '#' + sys.argv[1] -opts, args = getopt.getopt(sys.argv[2:], 'cf:K:o:xy') -optstring = '' -for opt, arg in opts: - if opt == '-o': out = arg - elif opt not in ('-f', '-K'): optstring = optstring + ' ' + opt -infile = open(args[0], 'rb') -outfile = open(out, 'wb') -outfile.write(optstring + "\n") -for l in infile.readlines(): - if l[:len(comment)] != comment: - outfile.write(l) -sys.exit(0) -""") - - +test.file_fixture(os.path.join('fixture', 'myfortran_flags.py')) test.write('SConstruct', """ -env = Environment(SHF90 = r'%(_python_)s myfortran.py g90', - SHFORTRAN = r'%(_python_)s myfortran.py fortran') +env = Environment(SHF90 = r'%(_python_)s myfortran_flags.py g90', + SHFORTRAN = r'%(_python_)s myfortran_flags.py fortran') env.Append(SHF90FLAGS = '-x', SHFORTRANFLAGS = '-y') env.SharedObject(target = 'test01', source = 'test01.f') |