- Suport the Intel Fortran Compiler (ifl.exe).
+ - Supply an error message if there are no command-line or
+ Default() targets specified.
+
From Anthony Roach:
- Fixed use of command lines with spaces in their arguments,
if not targets:
targets = SCons.Script.SConscript.default_targets
+ if not targets:
+ sys.stderr.write("scons: *** No targets specified and no Default() targets found. Stop.\n")
+ sys.exit(2)
+
def Entry(x, top = target_top):
if isinstance(x, SCons.Node.Node):
node = x
foo.close()
""")
-test.run(arguments='a=1 bz=3 xx=sd')
+test.run(arguments='a=1 bz=3 xx=sd .')
test.fail_test(test.read('foo.out') != """a = 1
bz = 3
except:
print 'There is no fortran compiler.'
""")
-test.run()
+test.run(arguments = ".")
f77 = test.where_is(test.stdout()[:-1])
test.unlink('SConstruct')
test 4
+scons: "." is up to date.
"""
-test.run(stdout = expect)
+test.run(arguments = ".", stdout = expect)
test.pass_test()
'.lib'
'.a'
'.lib'
+scons: "." is up to date.
"""
-test.run(stdout = expect)
+test.run(arguments = ".", stdout = expect)
test.pass_test()
wpath = test.workpath()
-test.run(stdout = "SConstruct %s\nSConscript %s\n" % (wpath, wpath))
+test.run(arguments = ".",
+ stdout = 'SConstruct %s\nSConscript %s\nscons: "." is up to date.\n' % (wpath, wpath))
+
test.pass_test()
test = TestSCons.TestSCons(match = TestCmd.match_re)
-test.run(stdout = "",
- stderr = r"""
+test.run(arguments = ".",
+ status = 2,
+ stdout = "",
+ stderr = r"""
SCons error: No SConstruct file found.
File "\S+", line \d+, in \S+
-""", status=2)
+""")
test.match_func = TestCmd.match_exact
print "sconstruct", os.getcwd()
""")
-test.run(stdout = "sconstruct %s\n" % wpath)
+test.run(arguments = ".", stdout = 'sconstruct %s\nscons: "." is up to date.\n' % wpath)
+
test.write('Sconstruct', """
import os
print "Sconstruct", os.getcwd()
""")
-test.run(stdout = "Sconstruct %s\n" % wpath)
+test.run(arguments = ".", stdout = 'Sconstruct %s\nscons: "." is up to date.\n' % wpath)
test.write('SConstruct', """
import os
print "SConstruct", os.getcwd()
""")
-test.run(stdout = "SConstruct %s\n" % wpath)
+test.run(arguments = ".", stdout = 'SConstruct %s\nscons: "." is up to date.\n' % wpath)
test.pass_test()
['fff']
['ggg', 'hhh']
['iii', 'jjj']
+scons: "." is up to date.
"""
-test.run(stdout = expect)
+test.run(arguments = ".", stdout = expect)
test.pass_test()
test.workpath(sub4_xxx_exe),
test.workpath(sub3_xxx_exe),
test.workpath(sub4_xxx_exe),
+ 'scons: "." is up to date.',
]
-test.run(stdout = string.join(expect, "\n") + "\n")
+test.run(arguments = ".", stdout = string.join(expect, "\n") + "\n")
os.environ['PATH'] = string.join(pathdirs_1243, os.pathsep)
test.workpath(sub4_xxx_exe),
test.workpath(sub3_xxx_exe),
test.workpath(sub4_xxx_exe),
+ 'scons: "." is up to date.',
]
-test.run(stdout = string.join(expect, "\n") + "\n")
+test.run(arguments = ".", stdout = string.join(expect, "\n") + "\n")
test.pass_test()
"""
-expected_output = """running x3('no kwd args', kwd=None)
+expected_output = """scons: "." is up to date.
+running x3('no kwd args', kwd=None)
running x3(5, kwd='bar')
running x2(12)
running x1
test.write('SConstruct', sconstruct)
-test.run(arguments='-f SConstruct', stdout = expected_output)
+test.run(arguments='-f SConstruct .', stdout = expected_output)
test.write('SConstruct', """import sys
def f():
sys.exitfunc = f
""" + sconstruct)
-test.run(arguments='-f SConstruct', stdout = expected_output)
+test.run(arguments='-f SConstruct .', stdout = expected_output)
test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# Copyright (c) 2001, 2002 Steven Knight
+#
+# 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__"
+
+import os.path
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', r"""
+def cat(env, source, target):
+ target = str(target[0])
+ source = map(str, source)
+ print 'cat(%s) > %s' % (source, target)
+ f = open(target, "wb")
+ for src in source:
+ f.write(open(src, "rb").read())
+ f.close()
+
+env = Environment(BUILDERS={'Build':Builder(action=cat)})
+env.Build('aaa.out', 'aaa.in')
+""")
+
+test.write('aaa.in', "aaa.in\n")
+
+#
+test.run(arguments = '.')
+
+test.fail_test(test.read('aaa.out') != "aaa.in\n")
+
+#
+test.run(status = 2, stderr =
+"scons: *** No targets specified and no Default() targets found. Stop.\n")
+
+#
+test.pass_test()
print GetBuildPath('..')
""")
-test.run(arguments = '-C sub',
- stdout = "%s\n" % wpath)
+test.run(arguments = '-C sub .',
+ stdout = '%s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '-C sub -C dir',
- stdout = "%s\n" % wpath_sub)
+test.run(arguments = '-C sub -C dir .',
+ stdout = '%s\nscons: "." is up to date.\n' % wpath_sub)
-test.run(stdout = "SConstruct %s\n" % wpath)
+test.run(arguments = ".",
+ stdout = 'SConstruct %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '--directory=sub/dir',
- stdout = "%s\n" % wpath_sub)
+test.run(arguments = '--directory=sub/dir .',
+ stdout = '%s\nscons: "." is up to date.\n' % wpath_sub)
-test.run(arguments = '-C %s -C %s' % (wpath_sub_dir, wpath_sub),
- stdout = "%s\n" % wpath)
+test.run(arguments = '-C %s -C %s .' % (wpath_sub_dir, wpath_sub),
+ stdout = '%s\nscons: "." is up to date.\n' % wpath)
test.pass_test()
print bar.variable
""")
-test.run(arguments = '-I sub1 -I sub2', stdout = "sub1/foo\nsub2/bar\n")
+test.run(arguments = '-I sub1 -I sub2 .',
+ stdout = 'sub1/foo\nsub2/bar\nscons: "." is up to date.\n')
-test.run(arguments = '--include-dir=sub2 --include-dir=sub1',
- stdout = "sub2/foo\nsub2/bar\n")
+test.run(arguments = '--include-dir=sub2 --include-dir=sub1 .',
+ stdout = 'sub2/foo\nsub2/bar\nscons: "." is up to date.\n')
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-R',
+test.run(arguments = '-R .',
stderr = "Warning: the -R option is not yet implemented\n")
-test.run(arguments = '--no-builtin-variables',
+test.run(arguments = '--no-builtin-variables .',
stderr = "Warning: the --no-builtin-variables option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-S', stderr = "Warning: ignoring -S option\n")
+test.run(arguments = '-S .', stderr = "Warning: ignoring -S option\n")
-test.run(arguments = '--no-keep-going',
+test.run(arguments = '--no-keep-going .',
stderr = "Warning: ignoring --no-keep-going option\n")
-test.run(arguments = '--stop', stderr = "Warning: ignoring --stop option\n")
+test.run(arguments = '--stop .', stderr = "Warning: ignoring --stop option\n")
test.pass_test()
test.unlink(['sub1', 'foo.out'])
test.write('SConscript', """assert GetLaunchDir() == r'%s'"""%test.workpath('sub1'))
-test.run(arguments = '-U', chdir = 'sub1')
+test.run(arguments = '-U', chdir = 'sub1', stderr = None, status = 2)
test.fail_test(os.path.exists(test.workpath('sub1', 'foo.out')))
test.fail_test(os.path.exists(test.workpath('sub2', 'bar.out')))
test.fail_test(os.path.exists(test.workpath('sub2b', 'bar.out')))
test.write('SConstruct', "")
-test.run(arguments = '-W foo',
+test.run(arguments = '-W foo .',
stderr = "Warning: the -W option is not yet implemented\n")
-test.run(arguments = '--what-if=foo',
+test.run(arguments = '--what-if=foo .',
stderr = "Warning: the --what-if option is not yet implemented\n")
-test.run(arguments = '--new-file=foo',
+test.run(arguments = '--new-file=foo .',
stderr = "Warning: the --new-file option is not yet implemented\n")
-test.run(arguments = '--assume-new=foo',
+test.run(arguments = '--assume-new=foo .',
stderr = "Warning: the --assume-new option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--cache-disable',
+test.run(arguments = '--cache-disable .',
stderr = "Warning: the --cache-disable option is not yet implemented\n")
-test.run(arguments = '--no-cache',
+test.run(arguments = '--no-cache .',
stderr = "Warning: the --no-cache option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--cache-force',
+test.run(arguments = '--cache-force .',
stderr = "Warning: the --cache-force option is not yet implemented\n")
-test.run(arguments = '--cache-populate',
+test.run(arguments = '--cache-populate .',
stderr = "Warning: the --cache-populate option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--cache-show',
+test.run(arguments = '--cache-show .',
stderr = "Warning: the --cache-show option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--list-actions',
+test.run(arguments = '--list-actions .',
stderr = "Warning: the --list-actions option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--list-derived',
+test.run(arguments = '--list-derived .',
stderr = "Warning: the --list-derived option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--list-where',
+test.run(arguments = '--list-where .',
stderr = "Warning: the --list-where option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--no-print-directory',
+test.run(arguments = '--no-print-directory .',
stderr = "Warning: the --no-print-directory option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--override=foo',
+test.run(arguments = '--override=foo .',
stderr = "Warning: the --override option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '--random',
+test.run(arguments = '--random .',
stderr = "Warning: the --random option is not yet implemented\n")
test.pass_test()
b=Builder(name='b', action='foo')
""")
-test.run(arguments='', stderr=r"""
+test.run(arguments='.', stderr=r"""
SCons warning: The use of the 'name' parameter to Builder\(\) is deprecated\.
File "SConstruct", line 2, in \?
""")
-test.run(arguments='--warn=no-deprecated', stderr='')
+test.run(arguments='--warn=no-deprecated .', stderr='')
-test.run(arguments='--warn=no-all', stderr='')
+test.run(arguments='--warn=no-all .', stderr='')
-test.run(arguments='--warn=no-all --warn=deprecated', stderr=r"""
+test.run(arguments='--warn=no-all --warn=deprecated .', stderr=r"""
SCons warning: The use of the 'name' parameter to Builder\(\) is deprecated\.
File "SConstruct", line 2, in \?
""")
test.write('SConstruct', "")
-test.run(arguments = '--write-filenames=FILE',
+test.run(arguments = '--write-filenames=FILE .',
stderr = "Warning: the --write-filenames option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-b',
+test.run(arguments = '-b .',
stderr = "Warning: ignoring -b option\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-e',
+test.run(arguments = '-e .',
stderr = "Warning: the -e option is not yet implemented\n")
-test.run(arguments = '--environment-overrides',
+test.run(arguments = '--environment-overrides .',
stderr = "Warning: the --environment-overrides option is not yet implemented\n")
test.pass_test()
wpath = test.workpath()
-test.run(arguments = '-f SConscript',
- stdout = "SConscript %s\n" % wpath)
+test.run(arguments = '-f SConscript .',
+ stdout = 'SConscript %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '-f ' + subdir_BuildThis,
- stdout = "subdir/BuildThis %s\n" % wpath)
-test.run(arguments = '--file=SConscript',
- stdout = "SConscript %s\n" % wpath)
+test.run(arguments = '-f %s .' % subdir_BuildThis,
+ stdout = 'subdir/BuildThis %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '--file=' + subdir_BuildThis,
- stdout = "subdir/BuildThis %s\n" % wpath)
+test.run(arguments = '--file=SConscript .',
+ stdout = 'SConscript %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '--makefile=SConscript',
- stdout = "SConscript %s\n" % wpath)
+test.run(arguments = '--file=%s .' % subdir_BuildThis,
+ stdout = 'subdir/BuildThis %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '--makefile=' + subdir_BuildThis,
- stdout = "subdir/BuildThis %s\n" % wpath)
+test.run(arguments = '--makefile=SConscript .',
+ stdout = 'SConscript %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '--sconstruct=SConscript',
- stdout = "SConscript %s\n" % wpath)
+test.run(arguments = '--makefile=%s .' % subdir_BuildThis,
+ stdout = 'subdir/BuildThis %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '--sconstruct=' + subdir_BuildThis,
- stdout = "subdir/BuildThis %s\n" % wpath)
+test.run(arguments = '--sconstruct=SConscript .',
+ stdout = 'SConscript %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '-f -', stdin = """
+test.run(arguments = '--sconstruct=%s .' % subdir_BuildThis,
+ stdout = 'subdir/BuildThis %s\nscons: "." is up to date.\n' % wpath)
+
+test.run(arguments = '-f - .', stdin = """
import os
print "STDIN " + os.getcwd()
""",
- stdout = "STDIN %s\n" % wpath)
+ stdout = 'STDIN %s\nscons: "." is up to date.\n' % wpath)
-test.run(arguments = '-f no_such_file',
- stdout = "",
+test.run(arguments = '-f no_such_file .',
+ stdout = 'scons: "." is up to date.\n',
stderr = "Ignoring missing SConscript 'no_such_file'\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-l 1',
+test.run(arguments = '-l 1 .',
stderr = "Warning: the -l option is not yet implemented\n")
-test.run(arguments = '--load-average=1',
+test.run(arguments = '--load-average=1 .',
stderr = "Warning: the --load-average option is not yet implemented\n")
-test.run(arguments = '--max-load=1',
+test.run(arguments = '--max-load=1 .',
stderr = "Warning: the --max-load option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-m',
+test.run(arguments = '-m .',
stderr = "Warning: ignoring -m option\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-o foo',
+test.run(arguments = '-o foo .',
stderr = "Warning: the -o option is not yet implemented\n")
-test.run(arguments = '--old-file=foo',
+test.run(arguments = '--old-file=foo .',
stderr = "Warning: the --old-file option is not yet implemented\n")
-test.run(arguments = '--assume-old=foo',
+test.run(arguments = '--assume-old=foo .',
stderr = "Warning: the --assume-old option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-p',
+test.run(arguments = '-p .',
stderr = "Warning: the -p option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-r',
+test.run(arguments = '-r .',
stderr = "Warning: the -r option is not yet implemented\n")
-test.run(arguments = '--no-builtin-rules',
+test.run(arguments = '--no-builtin-rules .',
stderr = "Warning: the --no-builtin-rules option is not yet implemented\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-t',
+test.run(arguments = '-t .',
stderr = "Warning: ignoring -t option\n")
-test.run(arguments = '--touch',
+test.run(arguments = '--touch .',
stderr = "Warning: ignoring --touch option\n")
test.pass_test()
test.write('SConstruct', "")
-test.run(arguments = '-w',
+test.run(arguments = '-w .',
stderr = "Warning: the -w option is not yet implemented\n")
-test.run(arguments = '--print-directory',
+test.run(arguments = '--print-directory .',
stderr = "Warning: the --print-directory option is not yet implemented\n")
test.pass_test()