summaryrefslogtreecommitdiffstats
path: root/test/Fortran/F90COM.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Fortran/F90COM.py')
-rw-r--r--test/Fortran/F90COM.py48
1 files changed, 19 insertions, 29 deletions
diff --git a/test/Fortran/F90COM.py b/test/Fortran/F90COM.py
index e3be2a1..a4f37c2 100644
--- a/test/Fortran/F90COM.py
+++ b/test/Fortran/F90COM.py
@@ -31,26 +31,16 @@ _exe = TestSCons._exe
test = TestSCons.TestSCons()
+test.file_fixture('mycompile.py')
test.file_fixture('mylink.py')
-test.write('myfortran.py', r"""
-import sys
-comment = '#' + sys.argv[1]
-outfile = open(sys.argv[2], 'wb')
-infile = open(sys.argv[3], 'rb')
-for l in infile.readlines():
- if l[:len(comment)] != comment:
- outfile.write(l)
-sys.exit(0)
-""")
-
test.write('SConstruct', """
env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F90COM = r'%(_python_)s myfortran.py f90 $TARGET $SOURCES',
- F90PPCOM = r'%(_python_)s myfortran.py f90pp $TARGET $SOURCES',
- FORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
- FORTRANPPCOM = r'%(_python_)s myfortran.py fortranpp $TARGET $SOURCES')
+ F90COM = r'%(_python_)s mycompile.py f90 $TARGET $SOURCES',
+ F90PPCOM = r'%(_python_)s mycompile.py f90pp $TARGET $SOURCES',
+ FORTRANCOM = r'%(_python_)s mycompile.py fortran $TARGET $SOURCES',
+ FORTRANPPCOM = r'%(_python_)s mycompile.py fortranpp $TARGET $SOURCES')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
env.Program(target = 'test03', source = 'test03.for')
@@ -63,25 +53,25 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env2 = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F90COM = r'%(_python_)s myfortran.py f90 $TARGET $SOURCES',
- F90PPCOM = r'%(_python_)s myfortran.py f90pp $TARGET $SOURCES')
+ F90COM = r'%(_python_)s mycompile.py f90 $TARGET $SOURCES',
+ F90PPCOM = r'%(_python_)s mycompile.py f90pp $TARGET $SOURCES')
env2.Program(target = 'test21', source = 'test21.f90')
env2.Program(target = 'test22', source = 'test22.F90')
""" % locals())
-test.write('test01.f', "This is a .f file.\n#link\n#fortran\n")
-test.write('test02.F', "This is a .F file.\n#link\n#fortranpp\n")
-test.write('test03.for', "This is a .for file.\n#link\n#fortran\n")
-test.write('test04.FOR', "This is a .FOR file.\n#link\n#fortranpp\n")
-test.write('test05.ftn', "This is a .ftn file.\n#link\n#fortran\n")
-test.write('test06.FTN', "This is a .FTN file.\n#link\n#fortranpp\n")
-test.write('test07.fpp', "This is a .fpp file.\n#link\n#fortranpp\n")
-test.write('test08.FPP', "This is a .FPP file.\n#link\n#fortranpp\n")
-test.write('test11.f90', "This is a .f90 file.\n#link\n#f90\n")
-test.write('test12.F90', "This is a .F90 file.\n#link\n#f90pp\n")
+test.write('test01.f', "This is a .f file.\n#link\n/*fortran*/\n")
+test.write('test02.F', "This is a .F file.\n#link\n/*fortranpp*/\n")
+test.write('test03.for', "This is a .for file.\n#link\n/*fortran*/\n")
+test.write('test04.FOR', "This is a .FOR file.\n#link\n/*fortranpp*/\n")
+test.write('test05.ftn', "This is a .ftn file.\n#link\n/*fortran*/\n")
+test.write('test06.FTN', "This is a .FTN file.\n#link\n/*fortranpp*/\n")
+test.write('test07.fpp', "This is a .fpp file.\n#link\n/*fortranpp*/\n")
+test.write('test08.FPP', "This is a .FPP file.\n#link\n/*fortranpp*/\n")
+test.write('test11.f90', "This is a .f90 file.\n#link\n/*f90*/\n")
+test.write('test12.F90', "This is a .F90 file.\n#link\n/*f90pp*/\n")
-test.write('test21.f90', "This is a .f90 file.\n#link\n#f90\n")
-test.write('test22.F90', "This is a .F90 file.\n#link\n#f90pp\n")
+test.write('test21.f90', "This is a .f90 file.\n#link\n/*f90*/\n")
+test.write('test22.F90', "This is a .F90 file.\n#link\n/*f90pp*/\n")
test.run(arguments = '.', stderr = None)