summaryrefslogtreecommitdiff
path: root/test/Fortran
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2006-11-02 16:21:36 +0000
committerSteven Knight <knight@baldmt.com>2006-11-02 16:21:36 +0000
commit6ba3fe1e1af2743602a4d0c55513deecc7e16df0 (patch)
treeea835f8b96e6c67766b4c0e6437f363d76164d39 /test/Fortran
parent217dbbf43c5e794373a561f6258f1c684a8ca448 (diff)
downloadscons-6ba3fe1e1af2743602a4d0c55513deecc7e16df0.tar.gz
Merged revisions 1582-1665 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r1585 | stevenknight | 2006-08-06 21:21:12 -0500 (Sun, 06 Aug 2006) | 1 line 0.96.D430 - Fix bug with finding Fortran modules in build directories. (Nicolas Vigier) ........ r1586 | stevenknight | 2006-08-06 22:54:39 -0500 (Sun, 06 Aug 2006) | 1 line 0.96.D431 - Fix use of BuildDir when the source file is a relative-path symlink. (Nicola Vi ........ r1587 | timot | 2006-08-10 14:45:00 -0500 (Thu, 10 Aug 2006) | 1 line fix Platform SDK init ........ r1589 | stevenknight | 2006-08-12 13:28:51 -0500 (Sat, 12 Aug 2006) | 1 line 0.96.D432 - Change the default mingw linker from g++ to gcc. (Mariusz Olko) ........ r1590 | stevenknight | 2006-08-13 11:16:32 -0500 (Sun, 13 Aug 2006) | 1 line 0.96.D433 - More runtest.py enhancements. ........ r1594 | stevenknight | 2006-08-15 04:47:46 -0500 (Tue, 15 Aug 2006) | 1 line 0.96.D434 - Print the full path of SConscript files in stack traces. (Dobes Vandermeer) ........ r1600 | timot | 2006-08-16 11:34:44 -0500 (Wed, 16 Aug 2006) | 1 line add M4 to mingw tools ........ r1611 | stevenknight | 2006-08-19 16:25:24 -0500 (Sat, 19 Aug 2006) | 1 line 0.96.D435 - Add an SCons XMLResultStream to capture test results for mailing in. Get Aegis ........ r1617 | timot | 2006-08-21 16:19:03 -0500 (Mon, 21 Aug 2006) | 1 line handling of spawnve returning an error code that is not in exitvalmap ........ r1619 | stevenknight | 2006-09-01 19:07:47 -0500 (Fri, 01 Sep 2006) | 1 line 0.96.D436 - Win32 test portability and other test fixes. ........ r1620 | stevenknight | 2006-09-02 20:21:51 -0500 (Sat, 02 Sep 2006) | 2 lines Bring msvc.py in sync with Aegis repository. ........ r1621 | stevenknight | 2006-09-02 20:23:48 -0500 (Sat, 02 Sep 2006) | 2 lines Move to keep symlink tests together. ........ r1622 | garyo | 2006-09-06 11:51:42 -0500 (Wed, 06 Sep 2006) | 1 line Fix for Issue #1370; allow exit values not in exitvalmap. Added some tests for this kind of thing. Also improved win32 err msg if command exits with nonzero to show actual cmd, not just "cmd.exe". Note this fix improves posix and win32 behavior. ........ r1623 | stevenknight | 2006-09-07 06:35:16 -0500 (Thu, 07 Sep 2006) | 1 line 0.96.D440 - Fix runtest.py with QMTest on Windows. ........ r1625 | stevenknight | 2006-09-09 09:22:15 -0500 (Sat, 09 Sep 2006) | 3 lines Comment out a long-command test which fails on older Pythons (1.5.2) on Fedora Core 3. We can restore it in the future. ........ r1626 | stevenknight | 2006-09-09 16:17:44 -0500 (Sat, 09 Sep 2006) | 1 line 0.96.D441 - Allow Python Values to be the targets of Builders. (Anonymous) ........ r1627 | stevenknight | 2006-09-09 20:25:53 -0500 (Sat, 09 Sep 2006) | 1 line 0.96.D442 - Support src_dir on SConscript() calls. (Dobes Vandermeer) ........ r1628 | stevenknight | 2006-09-10 07:28:54 -0500 (Sun, 10 Sep 2006) | 1 line 0.96.D443 - Add miscellaneous utility scripts and config changes. ........ r1629 | stevenknight | 2006-09-11 04:45:01 -0500 (Mon, 11 Sep 2006) | 1 line 0.96.D444 - Add a test case for BuildDir handling of nested SConscript files. (Adam Simpkin ........ r1630 | stevenknight | 2006-09-11 11:34:07 -0500 (Mon, 11 Sep 2006) | 1 line 0.96.D445 - Workaround bug in early versions of thePython 2.4 profiler. ........ r1631 | stevenknight | 2006-09-19 19:12:51 -0500 (Tue, 19 Sep 2006) | 1 line 0.96.D446 - Fix Visual Studio common prefix handling to only treat common prefixes on comple ........ r1632 | stevenknight | 2006-09-25 07:11:44 -0500 (Mon, 25 Sep 2006) | 1 line 0.96.D447 - Fix tests that fail due to warnings from (some versions?) of gcc. (Sohail Soman ........ r1633 | stevenknight | 2006-09-25 07:57:48 -0500 (Mon, 25 Sep 2006) | 1 line 0.96.D448 - Handle python paths with quotes in tests. ........ r1634 | stevenknight | 2006-09-25 14:38:07 -0500 (Mon, 25 Sep 2006) | 1 line 0.96.D449 - Fix SCons build when python is not in the path (e.g. on Windows). (Chad Austin) ........ r1635 | stevenknight | 2006-09-26 11:28:23 -0500 (Tue, 26 Sep 2006) | 1 line 0.96.D450 - Handle warnings from Python 2.1; make sure we still test on Python 1.5. ........ r1636 | stevenknight | 2006-09-27 05:34:23 -0500 (Wed, 27 Sep 2006) | 1 line 0.96.D451 - Avoid calling Options validators and converters twice. ........ r1637 | stevenknight | 2006-09-28 08:12:38 -0500 (Thu, 28 Sep 2006) | 1 line 0.96.D452 - Allow setting MSVS_VERSION after initialization to select the Visual Studio vers ........ r1638 | stevenknight | 2006-09-30 08:38:15 -0500 (Sat, 30 Sep 2006) | 1 line 0.96.D453 - Give the MSVC resource builder a src_builder list and .rc src_suffix. (Leanid N ........ r1639 | stevenknight | 2006-10-12 08:50:58 -0500 (Thu, 12 Oct 2006) | 1 line 0.96.D454 - Test handling of env.Append() and env.Prepend(), making sure it works on later P ........ r1640 | stevenknight | 2006-10-15 20:42:09 -0500 (Sun, 15 Oct 2006) | 1 line 0.96.D455 - Support the runtest.py -f option when using QMTest. ........ r1641 | stevenknight | 2006-10-15 21:20:02 -0500 (Sun, 15 Oct 2006) | 1 line 0.96.D456 - Fix an error in ListOption handling caused by making new copies of Options objec ........ r1642 | stevenknight | 2006-10-16 05:53:14 -0500 (Mon, 16 Oct 2006) | 1 line 0.96.D457 - Fix new Append()/Prepend() handling of dictionaries in later Python versions (2. ........ r1643 | stevenknight | 2006-10-16 07:13:16 -0500 (Mon, 16 Oct 2006) | 1 line 0.96.D458 - Allow Install() to handle directories as sources. (Matthew A. Nicholson) ........ r1644 | stevenknight | 2006-10-17 09:17:58 -0500 (Tue, 17 Oct 2006) | 1 line 0.96.D459 - Add a test to make sure SideEffect() doesn't interfere with CacheDir(). Refacto ........ r1645 | stevenknight | 2006-10-17 10:20:22 -0500 (Tue, 17 Oct 2006) | 1 line 0.96.D460 - Do not use -fPIC when using gcc on win32 (MinGW). (Jan Nijtmans) ........ r1646 | stevenknight | 2006-10-17 17:21:58 -0500 (Tue, 17 Oct 2006) | 6 lines Move all the scons.org stuff from the scons source tree itself to a directory next to the trunk, and delete the copies from the branches. There's a lot of stuff there (what with all of the documentation of the different versions) and it's ridiculous to make everyone sync it just to work on the code. ........ r1647 | stevenknight | 2006-10-17 23:18:29 -0500 (Tue, 17 Oct 2006) | 1 line 0.96.D461 - Fix the tests of runtest.py so they skip appropriately if qmtest.py isn't instal ........ r1648 | stevenknight | 2006-10-18 08:48:47 -0500 (Wed, 18 Oct 2006) | 1 line 0.96.D462 - When using --implicit-cache, do not re-scan files if the scanner returned no imp ........ r1649 | stevenknight | 2006-10-18 19:42:13 -0500 (Wed, 18 Oct 2006) | 1 line 0.96.D463 - More test portability fixes. ........ r1650 | stevenknight | 2006-10-19 00:30:23 -0500 (Thu, 19 Oct 2006) | 1 line 0.96.D464 - Add a cpp.py module that knows how to find dependencies from #include lines like ........ r1651 | stevenknight | 2006-10-20 06:49:51 -0500 (Fri, 20 Oct 2006) | 1 line 0.96.D465 - Fix unresolved variable name in win32 portion of test. ........ r1652 | stevenknight | 2006-10-23 00:20:38 -0500 (Mon, 23 Oct 2006) | 1 line 0.96.D466 - Add an option for tracing files to and from the CacheDir. ........ r1653 | stevenknight | 2006-10-23 00:29:32 -0500 (Mon, 23 Oct 2006) | 1 line 0.96.D467 - Make {Append,Prepend}Unique() handle adding elements to empty lists like {Append ........ r1654 | stevenknight | 2006-10-23 02:38:06 -0500 (Mon, 23 Oct 2006) | 1 line 0.96.D468 - Allow Debug.caller() to take multiple arguments; add a debug utility to post-pro ........ r1655 | stevenknight | 2006-10-23 03:16:42 -0500 (Mon, 23 Oct 2006) | 1 line 0.96.D469 - Reduce unnecessary calls to Node.FS.disambiguate(), undoing (?) a performance hi ........ r1656 | stevenknight | 2006-10-25 00:06:27 -0500 (Wed, 25 Oct 2006) | 1 line 0.96.D470 - More test portability fixes. ........ r1657 | stevenknight | 2006-10-25 00:16:22 -0500 (Wed, 25 Oct 2006) | 1 line 0.96.D471 - Have runtest.py fall back to the --noqmtest option (with a warning) if qmtest.py ........ r1658 | stevenknight | 2006-10-25 12:12:02 -0500 (Wed, 25 Oct 2006) | 1 line 0.96.D472 - Document the default use of the /Z7 flag for Visual Studio and ways to use /Zi. ........ r1659 | stevenknight | 2006-10-26 23:53:51 -0500 (Thu, 26 Oct 2006) | 1 line 0.96.D473 - Have runtest.py -d accomodate different Python library locations. ........ r1660 | stevenknight | 2006-10-27 00:03:59 -0500 (Fri, 27 Oct 2006) | 1 line 0.96.D474 - Patch to support running SCons under WingIDE. (Allen Bierbaum) ........ r1661 | stevenknight | 2006-10-27 12:17:27 -0500 (Fri, 27 Oct 2006) | 1 line 0.96.D475 - Restore execution of all Environment unit tests. ........ r1662 | stevenknight | 2006-10-31 23:22:58 -0600 (Tue, 31 Oct 2006) | 1 line 0.96.D476 - Eliminate unnecessary print from a test, left over from debugging. ........ r1663 | stevenknight | 2006-10-31 23:32:00 -0600 (Tue, 31 Oct 2006) | 1 line 0.96.D477 - Support creating shared object files from assembly language. (James Y. Knight) ........ r1664 | stevenknight | 2006-10-31 23:44:08 -0600 (Tue, 31 Oct 2006) | 1 line 0.96.D478 - Fix the Memoizer to deal with a compiled .pyo or .pyc file that's in a different ........ r1665 | stevenknight | 2006-11-01 21:59:18 -0600 (Wed, 01 Nov 2006) | 1 line 0.96.D479 - Put back the scons-{LICENSE,README} files in the scons-loacal package; add tests ........
Diffstat (limited to 'test/Fortran')
-rw-r--r--test/Fortran/F77.py20
-rw-r--r--test/Fortran/F77COM.py20
-rw-r--r--test/Fortran/F77COMSTR.py6
-rw-r--r--test/Fortran/F77FLAGS.py14
-rw-r--r--test/Fortran/F90.py16
-rw-r--r--test/Fortran/F90COM.py20
-rw-r--r--test/Fortran/F90COMSTR.py6
-rw-r--r--test/Fortran/F90FLAGS.py16
-rw-r--r--test/Fortran/F95.py16
-rw-r--r--test/Fortran/F95COM.py20
-rw-r--r--test/Fortran/F95COMSTR.py6
-rw-r--r--test/Fortran/F95FLAGS.py16
-rw-r--r--test/Fortran/FORTRAN.py14
-rw-r--r--test/Fortran/FORTRANCOM.py10
-rw-r--r--test/Fortran/FORTRANCOMSTR.py6
-rw-r--r--test/Fortran/FORTRANFLAGS.py14
-rw-r--r--test/Fortran/FORTRANMODDIR.py4
-rw-r--r--test/Fortran/FORTRANSUFFIXES.py38
-rw-r--r--test/Fortran/SHF77.py14
-rw-r--r--test/Fortran/SHF77COM.py16
-rw-r--r--test/Fortran/SHF77COMSTR.py6
-rw-r--r--test/Fortran/SHF77FLAGS.py12
-rw-r--r--test/Fortran/SHF90.py12
-rw-r--r--test/Fortran/SHF90COM.py16
-rw-r--r--test/Fortran/SHF90COMSTR.py6
-rw-r--r--test/Fortran/SHF90FLAGS.py14
-rw-r--r--test/Fortran/SHF95.py12
-rw-r--r--test/Fortran/SHF95COM.py16
-rw-r--r--test/Fortran/SHF95COMSTR.py6
-rw-r--r--test/Fortran/SHF95FLAGS.py14
-rw-r--r--test/Fortran/SHFORTRAN.py10
-rw-r--r--test/Fortran/SHFORTRANCOM.py8
-rw-r--r--test/Fortran/SHFORTRANCOMSTR.py6
-rw-r--r--test/Fortran/SHFORTRANFLAGS.py12
-rw-r--r--test/Fortran/USE-MODULE.py4
-rw-r--r--test/Fortran/module-subdir.py115
36 files changed, 342 insertions, 219 deletions
diff --git a/test/Fortran/F77.py b/test/Fortran/F77.py
index 1c27def2..682cfb03 100644
--- a/test/Fortran/F77.py
+++ b/test/Fortran/F77.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -88,10 +88,10 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F77 = r'%s myfortran.py g77',
- FORTRAN = r'%s myfortran.py fortran')
+ F77 = r'%(_python_)s myfortran.py g77',
+ FORTRAN = r'%(_python_)s myfortran.py fortran')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
env.Program(target = 'test03', source = 'test03.for')
@@ -106,9 +106,9 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-env2 = Environment(LINK = r'%s mylink.py',
+env2 = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F77 = r'%s myfortran.py g77')
+ F77 = r'%(_python_)s myfortran.py g77')
env2.Program(target = 'test21', source = 'test21.f')
env2.Program(target = 'test22', source = 'test22.F')
env2.Program(target = 'test23', source = 'test23.for')
@@ -119,7 +119,7 @@ env2.Program(target = 'test27', source = 'test27.fpp')
env2.Program(target = 'test28', source = 'test28.FPP')
env2.Program(target = 'test29', source = 'test29.f77')
env2.Program(target = 'test30', source = 'test30.F77')
-""" % (python, python, python, python, python))
+""" % 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#fortran\n")
@@ -191,12 +191,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
f77 = foo.Dictionary('F77')
-bar = foo.Copy(F77 = r'%s wrapper.py ' + f77)
+bar = foo.Copy(F77 = r'%(_python_)s wrapper.py ' + f77)
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/F77COM.py b/test/Fortran/F77COM.py
index 9de4d17a..c566d88e 100644
--- a/test/Fortran/F77COM.py
+++ b/test/Fortran/F77COM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -84,12 +84,12 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F77COM = r'%s myfortran.py f77 $TARGET $SOURCES',
- F77PPCOM = r'%s myfortran.py f77pp $TARGET $SOURCES',
- FORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- FORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+ F77COM = r'%(_python_)s myfortran.py f77 $TARGET $SOURCES',
+ F77PPCOM = r'%(_python_)s myfortran.py f77pp $TARGET $SOURCES',
+ FORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ FORTRANPPCOM = r'%(_python_)s myfortran.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')
@@ -104,10 +104,10 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-env2 = Environment(LINK = r'%s mylink.py',
+env2 = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F77COM = r'%s myfortran.py f77 $TARGET $SOURCES',
- F77PPCOM = r'%s myfortran.py f77pp $TARGET $SOURCES')
+ F77COM = r'%(_python_)s myfortran.py f77 $TARGET $SOURCES',
+ F77PPCOM = r'%(_python_)s myfortran.py f77pp $TARGET $SOURCES')
env2.Program(target = 'test21', source = 'test21.f')
env2.Program(target = 'test22', source = 'test22.F')
env2.Program(target = 'test23', source = 'test23.for')
@@ -118,7 +118,7 @@ env2.Program(target = 'test27', source = 'test27.fpp')
env2.Program(target = 'test28', source = 'test28.FPP')
env2.Program(target = 'test29', source = 'test29.f77')
env2.Program(target = 'test30', source = 'test30.F77')
-""" % (python, python, python, python, python, python, python, python))
+""" % 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")
diff --git a/test/Fortran/F77COMSTR.py b/test/Fortran/F77COMSTR.py
index 721551d4..7f6f1a1f 100644
--- a/test/Fortran/F77COMSTR.py
+++ b/test/Fortran/F77COMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(F77COM = r'%(python)s myfc.py f77 $TARGET $SOURCES',
+env = Environment(F77COM = r'%(_python_)s myfc.py f77 $TARGET $SOURCES',
F77COMSTR = 'Building f77 $TARGET from $SOURCES',
- F77PPCOM = r'%(python)s myfc.py f77pp $TARGET $SOURCES',
+ F77PPCOM = r'%(_python_)s myfc.py f77pp $TARGET $SOURCES',
F77PPCOMSTR = 'Building f77pp $TARGET from $SOURCES',
OBJSUFFIX='.obj')
env.Object(source = 'test01.f')
diff --git a/test/Fortran/F77FLAGS.py b/test/Fortran/F77FLAGS.py
index d50eeb91..b1d91426 100644
--- a/test/Fortran/F77FLAGS.py
+++ b/test/Fortran/F77FLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
_exe = TestSCons._exe
@@ -90,9 +90,9 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F77 = r'%s myg77.py',
+ F77 = r'%(_python_)s myg77.py',
F77FLAGS = '-x')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
@@ -104,7 +104,7 @@ env.Program(target = 'test07', source = 'test07.fpp')
env.Program(target = 'test08', source = 'test08.FPP')
env.Program(target = 'test09', source = 'test09.f77')
env.Program(target = 'test10', source = 'test10.F77')
-""" % (python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#link\n#g77\n")
test.write('test02.F', "This is a .F file.\n#link\n#g77\n")
@@ -146,12 +146,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %FTN_LIBs)
f77 = foo.Dictionary('F77')
-bar = foo.Copy(F77 = r'%s wrapper.py ' + f77, F77FLAGS = '-Ix')
+bar = foo.Copy(F77 = r'%(_python_)s wrapper.py ' + f77, F77FLAGS = '-Ix')
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/F90.py b/test/Fortran/F90.py
index 8f8bc453..6b38e8e3 100644
--- a/test/Fortran/F90.py
+++ b/test/Fortran/F90.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -89,10 +89,10 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F90 = r'%s myfortran.py f90',
- FORTRAN = r'%s myfortran.py fortran')
+ F90 = r'%(_python_)s myfortran.py f90',
+ FORTRAN = r'%(_python_)s myfortran.py fortran')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
env.Program(target = 'test03', source = 'test03.for')
@@ -107,7 +107,7 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-""" % (python, python, python))
+""" % 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#fortran\n")
@@ -157,12 +157,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
f90 = foo.Dictionary('F90')
-bar = foo.Copy(F90 = r'%s wrapper.py ' + f90)
+bar = foo.Copy(F90 = r'%(_python_)s wrapper.py ' + f90)
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/F90COM.py b/test/Fortran/F90COM.py
index bb52340a..7a206da8 100644
--- a/test/Fortran/F90COM.py
+++ b/test/Fortran/F90COM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -84,12 +84,12 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F90COM = r'%s myfortran.py f90 $TARGET $SOURCES',
- F90PPCOM = r'%s myfortran.py f90pp $TARGET $SOURCES',
- FORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- FORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+ 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')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
env.Program(target = 'test03', source = 'test03.for')
@@ -104,13 +104,13 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-env2 = Environment(LINK = r'%s mylink.py',
+env2 = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F90COM = r'%s myfortran.py f90 $TARGET $SOURCES',
- F90PPCOM = r'%s myfortran.py f90pp $TARGET $SOURCES')
+ F90COM = r'%(_python_)s myfortran.py f90 $TARGET $SOURCES',
+ F90PPCOM = r'%(_python_)s myfortran.py f90pp $TARGET $SOURCES')
env2.Program(target = 'test21', source = 'test21.f90')
env2.Program(target = 'test22', source = 'test22.F90')
-""" % (python, python, python, python, python, python, python, python))
+""" % 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")
diff --git a/test/Fortran/F90COMSTR.py b/test/Fortran/F90COMSTR.py
index bf7451ce..e2e3cf5a 100644
--- a/test/Fortran/F90COMSTR.py
+++ b/test/Fortran/F90COMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(F90COM = r'%(python)s myfc.py f90 $TARGET $SOURCES',
+env = Environment(F90COM = r'%(_python_)s myfc.py f90 $TARGET $SOURCES',
F90COMSTR = 'Building f90 $TARGET from $SOURCES',
- F90PPCOM = r'%(python)s myfc.py f90pp $TARGET $SOURCES',
+ F90PPCOM = r'%(_python_)s myfc.py f90pp $TARGET $SOURCES',
F90PPCOMSTR = 'Building f90pp $TARGET from $SOURCES',
OBJSUFFIX='.obj')
env.Object(source = 'test01.f90')
diff --git a/test/Fortran/F90FLAGS.py b/test/Fortran/F90FLAGS.py
index 69f1dfa9..9a57eaea 100644
--- a/test/Fortran/F90FLAGS.py
+++ b/test/Fortran/F90FLAGS.py
@@ -30,7 +30,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
_exe = TestSCons._exe
@@ -91,11 +91,11 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F90 = r'%s myfortran.py g90',
+ F90 = r'%(_python_)s myfortran.py g90',
F90FLAGS = '-x',
- FORTRAN = r'%s myfortran.py fortran',
+ FORTRAN = r'%(_python_)s myfortran.py fortran',
FORTRANFLAGS = '-y')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
@@ -111,7 +111,7 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-""" % (python, python, python))
+""" % 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#fortran\n")
@@ -161,12 +161,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
f90 = foo.Dictionary('F90')
-bar = foo.Copy(F90 = r'%s wrapper.py ' + f90, F90FLAGS = '-Ix')
+bar = foo.Copy(F90 = r'%(_python_)s wrapper.py ' + f90, F90FLAGS = '-Ix')
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/F95.py b/test/Fortran/F95.py
index a19c9046..1b5fc410 100644
--- a/test/Fortran/F95.py
+++ b/test/Fortran/F95.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -89,10 +89,10 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F95 = r'%s myfortran.py f95',
- FORTRAN = r'%s myfortran.py fortran')
+ F95 = r'%(_python_)s myfortran.py f95',
+ FORTRAN = r'%(_python_)s myfortran.py fortran')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
env.Program(target = 'test03', source = 'test03.for')
@@ -107,7 +107,7 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-""" % (python, python, python))
+""" % 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#fortran\n")
@@ -157,12 +157,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
f95 = foo.Dictionary('F95')
-bar = foo.Copy(F95 = r'%s wrapper.py ' + f95)
+bar = foo.Copy(F95 = r'%(_python_)s wrapper.py ' + f95)
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/F95COM.py b/test/Fortran/F95COM.py
index 26423f87..016230a9 100644
--- a/test/Fortran/F95COM.py
+++ b/test/Fortran/F95COM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -84,12 +84,12 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F95COM = r'%s myfortran.py f95 $TARGET $SOURCES',
- F95PPCOM = r'%s myfortran.py f95pp $TARGET $SOURCES',
- FORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- FORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+ F95COM = r'%(_python_)s myfortran.py f95 $TARGET $SOURCES',
+ F95PPCOM = r'%(_python_)s myfortran.py f95pp $TARGET $SOURCES',
+ FORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ FORTRANPPCOM = r'%(_python_)s myfortran.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')
@@ -104,13 +104,13 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-env2 = Environment(LINK = r'%s mylink.py',
+env2 = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F95COM = r'%s myfortran.py f95 $TARGET $SOURCES',
- F95PPCOM = r'%s myfortran.py f95pp $TARGET $SOURCES')
+ F95COM = r'%(_python_)s myfortran.py f95 $TARGET $SOURCES',
+ F95PPCOM = r'%(_python_)s myfortran.py f95pp $TARGET $SOURCES')
env2.Program(target = 'test21', source = 'test21.f95')
env2.Program(target = 'test22', source = 'test22.F95')
-""" % (python, python, python, python, python, python, python, python))
+""" % 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")
diff --git a/test/Fortran/F95COMSTR.py b/test/Fortran/F95COMSTR.py
index 823ade6a..ed7d1e8a 100644
--- a/test/Fortran/F95COMSTR.py
+++ b/test/Fortran/F95COMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(F95COM = r'%(python)s myfc.py f95 $TARGET $SOURCES',
+env = Environment(F95COM = r'%(_python_)s myfc.py f95 $TARGET $SOURCES',
F95COMSTR = 'Building f95 $TARGET from $SOURCES',
- F95PPCOM = r'%(python)s myfc.py f95pp $TARGET $SOURCES',
+ F95PPCOM = r'%(_python_)s myfc.py f95pp $TARGET $SOURCES',
F95PPCOMSTR = 'Building f95pp $TARGET from $SOURCES',
OBJSUFFIX='.obj')
env.Object(source = 'test01.f95')
diff --git a/test/Fortran/F95FLAGS.py b/test/Fortran/F95FLAGS.py
index 883d9a39..7ccffed7 100644
--- a/test/Fortran/F95FLAGS.py
+++ b/test/Fortran/F95FLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
_exe = TestSCons._exe
@@ -91,11 +91,11 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- F95 = r'%s myfortran.py g95',
+ F95 = r'%(_python_)s myfortran.py g95',
F95FLAGS = '-x',
- FORTRAN = r'%s myfortran.py fortran',
+ FORTRAN = r'%(_python_)s myfortran.py fortran',
FORTRANFLAGS = '-y')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
@@ -111,7 +111,7 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-""" % (python, python, python))
+""" % 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#fortran\n")
@@ -161,12 +161,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
f95 = foo.Dictionary('F95')
-bar = foo.Copy(F95 = r'%s wrapper.py ' + f95, F95FLAGS = '-Ix')
+bar = foo.Copy(F95 = r'%(_python_)s wrapper.py ' + f95, F95FLAGS = '-Ix')
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/FORTRAN.py b/test/Fortran/FORTRAN.py
index 47a0a890..1bd44073 100644
--- a/test/Fortran/FORTRAN.py
+++ b/test/Fortran/FORTRAN.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -87,9 +87,9 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- FORTRAN = r'%s myg77.py')
+ FORTRAN = r'%(_python_)s myg77.py')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
env.Program(target = 'test03', source = 'test03.for')
@@ -104,7 +104,7 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-""" % (python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#link\n#g77\n")
test.write('test02.F', "This is a .F file.\n#link\n#g77\n")
@@ -154,12 +154,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
f77 = foo.Dictionary('FORTRAN')
-bar = foo.Copy(FORTRAN = r'%s wrapper.py ' + f77)
+bar = foo.Copy(FORTRAN = r'%(_python_)s wrapper.py ' + f77)
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/FORTRANCOM.py b/test/Fortran/FORTRANCOM.py
index f79ad6da..3e3fcb2d 100644
--- a/test/Fortran/FORTRANCOM.py
+++ b/test/Fortran/FORTRANCOM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -84,10 +84,10 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- FORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- FORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+ FORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ FORTRANPPCOM = r'%(_python_)s myfortran.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')
@@ -102,7 +102,7 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-""" % (python, python, python))
+""" % 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")
diff --git a/test/Fortran/FORTRANCOMSTR.py b/test/Fortran/FORTRANCOMSTR.py
index db75d430..fd318c3a 100644
--- a/test/Fortran/FORTRANCOMSTR.py
+++ b/test/Fortran/FORTRANCOMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(FORTRANCOM = r'%(python)s myfc.py fortran $TARGET $SOURCES',
+env = Environment(FORTRANCOM = r'%(_python_)s myfc.py fortran $TARGET $SOURCES',
FORTRANCOMSTR = 'Building fortran $TARGET from $SOURCES',
- FORTRANPPCOM = r'%(python)s myfc.py fortranpp $TARGET $SOURCES',
+ FORTRANPPCOM = r'%(_python_)s myfc.py fortranpp $TARGET $SOURCES',
FORTRANPPCOMSTR = 'Building fortranpp $TARGET from $SOURCES',
OBJSUFFIX='.obj')
env.Object(source = 'test01.f')
diff --git a/test/Fortran/FORTRANFLAGS.py b/test/Fortran/FORTRANFLAGS.py
index 8d77d630..6dd27d7f 100644
--- a/test/Fortran/FORTRANFLAGS.py
+++ b/test/Fortran/FORTRANFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
_exe = TestSCons._exe
@@ -90,9 +90,9 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(LINK = r'%s mylink.py',
+env = Environment(LINK = r'%(_python_)s mylink.py',
LINKFLAGS = [],
- FORTRAN = r'%s myfortran.py',
+ FORTRAN = r'%(_python_)s myfortran.py',
FORTRANFLAGS = '-x')
env.Program(target = 'test01', source = 'test01.f')
env.Program(target = 'test02', source = 'test02.F')
@@ -108,7 +108,7 @@ env.Program(target = 'test11', source = 'test11.f90')
env.Program(target = 'test12', source = 'test12.F90')
env.Program(target = 'test13', source = 'test13.f95')
env.Program(target = 'test14', source = 'test14.F95')
-""" % (python, python))
+""" % 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#fortran\n")
@@ -158,12 +158,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
f77 = foo.Dictionary('FORTRAN')
-bar = foo.Copy(FORTRAN = r'%s wrapper.py ' + f77, FORTRANFLAGS = '-Ix')
+bar = foo.Copy(FORTRAN = r'%(_python_)s wrapper.py ' + f77, FORTRANFLAGS = '-Ix')
foo.Program(target = 'foo', source = 'foo.f')
bar.Program(target = 'bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/FORTRANMODDIR.py b/test/Fortran/FORTRANMODDIR.py
index 4d594a18..f0c500cc 100644
--- a/test/Fortran/FORTRANMODDIR.py
+++ b/test/Fortran/FORTRANMODDIR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -51,7 +51,7 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(FORTRANCOM = r'%(python)s myfortran.py $FORTRANMODDIR $SOURCE $TARGET',
+env = Environment(FORTRANCOM = r'%(_python_)s myfortran.py $FORTRANMODDIR $SOURCE $TARGET',
FORTRANMODDIR = 'modules')
env.Object(target = 'test1.obj', source = 'test1.f')
""" % locals())
diff --git a/test/Fortran/FORTRANSUFFIXES.py b/test/Fortran/FORTRANSUFFIXES.py
index c172f7a3..3011fac7 100644
--- a/test/Fortran/FORTRANSUFFIXES.py
+++ b/test/Fortran/FORTRANSUFFIXES.py
@@ -30,7 +30,7 @@ Test the ability to scan additional filesuffixes added to $FORTRANSUFFIXES.
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -51,7 +51,7 @@ sys.exit(0)
test.write('SConstruct', """
env = Environment(FORTRANPATH = ['.'],
- FORTRAN = r'%s myfc.py',
+ FORTRAN = r'%(_python_)s myfc.py',
FORTRANCOM = '$FORTRAN $TARGET $SOURCES',
OBJSUFFIX = '.o')
env.Append(FORTRANSUFFIXES = ['.x'])
@@ -59,7 +59,7 @@ env.Object(target = 'test1', source = 'test1.f')
env.InstallAs('test1_f', 'test1.f')
env.InstallAs('test1_h', 'test1.h')
env.InstallAs('test1_x', 'test1.x')
-""" % (python,))
+""" % locals())
test.write('test1.f', """\
test1.f 1
@@ -81,12 +81,14 @@ test.write('foo.h', """\
foo.h 1
""")
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s myfc.py test1.o test1.f
+expect = test.wrap_stdout("""\
+%(_python_)s myfc.py test1.o test1.f
Install file: "test1.f" as "test1_f"
Install file: "test1.h" as "test1_h"
Install file: "test1.x" as "test1_x"
-""" % (python,)))
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
test.must_match('test1.o', """\
test1.f 1
@@ -102,9 +104,11 @@ test.write('foo.h', """\
foo.h 2
""")
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s myfc.py test1.o test1.f
-""" % (python,)))
+expect = test.wrap_stdout("""\
+%(_python_)s myfc.py test1.o test1.f
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
test.must_match('test1.o', """\
test1.f 1
@@ -121,10 +125,12 @@ test.write('test1.x', """\
INCLUDE 'foo.h'
""")
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s myfc.py test1.o test1.f
+expect = test.wrap_stdout("""\
+%(_python_)s myfc.py test1.o test1.f
Install file: "test1.x" as "test1_x"
-""" % (python,)))
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
test.must_match('test1.o', """\
test1.f 1
@@ -141,10 +147,12 @@ test.write('test1.h', """\
INCLUDE 'foo.h'
""")
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s myfc.py test1.o test1.f
+expect = test.wrap_stdout("""\
+%(_python_)s myfc.py test1.o test1.f
Install file: "test1.h" as "test1_h"
-""" % (python,)))
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
test.must_match('test1.o', """\
test1.f 1
diff --git a/test/Fortran/SHF77.py b/test/Fortran/SHF77.py
index 233921b3..c9569c94 100644
--- a/test/Fortran/SHF77.py
+++ b/test/Fortran/SHF77.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -54,8 +54,8 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF77 = r'%s myfortran.py g77',
- SHFORTRAN = r'%s myfortran.py fortran')
+env = Environment(SHF77 = r'%(_python_)s myfortran.py g77',
+ SHFORTRAN = r'%(_python_)s myfortran.py fortran')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -70,7 +70,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-env2 = Environment(SHF77 = r'%s myfortran.py g77')
+env2 = Environment(SHF77 = r'%(_python_)s myfortran.py g77')
env2.SharedObject(target = 'test21', source = 'test21.f')
env2.SharedObject(target = 'test22', source = 'test22.F')
env2.SharedObject(target = 'test23', source = 'test23.for')
@@ -79,7 +79,7 @@ env2.SharedObject(target = 'test25', source = 'test25.ftn')
env2.SharedObject(target = 'test26', source = 'test26.FTN')
env2.SharedObject(target = 'test27', source = 'test27.fpp')
env2.SharedObject(target = 'test28', source = 'test28.FPP')
-""" % (python, python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortran\n")
@@ -148,10 +148,10 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(LIBS = 'g2c')
shf77 = foo.Dictionary('SHF77')
-bar = foo.Copy(SHF77 = r'%s wrapper.py ' + shf77)
+bar = foo.Copy(SHF77 = r'%(_python_)s wrapper.py ' + shf77)
foo.SharedObject(target = 'foo/foo', source = 'foo.f')
bar.SharedObject(target = 'bar/bar', source = 'bar.f')
-""" % python)
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/SHF77COM.py b/test/Fortran/SHF77COM.py
index fa024875..75192dfe 100644
--- a/test/Fortran/SHF77COM.py
+++ b/test/Fortran/SHF77COM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -50,10 +50,10 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF77COM = r'%s myfortran.py f77 $TARGET $SOURCES',
- SHF77PPCOM = r'%s myfortran.py f77pp $TARGET $SOURCES',
- SHFORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- SHFORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+env = Environment(SHF77COM = r'%(_python_)s myfortran.py f77 $TARGET $SOURCES',
+ SHF77PPCOM = r'%(_python_)s myfortran.py f77pp $TARGET $SOURCES',
+ SHFORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ SHFORTRANPPCOM = r'%(_python_)s myfortran.py fortranpp $TARGET $SOURCES')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -68,8 +68,8 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-env2 = Environment(SHF77COM = r'%s myfortran.py f77 $TARGET $SOURCES',
- SHF77PPCOM = r'%s myfortran.py f77pp $TARGET $SOURCES')
+env2 = Environment(SHF77COM = r'%(_python_)s myfortran.py f77 $TARGET $SOURCES',
+ SHF77PPCOM = r'%(_python_)s myfortran.py f77pp $TARGET $SOURCES')
env2.SharedObject(target = 'test21', source = 'test21.f')
env2.SharedObject(target = 'test22', source = 'test22.F')
env2.SharedObject(target = 'test23', source = 'test23.for')
@@ -80,7 +80,7 @@ env2.SharedObject(target = 'test27', source = 'test27.fpp')
env2.SharedObject(target = 'test28', source = 'test28.FPP')
env2.SharedObject(target = 'test29', source = 'test29.f77')
env2.SharedObject(target = 'test30', source = 'test30.F77')
-""" % (python, python, python, python, python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortranpp\n")
diff --git a/test/Fortran/SHF77COMSTR.py b/test/Fortran/SHF77COMSTR.py
index fdb81c19..90855702 100644
--- a/test/Fortran/SHF77COMSTR.py
+++ b/test/Fortran/SHF77COMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(SHF77COM = r'%(python)s myfc.py f77 $TARGET $SOURCES',
+env = Environment(SHF77COM = r'%(_python_)s myfc.py f77 $TARGET $SOURCES',
SHF77COMSTR = 'Building f77 $TARGET from $SOURCES',
- SHF77PPCOM = r'%(python)s myfc.py f77pp $TARGET $SOURCES',
+ SHF77PPCOM = r'%(_python_)s myfc.py f77pp $TARGET $SOURCES',
SHF77PPCOMSTR = 'Building f77pp $TARGET from $SOURCES',
SHOBJSUFFIX='.shobj')
env.SharedObject(source = 'test01.f')
diff --git a/test/Fortran/SHF77FLAGS.py b/test/Fortran/SHF77FLAGS.py
index 85c1168f..5354a576 100644
--- a/test/Fortran/SHF77FLAGS.py
+++ b/test/Fortran/SHF77FLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
if sys.platform == 'win32':
_obj = '.obj'
@@ -63,7 +63,7 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF77 = r'%s myg77.py',
+env = Environment(SHF77 = r'%(_python_)s myg77.py',
SHF77FLAGS = '-x')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
@@ -75,7 +75,7 @@ env.SharedObject(target = 'test07', source = 'test07.fpp')
env.SharedObject(target = 'test08', source = 'test08.FPP')
env.SharedObject(target = 'test09', source = 'test09.f77')
env.SharedObject(target = 'test10', source = 'test10.F77')
-""" % (python,))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#g77\n")
test.write('test02.F', "This is a .F file.\n#g77\n")
@@ -117,12 +117,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
shf77 = foo.Dictionary('SHF77')
-bar = foo.Copy(SHF77 = r'%s wrapper.py ' + shf77, SHF77FLAGS = '-Ix')
+bar = foo.Copy(SHF77 = r'%(_python_)s wrapper.py ' + shf77, SHF77FLAGS = '-Ix')
foo.SharedLibrary(target = 'foo/foo', source = 'foo.f')
bar.SharedLibrary(target = 'bar/bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/SHF90.py b/test/Fortran/SHF90.py
index 66bd68dc..1696b4a8 100644
--- a/test/Fortran/SHF90.py
+++ b/test/Fortran/SHF90.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -54,8 +54,8 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF90 = r'%s myfortran.py g90',
- SHFORTRAN = r'%s myfortran.py fortran')
+env = Environment(SHF90 = r'%(_python_)s myfortran.py g90',
+ SHFORTRAN = r'%(_python_)s myfortran.py fortran')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -70,7 +70,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-""" % (python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortran\n")
@@ -121,10 +121,10 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(LIBS = 'g2c')
shf90 = foo.Dictionary('SHF90')
-bar = foo.Copy(SHF90 = r'%s wrapper.py ' + shf90)
+bar = foo.Copy(SHF90 = r'%(_python_)s wrapper.py ' + shf90)
foo.SharedObject(target = 'foo/foo', source = 'foo.f')
bar.SharedObject(target = 'bar/bar', source = 'bar.f')
-""" % python)
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/SHF90COM.py b/test/Fortran/SHF90COM.py
index ffc98789..13d9978a 100644
--- a/test/Fortran/SHF90COM.py
+++ b/test/Fortran/SHF90COM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -50,10 +50,10 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF90COM = r'%s myfortran.py f90 $TARGET $SOURCES',
- SHF90PPCOM = r'%s myfortran.py f90pp $TARGET $SOURCES',
- SHFORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- SHFORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+env = Environment(SHF90COM = r'%(_python_)s myfortran.py f90 $TARGET $SOURCES',
+ SHF90PPCOM = r'%(_python_)s myfortran.py f90pp $TARGET $SOURCES',
+ SHFORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ SHFORTRANPPCOM = r'%(_python_)s myfortran.py fortranpp $TARGET $SOURCES')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -68,11 +68,11 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-env2 = Environment(SHF90COM = r'%s myfortran.py f90 $TARGET $SOURCES',
- SHF90PPCOM = r'%s myfortran.py f90pp $TARGET $SOURCES')
+env2 = Environment(SHF90COM = r'%(_python_)s myfortran.py f90 $TARGET $SOURCES',
+ SHF90PPCOM = r'%(_python_)s myfortran.py f90pp $TARGET $SOURCES')
env2.SharedObject(target = 'test21', source = 'test21.f90')
env2.SharedObject(target = 'test22', source = 'test22.F90')
-""" % (python, python, python, python, python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortranpp\n")
diff --git a/test/Fortran/SHF90COMSTR.py b/test/Fortran/SHF90COMSTR.py
index f0e44d3d..9633d451 100644
--- a/test/Fortran/SHF90COMSTR.py
+++ b/test/Fortran/SHF90COMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(SHF90COM = r'%(python)s myfc.py f90 $TARGET $SOURCES',
+env = Environment(SHF90COM = r'%(_python_)s myfc.py f90 $TARGET $SOURCES',
SHF90COMSTR = 'Building f90 $TARGET from $SOURCES',
- SHF90PPCOM = r'%(python)s myfc.py f90pp $TARGET $SOURCES',
+ SHF90PPCOM = r'%(_python_)s myfc.py f90pp $TARGET $SOURCES',
SHF90PPCOMSTR = 'Building f90pp $TARGET from $SOURCES',
SHOBJSUFFIX='.shobj')
env.SharedObject(source = 'test01.f90')
diff --git a/test/Fortran/SHF90FLAGS.py b/test/Fortran/SHF90FLAGS.py
index 3997cbb4..62bb7d0d 100644
--- a/test/Fortran/SHF90FLAGS.py
+++ b/test/Fortran/SHF90FLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
if sys.platform == 'win32':
_obj = '.obj'
@@ -64,9 +64,9 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF90 = r'%s myfortran.py g90',
+env = Environment(SHF90 = r'%(_python_)s myfortran.py g90',
SHF90FLAGS = '-x',
- SHFORTRAN = r'%s myfortran.py fortran',
+ SHFORTRAN = r'%(_python_)s myfortran.py fortran',
SHFORTRANFLAGS = '-y')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
@@ -82,7 +82,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-""" % (python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortran\n")
@@ -132,12 +132,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
shf90 = foo.Dictionary('SHF90')
-bar = foo.Copy(SHF90 = r'%s wrapper.py ' + shf90, SHF90FLAGS = '-Ix')
+bar = foo.Copy(SHF90 = r'%(_python_)s wrapper.py ' + shf90, SHF90FLAGS = '-Ix')
foo.SharedLibrary(target = 'foo/foo', source = 'foo.f')
bar.SharedLibrary(target = 'bar/bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/SHF95.py b/test/Fortran/SHF95.py
index d2d92a91..85702df2 100644
--- a/test/Fortran/SHF95.py
+++ b/test/Fortran/SHF95.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -54,8 +54,8 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF95 = r'%s myfortran.py g95',
- SHFORTRAN = r'%s myfortran.py fortran')
+env = Environment(SHF95 = r'%(_python_)s myfortran.py g95',
+ SHFORTRAN = r'%(_python_)s myfortran.py fortran')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -70,7 +70,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-""" % (python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortran\n")
@@ -121,10 +121,10 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(LIBS = 'g2c')
shf95 = foo.Dictionary('SHF95')
-bar = foo.Copy(SHF95 = r'%s wrapper.py ' + shf95)
+bar = foo.Copy(SHF95 = r'%(_python_)s wrapper.py ' + shf95)
foo.SharedObject(target = 'foo/foo', source = 'foo.f')
bar.SharedObject(target = 'bar/bar', source = 'bar.f')
-""" % python)
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/SHF95COM.py b/test/Fortran/SHF95COM.py
index e28f8630..b11933a0 100644
--- a/test/Fortran/SHF95COM.py
+++ b/test/Fortran/SHF95COM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -50,10 +50,10 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF95COM = r'%s myfortran.py f95 $TARGET $SOURCES',
- SHF95PPCOM = r'%s myfortran.py f95pp $TARGET $SOURCES',
- SHFORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- SHFORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+env = Environment(SHF95COM = r'%(_python_)s myfortran.py f95 $TARGET $SOURCES',
+ SHF95PPCOM = r'%(_python_)s myfortran.py f95pp $TARGET $SOURCES',
+ SHFORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ SHFORTRANPPCOM = r'%(_python_)s myfortran.py fortranpp $TARGET $SOURCES')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -68,11 +68,11 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-env2 = Environment(SHF95COM = r'%s myfortran.py f95 $TARGET $SOURCES',
- SHF95PPCOM = r'%s myfortran.py f95pp $TARGET $SOURCES')
+env2 = Environment(SHF95COM = r'%(_python_)s myfortran.py f95 $TARGET $SOURCES',
+ SHF95PPCOM = r'%(_python_)s myfortran.py f95pp $TARGET $SOURCES')
env2.SharedObject(target = 'test21', source = 'test21.f95')
env2.SharedObject(target = 'test22', source = 'test22.F95')
-""" % (python, python, python, python, python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortranpp\n")
diff --git a/test/Fortran/SHF95COMSTR.py b/test/Fortran/SHF95COMSTR.py
index 461d7ff6..eaa24ae7 100644
--- a/test/Fortran/SHF95COMSTR.py
+++ b/test/Fortran/SHF95COMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(SHF95COM = r'%(python)s myfc.py f95 $TARGET $SOURCES',
+env = Environment(SHF95COM = r'%(_python_)s myfc.py f95 $TARGET $SOURCES',
SHF95COMSTR = 'Building f95 $TARGET from $SOURCES',
- SHF95PPCOM = r'%(python)s myfc.py f95pp $TARGET $SOURCES',
+ SHF95PPCOM = r'%(_python_)s myfc.py f95pp $TARGET $SOURCES',
SHF95PPCOMSTR = 'Building f95pp $TARGET from $SOURCES',
SHOBJSUFFIX='.shobj')
env.SharedObject(source = 'test01.f95')
diff --git a/test/Fortran/SHF95FLAGS.py b/test/Fortran/SHF95FLAGS.py
index 782a495c..2288a4a5 100644
--- a/test/Fortran/SHF95FLAGS.py
+++ b/test/Fortran/SHF95FLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
if sys.platform == 'win32':
_obj = '.obj'
@@ -64,9 +64,9 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHF95 = r'%s myfortran.py g95',
+env = Environment(SHF95 = r'%(_python_)s myfortran.py g95',
SHF95FLAGS = '-x',
- SHFORTRAN = r'%s myfortran.py fortran',
+ SHFORTRAN = r'%(_python_)s myfortran.py fortran',
SHFORTRANFLAGS = '-y')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
@@ -82,7 +82,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-""" % (python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortran\n")
@@ -132,12 +132,12 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
shf95 = foo.Dictionary('SHF95')
-bar = foo.Copy(SHF95 = r'%s wrapper.py ' + shf95, SHF95FLAGS = '-Ix')
+bar = foo.Copy(SHF95 = r'%(_python_)s wrapper.py ' + shf95, SHF95FLAGS = '-Ix')
foo.SharedLibrary(target = 'foo/foo', source = 'foo.f')
bar.SharedLibrary(target = 'bar/bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/SHFORTRAN.py b/test/Fortran/SHFORTRAN.py
index 17a58f5d..586b54e1 100644
--- a/test/Fortran/SHFORTRAN.py
+++ b/test/Fortran/SHFORTRAN.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -53,7 +53,7 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHFORTRAN = r'%s myfortran.py')
+env = Environment(SHFORTRAN = r'%(_python_)s myfortran.py')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -68,7 +68,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-""" % python)
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortran\n")
@@ -119,10 +119,10 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(LIBS = 'g2c')
shfortran = foo.Dictionary('SHFORTRAN')
-bar = foo.Copy(SHFORTRAN = r'%s wrapper.py ' + shfortran)
+bar = foo.Copy(SHFORTRAN = r'%(_python_)s wrapper.py ' + shfortran)
foo.SharedObject(target = 'foo/foo', source = 'foo.f')
bar.SharedObject(target = 'bar/bar', source = 'bar.f')
-""" % python)
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/SHFORTRANCOM.py b/test/Fortran/SHFORTRANCOM.py
index f4d44dc6..21942cfa 100644
--- a/test/Fortran/SHFORTRANCOM.py
+++ b/test/Fortran/SHFORTRANCOM.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_obj = TestSCons._shobj
test = TestSCons.TestSCons()
@@ -50,8 +50,8 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHFORTRANCOM = r'%s myfortran.py fortran $TARGET $SOURCES',
- SHFORTRANPPCOM = r'%s myfortran.py fortranpp $TARGET $SOURCES')
+env = Environment(SHFORTRANCOM = r'%(_python_)s myfortran.py fortran $TARGET $SOURCES',
+ SHFORTRANPPCOM = r'%(_python_)s myfortran.py fortranpp $TARGET $SOURCES')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
env.SharedObject(target = 'test03', source = 'test03.for')
@@ -66,7 +66,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-""" % (python, python))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortranpp\n")
diff --git a/test/Fortran/SHFORTRANCOMSTR.py b/test/Fortran/SHFORTRANCOMSTR.py
index 8ad3b142..69a1eba7 100644
--- a/test/Fortran/SHFORTRANCOMSTR.py
+++ b/test/Fortran/SHFORTRANCOMSTR.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
test = TestSCons.TestSCons()
@@ -52,9 +52,9 @@ else:
test.write('SConstruct', """
-env = Environment(SHFORTRANCOM = r'%(python)s myfc.py fortran $TARGET $SOURCES',
+env = Environment(SHFORTRANCOM = r'%(_python_)s myfc.py fortran $TARGET $SOURCES',
SHFORTRANCOMSTR = 'Building fortran $TARGET from $SOURCES',
- SHFORTRANPPCOM = r'%(python)s myfc.py fortranpp $TARGET $SOURCES',
+ SHFORTRANPPCOM = r'%(_python_)s myfc.py fortranpp $TARGET $SOURCES',
SHFORTRANPPCOMSTR = 'Building fortranpp $TARGET from $SOURCES',
SHOBJSUFFIX='.shobj')
env.SharedObject(source = 'test01.f')
diff --git a/test/Fortran/SHFORTRANFLAGS.py b/test/Fortran/SHFORTRANFLAGS.py
index e96ade99..d09a2830 100644
--- a/test/Fortran/SHFORTRANFLAGS.py
+++ b/test/Fortran/SHFORTRANFLAGS.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
if sys.platform == 'win32':
_obj = '.obj'
@@ -63,7 +63,7 @@ sys.exit(0)
test.write('SConstruct', """
-env = Environment(SHFORTRAN = r'%s myfortran.py',
+env = Environment(SHFORTRAN = r'%(_python_)s myfortran.py',
SHFORTRANFLAGS = '-x')
env.SharedObject(target = 'test01', source = 'test01.f')
env.SharedObject(target = 'test02', source = 'test02.F')
@@ -79,7 +79,7 @@ env.SharedObject(target = 'test11', source = 'test11.f90')
env.SharedObject(target = 'test12', source = 'test12.F90')
env.SharedObject(target = 'test13', source = 'test13.f95')
env.SharedObject(target = 'test14', source = 'test14.F95')
-""" % (python,))
+""" % locals())
test.write('test01.f', "This is a .f file.\n#fortran\n")
test.write('test02.F', "This is a .F file.\n#fortran\n")
@@ -129,13 +129,13 @@ os.system(string.join(sys.argv[1:], " "))
""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
test.write('SConstruct', """
-foo = Environment(LIBS = %s)
+foo = Environment(LIBS = %(FTN_LIB)s)
shfortran = foo.Dictionary('SHFORTRAN')
-bar = foo.Copy(SHFORTRAN = r'%s wrapper.py ' + shfortran,
+bar = foo.Copy(SHFORTRAN = r'%(_python_)s wrapper.py ' + shfortran,
SHFORTRANFLAGS = '-Ix')
foo.SharedLibrary(target = 'foo/foo', source = 'foo.f')
bar.SharedLibrary(target = 'bar/bar', source = 'bar.f')
-""" % (FTN_LIB, python))
+""" % locals())
test.write('foo.f', r"""
PROGRAM FOO
diff --git a/test/Fortran/USE-MODULE.py b/test/Fortran/USE-MODULE.py
index 541c4570..23d0a894 100644
--- a/test/Fortran/USE-MODULE.py
+++ b/test/Fortran/USE-MODULE.py
@@ -29,7 +29,7 @@ import string
import sys
import TestSCons
-python = TestSCons.python
+_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
@@ -51,7 +51,7 @@ sys.exit(0)
""")
test.write('SConstruct', """
-env = Environment(FORTRANCOM = r'%(python)s myfortran.py $SOURCE $TARGET')
+env = Environment(FORTRANCOM = r'%(_python_)s myfortran.py $SOURCE $TARGET')
env.Object(target = 'test1.obj', source = 'test1.f')
""" % locals())
diff --git a/test/Fortran/module-subdir.py b/test/Fortran/module-subdir.py
new file mode 100644
index 00000000..88d08880
--- /dev/null
+++ b/test/Fortran/module-subdir.py
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Validate that $FORTRANMODDIR values get expanded correctly on Fortran
+command lines relative to the appropriate subdirectory.
+"""
+
+import os.path
+
+import TestSCons
+
+_python_ = TestSCons._python_
+
+test = TestSCons.TestSCons()
+
+test.subdir('subdir',
+ ['subdir', 'src'],
+ ['subdir', 'build'])
+
+test.write('myfortran.py', r"""
+import getopt
+import os
+import sys
+comment = '#' + sys.argv[1]
+length = len(comment)
+opts, args = getopt.getopt(sys.argv[2:], 'cM:o:')
+for opt, arg in opts:
+ if opt == '-o': out = arg
+ elif opt == '-M': modsubdir = arg
+import os
+infile = open(args[0], 'rb')
+outfile = open(out, 'wb')
+for l in infile.readlines():
+ if l[:7] == 'module ':
+ module = modsubdir + os.sep + l[7:-1] + '.mod'
+ open(module, 'wb').write('myfortran.py wrote %s\n' % module)
+ if l[:length] != comment:
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('myar.py', """\
+import sys
+t = open(sys.argv[1], 'wb')
+for s in sys.argv[2:]:
+ t.write(open(s, 'rb').read())
+t.close
+sys.exit(0)
+""")
+
+test.write('SConstruct', """\
+env = Environment(FORTRANMODDIRPREFIX = '-M',
+ FORTRANMODDIR = 'modules',
+ F90 = r'%(_python_)s myfortran.py f90',
+ FORTRAN = r'%(_python_)s myfortran.py fortran',
+ AR = 'myar.py',
+ ARCOM = r'%(_python_)s $AR $TARGET $SOURCES',
+ RANLIBCOM = '')
+Export('env')
+objs = SConscript('subdir/SConscript')
+env.Library('bidule', objs)
+""" % locals())
+
+test.write(['subdir', 'SConscript'], """\
+Import('env')
+
+env['FORTRANMODDIR'] = 'build'
+sources = ['src/modfile.f90']
+objs = env.Object(sources)
+Return("objs")
+""")
+
+test.write(['subdir', 'src', 'modfile.f90'], """\
+#f90 comment
+module somemodule
+
+integer :: nothing
+
+end module
+""")
+
+
+test.run(arguments = '.')
+
+somemodule = os.path.join('subdir', 'build', 'somemodule.mod')
+
+expect = "myfortran.py wrote %s\n" % somemodule
+
+test.must_match(['subdir', 'build', 'somemodule.mod'], expect)
+
+test.pass_test()