added release.txt blurb. Fixed spelling typo in Defaults.xml
[scons.git] / test / Fortran / SHF77COMSTR.py
blob37d2edf2a50dbfa1047cbd3a4549c754f50abf7f
1 #!/usr/bin/env python
3 # __COPYRIGHT__
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__"
27 import TestSCons
29 _python_ = TestSCons._python_
31 test = TestSCons.TestSCons()
33 test.file_fixture('mycompile.py')
35 if not TestSCons.case_sensitive_suffixes('.f','.F'):
36 f77pp = 'f77'
37 else:
38 f77pp = 'f77pp'
41 test.write('SConstruct', """
42 env = Environment(SHF77COM = r'%(_python_)s mycompile.py f77 $TARGET $SOURCES',
43 SHF77COMSTR = 'Building f77 $TARGET from $SOURCES',
44 SHF77PPCOM = r'%(_python_)s mycompile.py f77pp $TARGET $SOURCES',
45 SHF77PPCOMSTR = 'Building f77pp $TARGET from $SOURCES',
46 SHOBJPREFIX='', SHOBJSUFFIX='.shobj')
47 env.SharedObject(source = 'test09.f77')
48 env.SharedObject(source = 'test10.F77')
49 """ % locals())
51 test.write('test01.f', "A .f file.\n/*f77*/\n")
52 test.write('test02.F', "A .F file.\n/*%s*/\n" % f77pp)
53 test.write('test03.for', "A .for file.\n/*f77*/\n")
54 test.write('test04.FOR', "A .FOR file.\n/*%s*/\n" % f77pp)
55 test.write('test05.ftn', "A .ftn file.\n/*f77*/\n")
56 test.write('test06.FTN', "A .FTN file.\n/*%s*/\n" % f77pp)
57 test.write('test07.fpp', "A .fpp file.\n/*f77pp*/\n")
58 test.write('test08.FPP', "A .FPP file.\n/*f77pp*/\n")
59 test.write('test09.f77', "A .f77 file.\n/*f77*/\n")
60 test.write('test10.F77', "A .F77 file.\n/*%s*/\n" % f77pp)
62 test.run(stdout = test.wrap_stdout("""\
63 Building f77 test09.shobj from test09.f77
64 Building %(f77pp)s test10.shobj from test10.F77
65 """ % locals()))
67 test.must_match('test09.shobj', "A .f77 file.\n")
68 test.must_match('test10.shobj', "A .F77 file.\n")
70 test.pass_test()
72 # Local Variables:
73 # tab-width:4
74 # indent-tabs-mode:nil
75 # End:
76 # vim: set expandtab tabstop=4 shiftwidth=4: