5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 __revision__
= "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
29 _python_
= TestSCons
._python
_
31 test
= TestSCons
.TestSCons()
34 test
.file_fixture('mylink.py')
35 test
.file_fixture(['fixture', 'myfortran_flags.py'])
37 test
.write('SConstruct', """
38 env = Environment(LINK = r'%(_python_)s mylink.py',
40 F77 = r'%(_python_)s myfortran_flags.py g77',
42 env.Program(target = 'test09', source = 'test09.f77')
43 env.Program(target = 'test10', source = 'test10.F77')
46 test
.write('test09.f77', "This is a .f77 file.\n#link\n#g77\n")
47 test
.write('test10.F77', "This is a .F77 file.\n#link\n#g77\n")
49 test
.run(arguments
= '.', stderr
= None)
51 test
.must_match('test09' + _exe
, " -c -x\nThis is a .f77 file.\n")
52 test
.must_match('test10' + _exe
, " -c -x\nThis is a .F77 file.\n")
56 g77
= test
.detect_tool(fc
)
61 test
.subdir(directory
)
63 test
.file_fixture('wrapper.py')
65 test
.write('SConstruct', """
66 foo = Environment(F77 = '%(fc)s', tools = ['default', 'f77'], F77FILESUFFIXES = [".f"])
67 f77 = foo.Dictionary('F77')
68 bar = foo.Clone(F77 = r'%(_python_)s wrapper.py ' + f77, F77FLAGS = '-I%(directory)s')
69 foo.Program(target = 'foo', source = 'foo.f')
70 bar.Program(target = 'bar', source = 'bar.f')
73 test
.write('foo.f', r
"""
80 test
.write('bar.f', r
"""
88 test
.run(arguments
= 'foo' + _exe
, stderr
= None)
90 test
.run(program
= test
.workpath('foo'), stdout
= " foo.f\n")
92 test
.must_not_exist('wrapper.out')
95 if sys
.platform
[:5] == 'sunos':
96 test
.run(arguments
= 'bar' + _exe
, stderr
= None)
98 test
.run(arguments
= 'bar' + _exe
)
100 test
.run(program
= test
.workpath('bar'), stdout
= " bar.f\n")
102 test
.must_match('wrapper.out', "wrapper.py\n")
108 # indent-tabs-mode:nil
110 # vim: set expandtab tabstop=4 shiftwidth=4: