summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-04-30 05:39:46 (GMT)
committerSteven Knight <knight@baldmt.com>2008-04-30 05:39:46 (GMT)
commit889dc735eb173180dd92b0263bf5dbe697129881 (patch)
treef3178f3f085f178e22d840046acc862e23422870 /test
parentd9cca1c6bba7446bc13d90daa949fce4b364da7f (diff)
downloadSCons-889dc735eb173180dd92b0263bf5dbe697129881.zip
SCons-889dc735eb173180dd92b0263bf5dbe697129881.tar.gz
SCons-889dc735eb173180dd92b0263bf5dbe697129881.tar.bz2
Merged revisions 2898-2901,2903-2927 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r2903 | stevenknight | 2008-04-22 08:23:52 -0700 (Tue, 22 Apr 2008) | 3 lines Issue 2019: don't blow up when a "dictionary" source_scanner doesn't have a more-specific scanner entry for a specified source file's suffix. ........ r2904 | stevenknight | 2008-04-23 11:13:19 -0700 (Wed, 23 Apr 2008) | 3 lines Fix regression in use of $CXXFLAGS by the default $SHCXXFLAGS setting. (Greg Noel) ........ r2905 | stevenknight | 2008-04-23 11:23:12 -0700 (Wed, 23 Apr 2008) | 3 lines Update the test/CXX/SHCXXFLAGS.py with some more modern idioms copied from test/CXX/CXXFLAGS.py. ........ r2921 | belley | 2008-04-28 08:52:13 -0700 (Mon, 28 Apr 2008) | 98 lines Candidate list must be flushed when stopping the taskmaster. ============================================================ The taskmaster's candidate list must be flushed when the taskmaster is stopped, either because of a build error or a keyboard interrupt. This involves failing each candidates along with their waiting parents. This is necessary because the waiting parents might be in the pending_children set() that is used by the taskmaster to determine if cycles exist in the dependency graph. Failure to do so leads to confusing error messages such as: scons: *** Found dependency cycle(s): Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/DynamicProperty.h (<SCons.Node.FS.File instance at 0x95d230c>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Fault/NotSupported.h (<SCons.Node.FS.File instance at 0x960634c>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Fault/InvalidRequest.h (<SCons.Node.FS.File instance at 0x95d2bac>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Fault/RequestCanceled.h (<SCons.Node.FS.File instance at 0x960648c>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Fault/InvalidType.h (<SCons.Node.FS.File instance at 0x95d2cec>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Core/InvalidProperty.h (<SCons.Node.FS.File instance at 0x9606d2c>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Fault/SecurityError.h (<SCons.Node.FS.File instance at 0x96065cc>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Core/PropertyCollector.h (<SCons.Node.FS.File instance at 0x9606e6c>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/Fault/InvalidArgument.h (<SCons.Node.FS.File instance at 0x95d2a6c>) Internal Error: no cycle found for node /bld/vmkernel-main/scons/build/vmodl/obj/generic/Vmodl/Vmomi/DynamicData.h (<SCons.Node.FS.File instance at 0x95d21cc>) Changes made: Job.py: ------ o Implemented an InterruptState object that allows the sharing of the interrupt state between the Jobs, the Serial/Parallel and the Worker thread object. This allows for somewhat faster interruption when Ctrl-C is pressed because the Worker thread will not start any new task, i.e. the ones siting in the request queue. Taskmaster.py: -------------- o Moved the code contained the function Task.fail_continue() to the function Taskmaster.will_not_build(). This function perform the clean-up for nodes that will never be built. This includes failing these nodes along with their waiting parents and removing them from the list of pending children. o Improved the taskmaster tracing so that the pending children ref counts of nodes is also printed. o When stopping the taskmaster, no_next_candidate() now calls will_not_build() repetitively to make sure that all candidate nodes that will never be build are properly cleaned-up. test/Parallel/multiple-parents.py --------------------------------- Improved the test to also exercise the following functionality: o Nodes with multiple targets (not just aliases as it was before). o SideEffect() o Interrupting the build. Submitted against changeset 2920. All tests pass with both Python 2.5.1 and 1.5.2 Benoit ........ r2922 | stevenknight | 2008-04-28 11:50:10 -0700 (Mon, 28 Apr 2008) | 26 lines Issue 2024: http://scons.tigris.org/issues/show_bug.cgi?id=2024 Some public packages were importing specific SCons.Options.*Option submodules directly, instead of using the SCons.Options package itself (which actually exposed all the SCons.Options.*Option variable names directly, but what they hey). Our scripts didn't test for direct importing of the submodules, so this broke when I implemented backwards comptability with a SCons/Options.py module, instead of a full SCons/Options/*.py package. This restores the SCons/Options/*.py package files with stub modules that provide backwards compatibility (by referring to the new SCons.Variables functions and classes) and allow for importing all of The test/Deprecated/Options/*Option.py scripts have had specific submodule imports added. To make sure this corresponding "feature" continues to work in the future, I'll be following this with another checkin that adds submodule imports for the SCons.Variables.*Variable modules. I ran this with the SCons/Options.py file in place, and also with a compiled SCons/Options.pyc file in place, to try to make sure it works regardless. We've seen issues on Debian where their packaging doesn't clean up old *.pyc files when a Python *.py module is removed. It looks like this should work regardless of whether the Options.pyc file is there or not. ........ r2923 | stevenknight | 2008-04-28 11:52:52 -0700 (Mon, 28 Apr 2008) | 3 lines Update the test/Variables/*Variable.py scripts to verify that importing SCons.Variables.*Variable submodules continues to work in the future. ........ r2924 | belley | 2008-04-28 14:06:54 -0700 (Mon, 28 Apr 2008) | 6 lines Fixed a test that my morning change broke. The taskmaster tracing now includes the pending children ref count. Benoit ........ r2925 | stevenknight | 2008-04-28 18:00:25 -0700 (Mon, 28 Apr 2008) | 4 lines Issue 2028: Make sure already-existing Entry Nodes that we find are converted to Dir Nodes when searching a *PATH list for implicit dependencies. ........ r2926 | stevenknight | 2008-04-29 08:11:40 -0700 (Tue, 29 Apr 2008) | 3 lines Issue 2034: Fix $FORTRANMODDIR values like ${TARGET.dir} in the default $_FORTANMODFLAG expansion. (Stefano) ........ r2927 | stevenknight | 2008-04-29 11:34:02 -0700 (Tue, 29 Apr 2008) | 3 lines Restore the SCons.Options package (maintains backwards compatibility of importing submodules) to setup.py. ........
Diffstat (limited to 'test')
-rw-r--r--test/CXX/CXXFLAGS.py165
-rw-r--r--test/CXX/SHCXXFLAGS.py40
-rw-r--r--test/Deprecated/Options/BoolOption.py7
-rw-r--r--test/Deprecated/Options/EnumOption.py15
-rw-r--r--test/Deprecated/Options/ListOption.py17
-rw-r--r--test/Deprecated/Options/PackageOption.py6
-rw-r--r--test/Deprecated/Options/PathOption.py7
-rw-r--r--test/Fortran/FORTRANMODDIR.py12
-rw-r--r--test/Interactive/taskmastertrace.py17
-rw-r--r--test/Parallel/multiple-parents.py89
-rw-r--r--test/Scanner/Entry-to-Dir.py59
-rw-r--r--test/Scanner/source_scanner-dict.py218
-rw-r--r--test/Variables/BoolVariable.py7
-rw-r--r--test/Variables/EnumVariable.py15
-rw-r--r--test/Variables/ListVariable.py17
-rw-r--r--test/Variables/PackageVariable.py6
-rw-r--r--test/Variables/PathVariable.py7
-rw-r--r--test/option/taskmastertrace.py92
18 files changed, 683 insertions, 113 deletions
diff --git a/test/CXX/CXXFLAGS.py b/test/CXX/CXXFLAGS.py
new file mode 100644
index 0000000..86f14f0
--- /dev/null
+++ b/test/CXX/CXXFLAGS.py
@@ -0,0 +1,165 @@
+#!/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__"
+
+"""
+Verify that $CXXFLAGS settings are used to build both static
+and shared object files.
+"""
+
+import os
+import string
+import sys
+
+import TestSCons
+
+_obj = TestSCons._obj
+
+if os.name == 'posix':
+ os.environ['LD_LIBRARY_PATH'] = '.'
+if string.find(sys.platform, 'irix') > -1:
+ os.environ['LD_LIBRARYN32_PATH'] = '.'
+
+test = TestSCons.TestSCons()
+
+e = test.Environment()
+
+test.write('SConstruct', """
+foo = Environment(WINDOWS_INSERT_DEF=1)
+foo.Append(CXXFLAGS = '-DFOO')
+bar = Environment(WINDOWS_INSERT_DEF=1)
+bar.Append(CXXFLAGS = '-DBAR')
+foo_obj = foo.SharedObject(target = 'fooshared%(_obj)s', source = 'doIt.cpp')
+bar_obj = bar.SharedObject(target = 'barshared%(_obj)s', source = 'doIt.cpp')
+foo.SharedLibrary(target = 'foo', source = foo_obj)
+bar.SharedLibrary(target = 'bar', source = bar_obj)
+
+fooMain = foo.Clone(LIBS='foo', LIBPATH='.')
+foo_obj = fooMain.Object(target='foomain', source='main.c')
+fooMain.Program(target='fooprog', source=foo_obj)
+
+barMain = bar.Clone(LIBS='bar', LIBPATH='.')
+bar_obj = barMain.Object(target='barmain', source='main.c')
+barMain.Program(target='barprog', source=bar_obj)
+
+foo_obj = foo.Object(target = 'foostatic', source = 'prog.cpp')
+bar_obj = bar.Object(target = 'barstatic', source = 'prog.cpp')
+foo.Program(target = 'foo', source = foo_obj)
+bar.Program(target = 'bar', source = bar_obj)
+""" % locals())
+
+test.write('foo.def', r"""
+LIBRARY "foo"
+DESCRIPTION "Foo Shared Library"
+
+EXPORTS
+ doIt
+""")
+
+test.write('bar.def', r"""
+LIBRARY "bar"
+DESCRIPTION "Bar Shared Library"
+
+EXPORTS
+ doIt
+""")
+
+test.write('doIt.cpp', r"""
+#include <stdio.h>
+
+extern "C" void
+doIt()
+{
+#ifdef FOO
+ printf("doIt.cpp: FOO\n");
+#endif
+#ifdef BAR
+ printf("doIt.cpp: BAR\n");
+#endif
+}
+""")
+
+test.write('main.c', r"""
+
+void doIt();
+
+int
+main(int argc, char* argv[])
+{
+ doIt();
+ return 0;
+}
+""")
+
+test.write('prog.cpp', r"""
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+#ifdef FOO
+ printf("prog.c: FOO\n");
+#endif
+#ifdef BAR
+ printf("prog.c: BAR\n");
+#endif
+ exit (0);
+}
+""")
+
+test.run(arguments = '.')
+
+test.run(program = test.workpath('fooprog'), stdout = "doIt.cpp: FOO\n")
+test.run(program = test.workpath('barprog'), stdout = "doIt.cpp: BAR\n")
+test.run(program = test.workpath('foo'), stdout = "prog.c: FOO\n")
+test.run(program = test.workpath('bar'), stdout = "prog.c: BAR\n")
+
+
+
+test.write('SConstruct', """
+bar = Environment(WINDOWS_INSERT_DEF=1)
+bar.Append(CXXFLAGS = '-DBAR')
+foo_obj = bar.SharedObject(target = 'foo%(_obj)s', source = 'doIt.cpp')
+bar_obj = bar.SharedObject(target = 'bar%(_obj)s', source = 'doIt.cpp')
+bar.SharedLibrary(target = 'foo', source = foo_obj)
+bar.SharedLibrary(target = 'bar', source = bar_obj)
+
+barMain = bar.Clone(LIBS='bar', LIBPATH='.')
+foo_obj = barMain.Object(target='foomain', source='main.c')
+bar_obj = barMain.Object(target='barmain', source='main.c')
+barMain.Program(target='barprog', source=foo_obj)
+barMain.Program(target='fooprog', source=bar_obj)
+""" % locals())
+
+test.run(arguments = '.')
+
+test.run(program = test.workpath('fooprog'), stdout = "doIt.cpp: BAR\n")
+test.run(program = test.workpath('barprog'), stdout = "doIt.cpp: BAR\n")
+
+
+
+test.pass_test()
diff --git a/test/CXX/SHCXXFLAGS.py b/test/CXX/SHCXXFLAGS.py
index bfe1a79..0ce2b15 100644
--- a/test/CXX/SHCXXFLAGS.py
+++ b/test/CXX/SHCXXFLAGS.py
@@ -24,10 +24,15 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import sys
-import TestSCons
+"""
+Verify that $SHCXXFLAGS settings are used to build shared object files.
+"""
+
import os
import string
+import sys
+
+import TestSCons
_obj = TestSCons._obj
@@ -39,16 +44,16 @@ if string.find(sys.platform, 'irix') > -1:
test = TestSCons.TestSCons()
e = test.Environment()
-fooflags = e['SHCXXFLAGS'] + ' -DFOO'
-barflags = e['SHCXXFLAGS'] + ' -DBAR'
test.write('SConstruct', """
-foo = Environment(SHCXXFLAGS = '%s', WINDOWS_INSERT_DEF=1)
-bar = Environment(SHCXXFLAGS = '%s', WINDOWS_INSERT_DEF=1)
-foo.SharedObject(target = 'foo%s', source = 'prog.cpp')
-bar.SharedObject(target = 'bar%s', source = 'prog.cpp')
-foo.SharedLibrary(target = 'foo', source = 'foo%s')
-bar.SharedLibrary(target = 'bar', source = 'bar%s')
+foo = Environment(WINDOWS_INSERT_DEF=1)
+foo.Append(SHCXXFLAGS = '-DFOO')
+bar = Environment(WINDOWS_INSERT_DEF=1)
+bar.Append(SHCXXFLAGS = '-DBAR')
+foo_obj = foo.SharedObject(target = 'foo%(_obj)s', source = 'prog.cpp')
+bar_obj = bar.SharedObject(target = 'bar%(_obj)s', source = 'prog.cpp')
+foo.SharedLibrary(target = 'foo', source = foo_obj)
+bar.SharedLibrary(target = 'bar', source = bar_obj)
fooMain = foo.Clone(LIBS='foo', LIBPATH='.')
foo_obj = fooMain.Object(target='foomain', source='main.c')
@@ -57,7 +62,7 @@ fooMain.Program(target='fooprog', source=foo_obj)
barMain = bar.Clone(LIBS='bar', LIBPATH='.')
bar_obj = barMain.Object(target='barmain', source='main.c')
barMain.Program(target='barprog', source=bar_obj)
-""" % (fooflags, barflags, _obj, _obj, _obj, _obj))
+""" % locals())
test.write('foo.def', r"""
LIBRARY "foo"
@@ -108,18 +113,19 @@ test.run(program = test.workpath('fooprog'), stdout = "prog.cpp: FOO\n")
test.run(program = test.workpath('barprog'), stdout = "prog.cpp: BAR\n")
test.write('SConstruct', """
-bar = Environment(SHCXXFLAGS = '%s', WINDOWS_INSERT_DEF=1)
-bar.SharedObject(target = 'foo%s', source = 'prog.cpp')
-bar.SharedObject(target = 'bar%s', source = 'prog.cpp')
-bar.SharedLibrary(target = 'foo', source = 'foo%s')
-bar.SharedLibrary(target = 'bar', source = 'bar%s')
+bar = Environment(WINDOWS_INSERT_DEF=1)
+bar.Append(SHCXXFLAGS = '-DBAR')
+foo_obj = bar.SharedObject(target = 'foo%(_obj)s', source = 'prog.cpp')
+bar_obj = bar.SharedObject(target = 'bar%(_obj)s', source = 'prog.cpp')
+bar.SharedLibrary(target = 'foo', source = foo_obj)
+bar.SharedLibrary(target = 'bar', source = bar_obj)
barMain = bar.Clone(LIBS='bar', LIBPATH='.')
foo_obj = barMain.Object(target='foomain', source='main.c')
bar_obj = barMain.Object(target='barmain', source='main.c')
barMain.Program(target='barprog', source=foo_obj)
barMain.Program(target='fooprog', source=bar_obj)
-""" % (barflags, _obj, _obj, _obj, _obj))
+""" % locals())
test.run(arguments = '.')
diff --git a/test/Deprecated/Options/BoolOption.py b/test/Deprecated/Options/BoolOption.py
index 38b30d5..d45ad1b 100644
--- a/test/Deprecated/Options/BoolOption.py
+++ b/test/Deprecated/Options/BoolOption.py
@@ -50,12 +50,15 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Options.BoolOption import BoolOption
+BO = BoolOption
+
from SCons.Options import BoolOption
opts = Options(args=ARGUMENTS)
opts.AddOptions(
BoolOption('warnings', 'compilation with -Wall and similiar', 1),
- BoolOption('profile', 'create profiling informations', 0),
+ BO('profile', 'create profiling informations', 0),
)
env = Environment(options=opts)
@@ -78,7 +81,7 @@ check([str(False), str(True)])
expect_stderr = """
scons: *** Error converting option: warnings
Invalid value for boolean option: irgendwas
-""" + test.python_file_line(SConstruct_path, 9)
+""" + test.python_file_line(SConstruct_path, 12)
test.run(arguments='warnings=irgendwas', stderr = expect_stderr, status=2)
diff --git a/test/Deprecated/Options/EnumOption.py b/test/Deprecated/Options/EnumOption.py
index 610a485..29724f3 100644
--- a/test/Deprecated/Options/EnumOption.py
+++ b/test/Deprecated/Options/EnumOption.py
@@ -44,6 +44,9 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Options.EnumOption import EnumOption
+EO = EnumOption
+
from SCons.Options import EnumOption
list_of_libs = Split('x11 gl qt ical')
@@ -56,9 +59,9 @@ opts.AddOptions(
EnumOption('guilib', 'gui lib to use', 'gtk',
allowed_values=('motif', 'gtk', 'kde'),
map={}, ignorecase=1), # case insensitive
- EnumOption('some', 'some option', 'xaver',
- allowed_values=('xaver', 'eins'),
- map={}, ignorecase=2), # make lowercase
+ EO('some', 'some option', 'xaver',
+ allowed_values=('xaver', 'eins'),
+ map={}, ignorecase=2), # make lowercase
)
env = Environment(options=opts)
@@ -82,19 +85,19 @@ check(['full', 'KdE', 'eins'])
expect_stderr = """
scons: *** Invalid value for option debug: FULL
-""" + test.python_file_line(SConstruct_path, 18)
+""" + test.python_file_line(SConstruct_path, 21)
test.run(arguments='debug=FULL', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Invalid value for option guilib: irgendwas
-""" + test.python_file_line(SConstruct_path, 18)
+""" + test.python_file_line(SConstruct_path, 21)
test.run(arguments='guilib=IrGeNdwas', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Invalid value for option some: irgendwas
-""" + test.python_file_line(SConstruct_path, 18)
+""" + test.python_file_line(SConstruct_path, 21)
test.run(arguments='some=IrGeNdwas', stderr=expect_stderr, status=2)
diff --git a/test/Deprecated/Options/ListOption.py b/test/Deprecated/Options/ListOption.py
index 1ce20a2..7e7b18f 100644
--- a/test/Deprecated/Options/ListOption.py
+++ b/test/Deprecated/Options/ListOption.py
@@ -47,6 +47,9 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Options.ListOption import ListOption
+LO = ListOption
+
from SCons.Options import ListOption
list_of_libs = Split('x11 gl qt ical')
@@ -59,6 +62,7 @@ opts.AddOptions(
'all',
names = list_of_libs,
map = {'GL':'gl', 'QT':'qt'}),
+ LO('listvariable', 'listvariable help', 'all', names=['l1', 'l2', 'l3'])
)
env = Environment(options=opts)
@@ -81,7 +85,8 @@ test.run()
check(['all', '1', 'gl ical qt x11', 'gl ical qt x11',
"['gl ical qt x11']"])
-test.must_match(test.workpath('scons.options'), "shared = 'all'"+os.linesep)
+expect = "shared = 'all'"+os.linesep+"listvariable = 'all'"+os.linesep
+test.must_match(test.workpath('scons.options'), expect)
check(['all', '1', 'gl ical qt x11', 'gl ical qt x11',
"['gl ical qt x11']"])
@@ -110,7 +115,7 @@ check(['gl,qt', '0', 'gl qt', 'gl qt', "['gl qt']"])
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=foo', stderr=expect_stderr, status=2)
@@ -119,28 +124,28 @@ test.run(arguments='shared=foo', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=foo,ical', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=ical,foo', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=ical,foo,x11', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo,bar
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=foo,x11,,,bar', stderr=expect_stderr, status=2)
diff --git a/test/Deprecated/Options/PackageOption.py b/test/Deprecated/Options/PackageOption.py
index 79d4dda..b7dbc71 100644
--- a/test/Deprecated/Options/PackageOption.py
+++ b/test/Deprecated/Options/PackageOption.py
@@ -50,6 +50,9 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Options.PackageOption import PackageOption
+PO = PackageOption
+
from SCons.Options import PackageOption
opts = Options(args=ARGUMENTS)
@@ -57,6 +60,7 @@ opts.AddOptions(
PackageOption('x11',
'use X11 installed here (yes = search some places',
'yes'),
+ PO('package', 'help for package', 'yes'),
)
env = Environment(options=opts)
@@ -80,7 +84,7 @@ check([test.workpath()])
expect_stderr = """
scons: *** Path does not exist for option x11: /non/existing/path/
-""" + test.python_file_line(SConstruct_path, 10)
+""" + test.python_file_line(SConstruct_path, 14)
test.run(arguments='x11=/non/existing/path/', stderr=expect_stderr, status=2)
diff --git a/test/Deprecated/Options/PathOption.py b/test/Deprecated/Options/PathOption.py
index 23fec6e..3fa7e81 100644
--- a/test/Deprecated/Options/PathOption.py
+++ b/test/Deprecated/Options/PathOption.py
@@ -49,6 +49,9 @@ workpath = test.workpath()
libpath = os.path.join(workpath, 'lib')
test.write(SConstruct_path, """\
+from SCons.Options.PathOption import PathOption
+PO = PathOption
+
from SCons.Options import PathOption
qtdir = r'%s'
@@ -56,7 +59,7 @@ qtdir = r'%s'
opts = Options(args=ARGUMENTS)
opts.AddOptions(
PathOption('qtdir', 'where the root of Qt is installed', qtdir),
- PathOption('qt_libraries', 'where the Qt library is installed', r'%s'),
+ PO('qt_libraries', 'where the Qt library is installed', r'%s'),
)
env = Environment(options=opts)
@@ -90,7 +93,7 @@ test.run(arguments=['qtdir=%s' % qtpath, 'qt_libraries=%s' % libpath])
check([qtpath, libpath, libpath])
qtpath = os.path.join(workpath, 'non', 'existing', 'path')
-SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 11)[:-1]
+SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 14)[:-1]
expect_stderr = """
scons: *** Path for option qtdir does not exist: %(qtpath)s
diff --git a/test/Fortran/FORTRANMODDIR.py b/test/Fortran/FORTRANMODDIR.py
index a81439a..c0e158d 100644
--- a/test/Fortran/FORTRANMODDIR.py
+++ b/test/Fortran/FORTRANMODDIR.py
@@ -54,7 +54,10 @@ test.write('SConstruct', """
env = Environment(FORTRANCOM = r'%(_python_)s myfortran.py $FORTRANMODDIR $SOURCE $TARGET',
FORTRANMODDIR = 'modules')
env.Object(target = 'test1.obj', source = 'test1.f')
-env.Object(target = 'sub/test2.obj', source = 'test1.f',
+env.Object(target = 'sub2/test2.obj', source = 'test1.f',
+ FORTRANMODDIR='${TARGET.dir}')
+env.Object(target = 'sub3/test3.obj', source = 'test1.f',
+ FORTRANCOM = r'%(_python_)s myfortran.py $_FORTRANMODFLAG $SOURCE $TARGET',
FORTRANMODDIR='${TARGET.dir}')
""" % locals())
@@ -88,8 +91,11 @@ test.must_match('test1.obj', "myfortran.py wrote test1.obj\n")
test.must_match(['modules', 'mod_foo.mod'], "myfortran.py wrote mod_foo.mod\n")
test.must_not_exist(['modules', 'mod_bar.mod'])
-test.must_match(['sub', 'test2.obj'], "myfortran.py wrote test2.obj\n")
-test.must_match(['sub', 'mod_foo.mod'], "myfortran.py wrote mod_foo.mod\n")
+test.must_match(['sub2', 'test2.obj'], "myfortran.py wrote test2.obj\n")
+test.must_match(['sub2', 'mod_foo.mod'], "myfortran.py wrote mod_foo.mod\n")
+
+test.must_match(['sub3', 'test3.obj'], "myfortran.py wrote test3.obj\n")
+test.must_match(['sub3', 'mod_foo.mod'], "myfortran.py wrote mod_foo.mod\n")
test.up_to_date(arguments = '.')
diff --git a/test/Interactive/taskmastertrace.py b/test/Interactive/taskmastertrace.py
index f0ff81f..e78bdfa 100644
--- a/test/Interactive/taskmastertrace.py
+++ b/test/Interactive/taskmastertrace.py
@@ -56,6 +56,8 @@ test.write('foo.in', "foo.in 2\n")
scons.send("build --taskmastertrace=- foo.out\n")
+test.wait_for(test.workpath('foo.out'))
+
scons.send("build 2\n")
test.wait_for(test.workpath('2'))
@@ -71,15 +73,16 @@ scons>>> Copy("foo.out", "foo.in")
Touch("1")
scons>>>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state 'foo.out'> and its children:
-Taskmaster: <no_state 'foo.in'>
-Taskmaster: Considering node <no_state 'foo.in'> and its children:
-Taskmaster: Evaluating <pending 'foo.in'>
+Taskmaster: Considering node <no_state 0 'foo.out'> and its children:
+Taskmaster: <no_state 0 'foo.in'>
+Taskmaster: adjusting ref count: <pending 1 'foo.out'>
+Taskmaster: Considering node <no_state 0 'foo.in'> and its children:
+Taskmaster: Evaluating <pending 0 'foo.in'>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <pending 'foo.out'> and its children:
-Taskmaster: <up_to_date 'foo.in'>
-Taskmaster: Evaluating <pending 'foo.out'>
+Taskmaster: Considering node <pending 0 'foo.out'> and its children:
+Taskmaster: <up_to_date 0 'foo.in'>
+Taskmaster: Evaluating <pending 0 'foo.out'>
Copy("foo.out", "foo.in")
Taskmaster: Looking for a node to evaluate
diff --git a/test/Parallel/multiple-parents.py b/test/Parallel/multiple-parents.py
index f81adf5..d9c414f 100644
--- a/test/Parallel/multiple-parents.py
+++ b/test/Parallel/multiple-parents.py
@@ -50,34 +50,69 @@ test = TestSCons.TestSCons()
# c) Some targets succeed building
# d) Some children are ignored
# e) Some children are pre-requesites
-# f) Some sources are missing
+# f) Some children have side-effects
+# g) Some sources are missing
+# h) Builds that are interrupted
test.write('SConstruct', """
+opts = Options()
+opts.Add( BoolOption('interrupt', 'Interrupt the build.', 0 ) )
+optEnv = Environment(options=opts)
+
def fail_action(target = None, source = None, env = None):
return 2
+def simulate_keyboard_interrupt(target = None, source = None, env = None):
+ # Directly invoked the SIGINT handler to simulate a
+ # KeyboardInterrupt. This hack is necessary because there is no
+ # easy way to get access to the current Job/Taskmaster object.
+ import signal
+ handler = signal.getsignal(signal.SIGINT)
+ handler(signal.SIGINT, None)
+ return 0
+
+interrupt = Command(target='interrupt', source='', action=simulate_keyboard_interrupt)
+
+
failed0 = Command(target='failed00', source='', action=fail_action)
-ok0 = Command(target='ok00', source='', action=Touch('${TARGET}'))
+ok0 = Command(target=['ok00a', 'ok00b', 'ok00c'],
+ source='',
+ action=[Touch('${TARGETS[0]}'), Touch('${TARGETS[1]}'), Touch('${TARGETS[2]}')])
prereq0 = Command(target='prereq00', source='', action=Touch('${TARGET}'))
ignore0 = Command(target='ignore00', source='', action=Touch('${TARGET}'))
igreq0 = Command(target='igreq00', source='', action=Touch('${TARGET}'))
missing0 = Command(target='missing00', source='MissingSrc', action=Touch('${TARGET}'))
+withSE0 = Command(target=['withSE00a', 'withSE00b', 'withSE00c'],
+ source='',
+ action=[Touch('${TARGETS[0]}'), Touch('${TARGETS[1]}'), Touch('${TARGETS[2]}'),
+ Touch('side_effect')])
+SideEffect('side_effect', withSE0)
-prev_level = failed0 + ok0 + ignore0
+prev_level = failed0 + ok0 + ignore0 + missing0 + withSE0
prev_prereq = prereq0
prev_ignore = ignore0
prev_igreq = igreq0
+if optEnv['interrupt']:
+ prev_level = prev_level + interrupt
+
for i in range(1,20):
failed = Command(target='failed%02d' % i, source='', action=fail_action)
- ok = Command(target='ok%02d' % i, source='', action=Touch('${TARGET}'))
+ ok = Command(target=['ok%02da' % i, 'ok%02db' % i, 'ok%02dc' % i],
+ source='',
+ action=[Touch('${TARGETS[0]}'), Touch('${TARGETS[1]}'), Touch('${TARGETS[2]}')])
prereq = Command(target='prereq%02d' % i, source='', action=Touch('${TARGET}'))
ignore = Command(target='ignore%02d' % i, source='', action=Touch('${TARGET}'))
igreq = Command(target='igreq%02d' % i, source='', action=Touch('${TARGET}'))
missing = Command(target='missing%02d' %i, source='MissingSrc', action=Touch('${TARGET}'))
+ withSE = Command(target=['withSE%02da' % i, 'withSE%02db' % i, 'withSE%02dc' % i],
+ source='',
+ action=[Touch('${TARGETS[0]}'), Touch('${TARGETS[1]}'), Touch('${TARGETS[2]}'),
+ Touch('side_effect')])
+ SideEffect('side_effect', withSE)
- next_level = failed + ok + ignore + igreq + missing
+ next_level = failed + ok + ignore + igreq + missing + withSE
for j in range(1,10):
a = Alias('a%02d%02d' % (i,j), prev_level)
@@ -108,7 +143,8 @@ Default(all)
re_error = """\
(scons: \\*\\*\\* \\[failed\\d+] Error 2\\n)|\
-(scons: \\*\\*\\* Source `MissingSrc' not found, needed by target `missing\\d+'\\.( Stop\\.)?\\n)\
+(scons: \\*\\*\\* Source `MissingSrc' not found, needed by target `missing\\d+'\\.( Stop\\.)?\\n)|\
+(scons: \\*\\*\\* \\[\\w+] Build interrupted\.\\n)\
"""
re_errors = "(" + re_error + ")+"
@@ -116,7 +152,17 @@ re_errors = "(" + re_error + ")+"
test.run(arguments = 'all',
status = 2,
stderr = "scons: *** [failed19] Error 2\n")
-test.must_not_exist(test.workpath('ok'))
+test.must_not_exist(test.workpath('side_effect'))
+for i in range(20):
+ test.must_not_exist(test.workpath('ok%02da' % i))
+ test.must_not_exist(test.workpath('ok%02db' % i))
+ test.must_not_exist(test.workpath('ok%02dc' % i))
+ test.must_not_exist(test.workpath('prereq%02d' % i))
+ test.must_not_exist(test.workpath('ignore%02d' % i))
+ test.must_not_exist(test.workpath('igreq%02d' % i))
+ test.must_not_exist(test.workpath('withSE%02da' % i))
+ test.must_not_exist(test.workpath('withSE%02db' % i))
+ test.must_not_exist(test.workpath('withSE%02dc' % i))
for i in range(5):
@@ -135,11 +181,17 @@ for i in range(5):
status = 2,
stderr = re_errors,
match=TestSCons.match_re_dotall)
+ test.must_exist(test.workpath('side_effect'))
for i in range(20):
- test.must_exist(test.workpath('ok%02d' % i))
+ test.must_exist(test.workpath('ok%02da' % i))
+ test.must_exist(test.workpath('ok%02db' % i))
+ test.must_exist(test.workpath('ok%02dc' % i))
test.must_exist(test.workpath('prereq%02d' % i))
test.must_not_exist(test.workpath('ignore%02d' % i))
test.must_exist(test.workpath('igreq%02d' % i))
+ test.must_exist(test.workpath('withSE%02da' % i))
+ test.must_exist(test.workpath('withSE%02db' % i))
+ test.must_exist(test.workpath('withSE%02dc' % i))
for i in range(5):
@@ -147,7 +199,7 @@ for i in range(5):
status = 2,
stderr = re_errors,
match=TestSCons.match_re_dotall)
- test.must_not_exist(test.workpath('ok'))
+
for i in range(5):
test.run(arguments = '-c all')
@@ -157,6 +209,7 @@ for i in range(5):
stderr = re_errors,
match=TestSCons.match_re_dotall)
+
for i in range(5):
test.run(arguments = '-c all')
@@ -164,10 +217,26 @@ for i in range(5):
status = 2,
stderr = re_errors,
match=TestSCons.match_re_dotall)
+ test.must_exist(test.workpath('side_effect'))
for i in range(20):
- test.must_exist(test.workpath('ok%02d' % i))
+ test.must_exist(test.workpath('ok%02da' % i))
+ test.must_exist(test.workpath('ok%02db' % i))
+ test.must_exist(test.workpath('ok%02dc' % i))
test.must_exist(test.workpath('prereq%02d' % i))
test.must_not_exist(test.workpath('ignore%02d' % i))
test.must_exist(test.workpath('igreq%02d' % i))
+ test.must_exist(test.workpath('withSE%02da' % i))
+ test.must_exist(test.workpath('withSE%02db' % i))
+ test.must_exist(test.workpath('withSE%02dc' % i))
+
+
+for i in range(5):
+ test.run(arguments = '-c all')
+
+ test.run(arguments = '-j 8 -k --random interrupt=yes all',
+ status = 2,
+ stderr = re_errors,
+ match=TestSCons.match_re_dotall)
+
test.pass_test()
diff --git a/test/Scanner/Entry-to-Dir.py b/test/Scanner/Entry-to-Dir.py
new file mode 100644
index 0000000..0b5dbd7
--- /dev/null
+++ b/test/Scanner/Entry-to-Dir.py
@@ -0,0 +1,59 @@
+#!/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__"
+
+"""
+Verify that an implicit dependency search for a directory for which
+we have an Entry Node works as expected, converting the Entry into a
+Dir Node.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', """
+env = Environment()
+tc = env.Program('testcase', 'testcase.cpp')
+foo = env.Entry('foo')
+tc[0].all_children()[0].all_children()
+""")
+
+test.write('testcase.cpp', """\
+#if 0
+#include "foo/bar/widget.h"
+#endif
+int main(int argc, char *argv[])
+{
+ return 0;
+}
+""")
+
+test.run(arguments = '.')
+
+# In 0.98.2, re-running failed with a stack trace.
+test.run(arguments = '.')
+
+test.pass_test()
diff --git a/test/Scanner/source_scanner-dict.py b/test/Scanner/source_scanner-dict.py
new file mode 100644
index 0000000..1ac15a8
--- /dev/null
+++ b/test/Scanner/source_scanner-dict.py
@@ -0,0 +1,218 @@
+#!/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__"
+
+"""
+Verify that a source_scanner that uses a dictionary to select more
+specific scanners for source file suffixes works correctly, even
+when it's handed a file suffix that it doesn't know how to scan
+(i.e., for which it doesn't have a specific scanner in its dictionary).
+"""
+
+import TestSCons
+
+_python_ = TestSCons._python_
+
+test = TestSCons.TestSCons()
+
+test.write('build.py', r"""
+import sys
+output = open(sys.argv[1], 'wb')
+for infile in sys.argv[2:]:
+ input = open(infile, 'rb')
+
+ include_prefix = 'include%s ' % infile[-1]
+
+ def process(infp, outfp, include_prefix=include_prefix):
+ for line in infp.readlines():
+ if line[:len(include_prefix)] == include_prefix:
+ file = line[len(include_prefix):-1]
+ process(open(file, 'rb'), outfp)
+ else:
+ outfp.write(line)
+
+ process(input, output)
+
+sys.exit(0)
+""")
+
+# Execute a subsidiary SConscript just to make sure we can
+# get at the Scanner keyword from there.
+
+test.write('SConstruct', """
+SConscript('SConscript')
+""")
+
+test.write('SConscript', """
+import re
+
+include1_re = re.compile(r'^include1\s+(\S+)$', re.M)
+include2_re = re.compile(r'^include2\s+(\S+)$', re.M)
+include3_re = re.compile(r'^include3\s+(\S+)$', re.M)
+
+def k1_scan(node, env, scanpaths, arg=None):
+ contents = node.get_contents()
+ includes = include1_re.findall(contents)
+ return includes
+
+def k2_scan(node, env, scanpaths, arg=None):
+ contents = node.get_contents()
+ includes = include2_re.findall(contents)
+ return includes
+
+def k3_scan(node, env, scanpaths, arg=None):
+ contents = node.get_contents()
+ includes = include3_re.findall(contents)
+ return includes
+
+kscanner = Scanner({'.k1' : Scanner(k1_scan), '.k2': Scanner(k2_scan)})
+
+b = Builder(action=r'%(_python_)s build.py $TARGET $SOURCES',
+ source_scanner=kscanner)
+env = Environment(BUILDERS={'Build':b})
+
+kscanner.add_scanner('.k3', Scanner(k3_scan))
+
+env.Build('aaa', 'aaa.k1')
+env.Build('bbb', 'bbb.k2')
+env.Build('ccc', 'ccc.k3')
+env.Build('ddd', ['ddd.k4', 'aaa.k1', 'bbb.k2', 'ccc.k3'])
+""" % locals())
+
+test.write('aaa.k1',
+"""aaa.k1 1
+line 2
+include1 xxx
+include2 yyy
+include3 zzz
+line 6
+""")
+
+test.write('bbb.k2',
+"""bbb.k2 1
+line 2
+include1 xxx
+include2 yyy
+include3 zzz
+line 6
+""")
+
+test.write('ccc.k3',
+"""ccc.k3 1
+line 2
+include1 xxx
+include2 yyy
+include3 zzz
+line 6
+""")
+
+test.write('ddd.k4',
+"""ddd.k4 1
+line 2
+line 3
+""")
+
+test.write('xxx', "xxx 1\n")
+test.write('yyy', "yyy 1\n")
+test.write('zzz', "zzz 1\n")
+
+
+
+
+expect = test.wrap_stdout("""\
+%(_python_)s build.py aaa aaa.k1
+%(_python_)s build.py bbb bbb.k2
+%(_python_)s build.py ccc ccc.k3
+%(_python_)s build.py ddd ddd.k4 aaa.k1 bbb.k2 ccc.k3
+""" % locals())
+
+test.run(stdout=expect)
+
+expect_aaa = 'aaa.k1 1\nline 2\nxxx 1\ninclude2 yyy\ninclude3 zzz\nline 6\n'
+expect_bbb = 'bbb.k2 1\nline 2\ninclude1 xxx\nyyy 1\ninclude3 zzz\nline 6\n'
+expect_ccc = 'ccc.k3 1\nline 2\ninclude1 xxx\ninclude2 yyy\nzzz 1\nline 6\n'
+expect_ddd = 'ddd.k4 1\nline 2\nline 3\n' + expect_aaa + expect_bbb + expect_ccc
+
+test.must_match('aaa', expect_aaa)
+test.must_match('bbb', expect_bbb)
+test.must_match('ccc', expect_ccc)
+test.must_match('ddd', expect_ddd)
+
+test.up_to_date(arguments = '.')
+
+
+
+test.write('zzz', "zzz 2\n")
+
+expect = test.wrap_stdout("""\
+%(_python_)s build.py ccc ccc.k3
+%(_python_)s build.py ddd ddd.k4 aaa.k1 bbb.k2 ccc.k3
+""" % locals())
+
+test.run(stdout=expect)
+
+expect_ccc = 'ccc.k3 1\nline 2\ninclude1 xxx\ninclude2 yyy\nzzz 2\nline 6\n'
+expect_ddd = 'ddd.k4 1\nline 2\nline 3\n' + expect_aaa + expect_bbb + expect_ccc
+
+test.must_match('bbb', expect_bbb)
+test.must_match('ddd', expect_ddd)
+
+
+
+test.write('yyy', "yyy 2\n")
+
+expect = test.wrap_stdout("""\
+%(_python_)s build.py bbb bbb.k2
+%(_python_)s build.py ddd ddd.k4 aaa.k1 bbb.k2 ccc.k3
+""" % locals())
+
+test.run(stdout=expect)
+
+expect_bbb = 'bbb.k2 1\nline 2\ninclude1 xxx\nyyy 2\ninclude3 zzz\nline 6\n'
+expect_ddd = 'ddd.k4 1\nline 2\nline 3\n' + expect_aaa + expect_bbb + expect_ccc
+
+test.must_match('bbb', expect_bbb)
+test.must_match('ddd', expect_ddd)
+
+
+
+test.write('xxx', "xxx 2\n")
+
+expect = test.wrap_stdout("""\
+%(_python_)s build.py aaa aaa.k1
+%(_python_)s build.py ddd ddd.k4 aaa.k1 bbb.k2 ccc.k3
+""" % locals())
+
+test.run(stdout=expect)
+
+expect_aaa = 'aaa.k1 1\nline 2\nxxx 2\ninclude2 yyy\ninclude3 zzz\nline 6\n'
+expect_ddd = 'ddd.k4 1\nline 2\nline 3\n' + expect_aaa + expect_bbb + expect_ccc
+
+test.must_match('aaa', expect_aaa)
+test.must_match('ddd', expect_ddd)
+
+
+
+test.pass_test()
diff --git a/test/Variables/BoolVariable.py b/test/Variables/BoolVariable.py
index 1bda19b..2ebe707 100644
--- a/test/Variables/BoolVariable.py
+++ b/test/Variables/BoolVariable.py
@@ -50,12 +50,15 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Variables.BoolVariable import BoolVariable
+BV = BoolVariable
+
from SCons.Variables import BoolVariable
opts = Variables(args=ARGUMENTS)
opts.AddVariables(
BoolVariable('warnings', 'compilation with -Wall and similiar', 1),
- BoolVariable('profile', 'create profiling informations', 0),
+ BV('profile', 'create profiling informations', 0),
)
env = Environment(variables=opts)
@@ -78,7 +81,7 @@ check([str(False), str(True)])
expect_stderr = """
scons: *** Error converting option: warnings
Invalid value for boolean option: irgendwas
-""" + test.python_file_line(SConstruct_path, 9)
+""" + test.python_file_line(SConstruct_path, 12)
test.run(arguments='warnings=irgendwas', stderr = expect_stderr, status=2)
diff --git a/test/Variables/EnumVariable.py b/test/Variables/EnumVariable.py
index 6966509..4d09587 100644
--- a/test/Variables/EnumVariable.py
+++ b/test/Variables/EnumVariable.py
@@ -44,6 +44,9 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Variables.EnumVariable import EnumVariable
+EV = EnumVariable
+
from SCons.Variables import EnumVariable
list_of_libs = Split('x11 gl qt ical')
@@ -56,9 +59,9 @@ opts.AddVariables(
EnumVariable('guilib', 'gui lib to use', 'gtk',
allowed_values=('motif', 'gtk', 'kde'),
map={}, ignorecase=1), # case insensitive
- EnumVariable('some', 'some option', 'xaver',
- allowed_values=('xaver', 'eins'),
- map={}, ignorecase=2), # make lowercase
+ EV('some', 'some option', 'xaver',
+ allowed_values=('xaver', 'eins'),
+ map={}, ignorecase=2), # make lowercase
)
env = Environment(variables=opts)
@@ -82,19 +85,19 @@ check(['full', 'KdE', 'eins'])
expect_stderr = """
scons: *** Invalid value for option debug: FULL
-""" + test.python_file_line(SConstruct_path, 18)
+""" + test.python_file_line(SConstruct_path, 21)
test.run(arguments='debug=FULL', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Invalid value for option guilib: irgendwas
-""" + test.python_file_line(SConstruct_path, 18)
+""" + test.python_file_line(SConstruct_path, 21)
test.run(arguments='guilib=IrGeNdwas', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Invalid value for option some: irgendwas
-""" + test.python_file_line(SConstruct_path, 18)
+""" + test.python_file_line(SConstruct_path, 21)
test.run(arguments='some=IrGeNdwas', stderr=expect_stderr, status=2)
diff --git a/test/Variables/ListVariable.py b/test/Variables/ListVariable.py
index 90d80ed..740698b 100644
--- a/test/Variables/ListVariable.py
+++ b/test/Variables/ListVariable.py
@@ -46,6 +46,9 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Variables.ListVariable import ListVariable
+LV = ListVariable
+
from SCons.Variables import ListVariable
list_of_libs = Split('x11 gl qt ical')
@@ -58,6 +61,7 @@ opts.AddVariables(
'all',
names = list_of_libs,
map = {'GL':'gl', 'QT':'qt'}),
+ LV('listvariable', 'listvariable help', 'all', names=['l1', 'l2', 'l3'])
)
env = Environment(variables=opts)
@@ -80,7 +84,8 @@ test.run()
check(['all', '1', 'gl ical qt x11', 'gl ical qt x11',
"['gl ical qt x11']"])
-test.must_match(test.workpath('scons.variables'), "shared = 'all'"+os.linesep)
+expect = "shared = 'all'"+os.linesep+"listvariable = 'all'"+os.linesep
+test.must_match(test.workpath('scons.variables'), expect)
check(['all', '1', 'gl ical qt x11', 'gl ical qt x11',
"['gl ical qt x11']"])
@@ -109,7 +114,7 @@ check(['gl,qt', '0', 'gl qt', 'gl qt', "['gl qt']"])
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=foo', stderr=expect_stderr, status=2)
@@ -118,28 +123,28 @@ test.run(arguments='shared=foo', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=foo,ical', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=ical,foo', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=ical,foo,x11', stderr=expect_stderr, status=2)
expect_stderr = """
scons: *** Error converting option: shared
Invalid value(s) for option: foo,bar
-""" + test.python_file_line(SConstruct_path, 15)
+""" + test.python_file_line(SConstruct_path, 19)
test.run(arguments='shared=foo,x11,,,bar', stderr=expect_stderr, status=2)
diff --git a/test/Variables/PackageVariable.py b/test/Variables/PackageVariable.py
index 4d36252..4338449 100644
--- a/test/Variables/PackageVariable.py
+++ b/test/Variables/PackageVariable.py
@@ -50,6 +50,9 @@ def check(expect):
test.write(SConstruct_path, """\
+from SCons.Variables.PackageVariable import PackageVariable
+PV = PackageVariable
+
from SCons.Variables import PackageVariable
opts = Variables(args=ARGUMENTS)
@@ -57,6 +60,7 @@ opts.AddVariables(
PackageVariable('x11',
'use X11 installed here (yes = search some places',
'yes'),
+ PV('package', 'help for package', 'yes'),
)
env = Environment(variables=opts)
@@ -80,7 +84,7 @@ check([test.workpath()])
expect_stderr = """
scons: *** Path does not exist for option x11: /non/existing/path/
-""" + test.python_file_line(SConstruct_path, 10)
+""" + test.python_file_line(SConstruct_path, 14)
test.run(arguments='x11=/non/existing/path/', stderr=expect_stderr, status=2)
diff --git a/test/Variables/PathVariable.py b/test/Variables/PathVariable.py
index a2f96a7..96da82f 100644
--- a/test/Variables/PathVariable.py
+++ b/test/Variables/PathVariable.py
@@ -49,6 +49,9 @@ workpath = test.workpath()
libpath = os.path.join(workpath, 'lib')
test.write(SConstruct_path, """\
+from SCons.Variables.PathVariable import PathVariable
+PV = PathVariable
+
from SCons.Variables import PathVariable
qtdir = r'%s'
@@ -56,7 +59,7 @@ qtdir = r'%s'
opts = Variables(args=ARGUMENTS)
opts.AddVariables(
PathVariable('qtdir', 'where the root of Qt is installed', qtdir),
- PathVariable('qt_libraries', 'where the Qt library is installed', r'%s'),
+ PV('qt_libraries', 'where the Qt library is installed', r'%s'),
)
env = Environment(variables=opts)
@@ -90,7 +93,7 @@ test.run(arguments=['qtdir=%s' % qtpath, 'qt_libraries=%s' % libpath])
check([qtpath, libpath, libpath])
qtpath = os.path.join(workpath, 'non', 'existing', 'path')
-SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 11)[:-1]
+SConstruct_file_line = test.python_file_line(test.workpath('SConstruct'), 14)[:-1]
expect_stderr = """
scons: *** Path for option qtdir does not exist: %(qtpath)s
diff --git a/test/option/taskmastertrace.py b/test/option/taskmastertrace.py
index 30e15aa..a7d583e 100644
--- a/test/option/taskmastertrace.py
+++ b/test/option/taskmastertrace.py
@@ -48,37 +48,41 @@ test.write('Tfile.in', "Tfile.in\n")
expect_stdout = test.wrap_stdout("""\
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state '.'> and its children:
-Taskmaster: <no_state 'SConstruct'>
-Taskmaster: <no_state 'Tfile.in'>
-Taskmaster: <no_state 'Tfile.mid'>
-Taskmaster: <no_state 'Tfile.out'>
-Taskmaster: Considering node <no_state 'SConstruct'> and its children:
-Taskmaster: Evaluating <pending 'SConstruct'>
+Taskmaster: Considering node <no_state 0 '.'> and its children:
+Taskmaster: <no_state 0 'SConstruct'>
+Taskmaster: <no_state 0 'Tfile.in'>
+Taskmaster: <no_state 0 'Tfile.mid'>
+Taskmaster: <no_state 0 'Tfile.out'>
+Taskmaster: adjusting ref count: <pending 1 '.'>
+Taskmaster: adjusting ref count: <pending 2 '.'>
+Taskmaster: adjusting ref count: <pending 3 '.'>
+Taskmaster: adjusting ref count: <pending 4 '.'>
+Taskmaster: Considering node <no_state 0 'SConstruct'> and its children:
+Taskmaster: Evaluating <pending 0 'SConstruct'>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state 'Tfile.in'> and its children:
-Taskmaster: Evaluating <pending 'Tfile.in'>
+Taskmaster: Considering node <no_state 0 'Tfile.in'> and its children:
+Taskmaster: Evaluating <pending 0 'Tfile.in'>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state 'Tfile.mid'> and its children:
-Taskmaster: <up_to_date 'Tfile.in'>
-Taskmaster: Evaluating <pending 'Tfile.mid'>
+Taskmaster: Considering node <no_state 0 'Tfile.mid'> and its children:
+Taskmaster: <up_to_date 0 'Tfile.in'>
+Taskmaster: Evaluating <pending 0 'Tfile.mid'>
Copy("Tfile.mid", "Tfile.in")
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state 'Tfile.out'> and its children:
-Taskmaster: <executed 'Tfile.mid'>
-Taskmaster: Evaluating <pending 'Tfile.out'>
+Taskmaster: Considering node <no_state 0 'Tfile.out'> and its children:
+Taskmaster: <executed 0 'Tfile.mid'>
+Taskmaster: Evaluating <pending 0 'Tfile.out'>
Copy("Tfile.out", "Tfile.mid")
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <pending '.'> and its children:
-Taskmaster: <up_to_date 'SConstruct'>
-Taskmaster: <up_to_date 'Tfile.in'>
-Taskmaster: <executed 'Tfile.mid'>
-Taskmaster: <executed 'Tfile.out'>
-Taskmaster: Evaluating <pending '.'>
+Taskmaster: Considering node <pending 0 '.'> and its children:
+Taskmaster: <up_to_date 0 'SConstruct'>
+Taskmaster: <up_to_date 0 'Tfile.in'>
+Taskmaster: <executed 0 'Tfile.mid'>
+Taskmaster: <executed 0 'Tfile.out'>
+Taskmaster: Evaluating <pending 0 '.'>
Taskmaster: Looking for a node to evaluate
Taskmaster: No candidate anymore.
@@ -103,35 +107,39 @@ test.run(arguments='--taskmastertrace=trace.out .', stdout=expect_stdout)
expect_trace = """\
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state '.'> and its children:
-Taskmaster: <no_state 'SConstruct'>
-Taskmaster: <no_state 'Tfile.in'>
-Taskmaster: <no_state 'Tfile.mid'>
-Taskmaster: <no_state 'Tfile.out'>
-Taskmaster: Considering node <no_state 'SConstruct'> and its children:
-Taskmaster: Evaluating <pending 'SConstruct'>
+Taskmaster: Considering node <no_state 0 '.'> and its children:
+Taskmaster: <no_state 0 'SConstruct'>
+Taskmaster: <no_state 0 'Tfile.in'>
+Taskmaster: <no_state 0 'Tfile.mid'>
+Taskmaster: <no_state 0 'Tfile.out'>
+Taskmaster: adjusting ref count: <pending 1 '.'>
+Taskmaster: adjusting ref count: <pending 2 '.'>
+Taskmaster: adjusting ref count: <pending 3 '.'>
+Taskmaster: adjusting ref count: <pending 4 '.'>
+Taskmaster: Considering node <no_state 0 'SConstruct'> and its children:
+Taskmaster: Evaluating <pending 0 'SConstruct'>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state 'Tfile.in'> and its children:
-Taskmaster: Evaluating <pending 'Tfile.in'>
+Taskmaster: Considering node <no_state 0 'Tfile.in'> and its children:
+Taskmaster: Evaluating <pending 0 'Tfile.in'>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state 'Tfile.mid'> and its children:
-Taskmaster: <up_to_date 'Tfile.in'>
-Taskmaster: Evaluating <pending 'Tfile.mid'>
+Taskmaster: Considering node <no_state 0 'Tfile.mid'> and its children:
+Taskmaster: <up_to_date 0 'Tfile.in'>
+Taskmaster: Evaluating <pending 0 'Tfile.mid'>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <no_state 'Tfile.out'> and its children:
-Taskmaster: <executed 'Tfile.mid'>
-Taskmaster: Evaluating <pending 'Tfile.out'>
+Taskmaster: Considering node <no_state 0 'Tfile.out'> and its children:
+Taskmaster: <executed 0 'Tfile.mid'>
+Taskmaster: Evaluating <pending 0 'Tfile.out'>
Taskmaster: Looking for a node to evaluate
-Taskmaster: Considering node <pending '.'> and its children:
-Taskmaster: <up_to_date 'SConstruct'>
-Taskmaster: <up_to_date 'Tfile.in'>
-Taskmaster: <executed 'Tfile.mid'>
-Taskmaster: <executed 'Tfile.out'>
-Taskmaster: Evaluating <pending '.'>
+Taskmaster: Considering node <pending 0 '.'> and its children:
+Taskmaster: <up_to_date 0 'SConstruct'>
+Taskmaster: <up_to_date 0 'Tfile.in'>
+Taskmaster: <executed 0 'Tfile.mid'>
+Taskmaster: <executed 0 'Tfile.out'>
+Taskmaster: Evaluating <pending 0 '.'>
Taskmaster: Looking for a node to evaluate
Taskmaster: No candidate anymore.