diff options
author | Steven Knight <knight@baldmt.com> | 2008-04-17 06:35:51 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2008-04-17 06:35:51 (GMT) |
commit | 12ced93c8d443babcf3ba0c0a3503ed6a8fed2d9 (patch) | |
tree | 340da0ff0ef5002982fcfd5ee2a2a5e34a4bf5e0 /test/option | |
parent | f80d3313d70eace1274f0b5ffbdc53b19acf8250 (diff) | |
download | SCons-12ced93c8d443babcf3ba0c0a3503ed6a8fed2d9.zip SCons-12ced93c8d443babcf3ba0c0a3503ed6a8fed2d9.tar.gz SCons-12ced93c8d443babcf3ba0c0a3503ed6a8fed2d9.tar.bz2 |
Merged revisions 2725-2865 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core
........
r2731 | stevenknight | 2008-04-01 09:22:37 -0700 (Tue, 01 Apr 2008) | 4 lines
Fix test/Interactive/version.py, which still had the old hard-coded
Copyright string, by moving the test copy of the Copyright string
into QMTest/TestSCons.py, where it's available to all test scripts.
........
r2732 | stevenknight | 2008-04-02 13:28:32 -0700 (Wed, 02 Apr 2008) | 3 lines
Issues 317, 323, 329: Ignore the -d, -e and -w options, which we're
not going to implement.
........
r2734 | stevenknight | 2008-04-05 07:50:49 -0700 (Sat, 05 Apr 2008) | 2 lines
Fix bootstrap.py for pre-2.3 versions of Python, which don't have __file__.
........
r2735 | stevenknight | 2008-04-05 07:54:44 -0700 (Sat, 05 Apr 2008) | 2 lines
Fix the non-breaking-hyphen regular expression(s) for Python 1.5.
........
r2736 | garyo | 2008-04-05 19:15:52 -0700 (Sat, 05 Apr 2008) | 1 line
Added Users Guide section for AddMethod.
........
r2737 | stevenknight | 2008-04-08 09:43:31 -0700 (Tue, 08 Apr 2008) | 3 lines
Don't raise strings as exceptions in the exception-handling unit tests.
That's now deprecated Python behavior.
........
r2738 | stevenknight | 2008-04-08 10:36:00 -0700 (Tue, 08 Apr 2008) | 5 lines
Address a serious inefficiency in Java builds by moving the pre-build
check for whether source files exist from the Node class to the Executor
class, so we only have to perform the check once when building a whole
bunch of targets from a whole bunch of sources.
........
r2739 | stevenknight | 2008-04-08 13:53:44 -0700 (Tue, 08 Apr 2008) | 2 lines
Add a backwards-compatibility version of the "itertools" module.
........
r2740 | stevenknight | 2008-04-08 14:12:05 -0700 (Tue, 08 Apr 2008) | 2 lines
Issue 1961: speed up SCons.Util.to_String*() functions. (Benoit Belley)
........
r2741 | stevenknight | 2008-04-08 14:15:36 -0700 (Tue, 08 Apr 2008) | 2 lines
Use the itertools.izip() method for some key Node.FS methods. (Benoit Belley)
........
r2742 | stevenknight | 2008-04-08 14:35:35 -0700 (Tue, 08 Apr 2008) | 2 lines
Issues 1961: use izip() instead of zip() where possible (Benoit Belley)
........
r2743 | stevenknight | 2008-04-08 14:48:08 -0700 (Tue, 08 Apr 2008) | 3 lines
Issue 1961: more efficient get_contents() implementation for Python
function Actions. (Benoit Belley)
........
r2744 | stevenknight | 2008-04-08 17:55:30 -0700 (Tue, 08 Apr 2008) | 3 lines
Issue 1961: make SCons.Node.* state variables global in Taskmaster.py so
we avoid unneceesary attribute fetches. (Benoit Belley)
........
r2745 | stevenknight | 2008-04-08 20:40:31 -0700 (Tue, 08 Apr 2008) | 2 lines
Issue 1961: Optimize the code in Node.get_binfo(). (Benoit Belley)
........
r2746 | stevenknight | 2008-04-08 21:05:17 -0700 (Tue, 08 Apr 2008) | 3 lines
Issue 1961: Enhance the backwards-compatibility sets() module with the
ability to compare sets. (Benoit Belley)
........
r2747 | stevenknight | 2008-04-08 22:11:20 -0700 (Tue, 08 Apr 2008) | 2 lines
Issue 1961: Optimize Executor.scan(). (Benoit Belley)
........
r2748 | stevenknight | 2008-04-08 22:17:55 -0700 (Tue, 08 Apr 2008) | 3 lines
Python 1.5 compatibility: use for p in paths.keys() for dictionaries.
(Benoit Belley)
........
r2749 | stevenknight | 2008-04-08 22:54:02 -0700 (Tue, 08 Apr 2008) | 10 lines
Issue 1961: additional build optimizations:
-- Make taskmastertrace output more useful and readable.
-- Move dependency cycle checking to avoid re-doing it.
-- Have Nodes use sets, not dictionaries, to track various things.
-- Eliminate intermediate function calls from fetching Node children.
-- Add a Task.needs_execute() method to avoid doing that check over and
over as part of needs_execute().
-- Remove the unused Node.found_includes attribute.
(Benoit Belley)
........
r2750 | stevenknight | 2008-04-09 14:47:44 -0700 (Wed, 09 Apr 2008) | 4 lines
Make target Java .class files depend *only* on the input .java files as
their sources when determining if they require rebuilding. This eliminates
O(NxM) checking for every single edge in a big, overly-connected DAG mesh.
........
r2751 | stevenknight | 2008-04-09 16:58:41 -0700 (Wed, 09 Apr 2008) | 2 lines
Remove 0.95 and 0.96* release notes.
........
r2752 | stevenknight | 2008-04-10 02:24:50 -0700 (Thu, 10 Apr 2008) | 2 lines
Issue 1956: Fix --debug=stree printing its tree twice. (Benoit Belley)
........
r2753 | stevenknight | 2008-04-10 02:33:28 -0700 (Thu, 10 Apr 2008) | 2 lines
Issue 1896: Add support for the GDC D language compiler. (Matthew Wesley)
........
r2754 | stevenknight | 2008-04-10 02:39:24 -0700 (Thu, 10 Apr 2008) | 2 lines
Fix tabs.
........
r2755 | stevenknight | 2008-04-10 02:41:50 -0700 (Thu, 10 Apr 2008) | 3 lines
Issue 1964: Fix passing variable names in a list to Return() (as
already documented in the man page!) (Mike Wake)
........
r2756 | stevenknight | 2008-04-10 02:55:40 -0700 (Thu, 10 Apr 2008) | 2 lines
Support the ability to download 2.6 candidate releases (e.g. 2.6a2).
........
r2757 | stevenknight | 2008-04-10 02:58:35 -0700 (Thu, 10 Apr 2008) | 3 lines
Issue 1669: Fix the ability to use LoadableModule() under MinGW.
(Johan Boule)
........
r2758 | stevenknight | 2008-04-10 03:03:15 -0700 (Thu, 10 Apr 2008) | 3 lines
Update the test/Interactive/tree.py script for Benoit's fix to
remove duplicate tree printing.
........
r2759 | stevenknight | 2008-04-10 06:43:44 -0700 (Thu, 10 Apr 2008) | 3 lines
Fix Tool/dmd.py when no D compiler is installed -- we don't want to
search for a path if the result is None.
........
r2760 | GregNoel | 2008-04-10 15:30:34 -0700 (Thu, 10 Apr 2008) | 1 line
Issue 2009: separate Debug.caller() by functionality
........
r2761 | stevenknight | 2008-04-11 04:47:25 -0700 (Fri, 11 Apr 2008) | 3 lines
Issue 1882: Add the scons.bat directory to %PATH% so it can find python.exe.
(Anatoly Techtonik)
........
r2762 | stevenknight | 2008-04-11 09:15:22 -0700 (Fri, 11 Apr 2008) | 4 lines
Issues 1835,1901: fix the ability to list a source file multiple
times for a target by making sure we only store unique entries in the
.sconsign file.
........
r2763 | stevenknight | 2008-04-11 10:58:26 -0700 (Fri, 11 Apr 2008) | 4 lines
Issue 1882: Fix earlier patch to scons.bat by adding ~dp0;~dp0.. to
the front of %PATH%, and only executing endlocal on NT-based systems.
(Anatoly Techtonik)
........
r2764 | stevenknight | 2008-04-11 13:06:29 -0700 (Fri, 11 Apr 2008) | 4 lines
Add a Variables object and {Bool,Envum,List,Package,Path}Variable()
functions as a first step towards eventually deprecating the
Options object and {Bool,Envum,List,Package,Path}Option() functions.
........
r2765 | stevenknight | 2008-04-11 18:13:53 -0700 (Fri, 11 Apr 2008) | 3 lines
Issue 1962: Capture a test case for ListActions that contain a
command-line string containing unicode, and Python FunctionAction.
........
r2766 | stevenknight | 2008-04-11 22:03:14 -0700 (Fri, 11 Apr 2008) | 3 lines
Issue 1933: expect .py files generated by the SWIG -python option
to be in the same (sub)directory as the target.
........
r2767 | stevenknight | 2008-04-12 06:41:57 -0700 (Sat, 12 Apr 2008) | 2 lines
Remove the SCons.Options package in favor of the new SCons.Variables package.
........
r2768 | stevenknight | 2008-04-12 13:33:52 -0700 (Sat, 12 Apr 2008) | 5 lines
Issue 1971: Move the incorporation of $CCFLAGS and $SHCCFLAGS directly
into the C++ command lines (${SHCXX,CXX}COM) instead of through indirect
expansion of $CXXFLAGS and $SHCXXFLAGS. This requires removing -fPIC
from the default setting of $SHCXXFLAGS under the GNU toolchain.
........
r2769 | stevenknight | 2008-04-13 07:01:27 -0700 (Sun, 13 Apr 2008) | 3 lines
Fix __all__ definitions in the Variables/*Variable.py file that were
cause epydoc to blow up when generating developer documentation.
........
r2770 | stevenknight | 2008-04-13 11:47:49 -0700 (Sun, 13 Apr 2008) | 3 lines
Add variables= keyword argument to Environment() creation as a first
step towards deprecating options=.
........
r2771 | stevenknight | 2008-04-13 11:54:19 -0700 (Sun, 13 Apr 2008) | 2 lines
Correct underscore-instead-of-hyphen misspellings in option names.
........
r2772 | bdbaddog | 2008-04-13 17:39:21 -0700 (Sun, 13 Apr 2008) | 3 lines
Changes to fix 15 tests which were failing on cygwin.
........
r2773 | GregNoel | 2008-04-13 22:31:07 -0700 (Sun, 13 Apr 2008) | 1 line
Various fixes to tests on Darwin using 1.5.2
........
r2774 | stevenknight | 2008-04-14 15:00:44 -0700 (Mon, 14 Apr 2008) | 2 lines
Python 1.5.2 fix in new test/SWIG/subdir.py script (use the -classic option).
........
r2775 | belley | 2008-04-14 18:02:40 -0700 (Mon, 14 Apr 2008) | 32 lines
Dont use KeyboardInterrupt to stop a build! [Issue 1907]
SCons would often hang after pressing Ctrl-C. I started investigating and I
realized that most of the Python libraries are not really safe with respect to
asynchronous exceptions. Although,there are enough try/finally blocks to handle
exceptions thrown synchronously by the library code, the Python libraries are
not always protected against exceptions being thrown asynchronously, such as a
KeyboardInterrupt being thrown at a completely random location.
For example, the function Queue.empty() does not protect its mutex with a
try/finally block. If the KeyboardInterrupt exception gets thrown while the
mutex is held, any further attempt to access the Queue will lead to dead-lock
(explaining why SCons hangs sometimes after pressing CTRL-C). Even the
threading.Condition condition variables are not async-exception safe. It
therefore seems a lost battle to try to stop a build by raising an exception.
Instead, I have implemented a signal handler that tells the Jobs (and its
associated Taskmaster) to stop the build. I have been careful to wait after the
.sconsign file has been written back to re-install the default SIGINT signal
handler that raises a KeyboardInterrupt exception.
This patch is submitted against changeset 2773 of branches/core. The
regression test suite has been run on RHEL4 using Pyhon 2.5.1 and
1.5.2. My team has been using an SCons build with this patch for a
while now on Windows, Linux and OSX.
See:
http://scons.tigris.org/issues/show_bug.cgi?id=1907
Benoit Belley
........
r2777 | cournape | 2008-04-14 20:11:56 -0700 (Mon, 14 Apr 2008) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-2776" from
http://scons.tigris.org/svn/scons/branches/fortran_refactor
........
r2788 | stevenknight | 2008-04-14 22:09:27 -0700 (Mon, 14 Apr 2008) | 2 lines
Fix the print the "script" line in the --version output.
........
r2789 | stevenknight | 2008-04-14 22:18:27 -0700 (Mon, 14 Apr 2008) | 2 lines
Add a __COPYRIGHT__ line.
........
r2790 | stevenknight | 2008-04-14 22:20:39 -0700 (Mon, 14 Apr 2008) | 3 lines
Issue 2008: in checkpoint releases, use a '.' to separate (e.g.) 0.98.0
from 0d20080414.
........
r2817 | belley | 2008-04-15 06:44:21 -0700 (Tue, 15 Apr 2008) | 13 lines
TestSCons.up_to_date() should use match_re_dotall
I changed TestSCons.up_to_date() to use match_re_dotall instead of
match_exact. This is necessary so that I can call up_to_date() with
the TestSCons.deprecated_python_expr error message in one of my test.
Note that TestSCons.not_up_to_date() is already using match_re_dotall.
Ran the test suite on both Python 2.5.1 and 1.5.2.
Benoit
........
r2818 | belley | 2008-04-15 12:10:52 -0700 (Tue, 15 Apr 2008) | 10 lines
Improved the multiple-parents.py test to also tests the following
cases:
d) Some children are ignored
e) Some children are pre-requesites
f) Some sources are missing
The test still passes. No extra bug were found.
........
r2850 | stevenknight | 2008-04-16 11:15:24 -0700 (Wed, 16 Apr 2008) | 4 lines
Fix problems with the __del__() method referencing other module functions
through global variables, which can get deleted out from under us at
shutdown.
........
r2851 | stevenknight | 2008-04-16 11:17:07 -0700 (Wed, 16 Apr 2008) | 4 lines
Fix use of --interactive with -u/-U/-D and VariantDir() by making the
method that cleans Node states between interactive commands aware of
the alter_targets() method that tells us about an associated VariantDir().
........
Diffstat (limited to 'test/option')
-rw-r--r-- | test/option/d.py | 144 | ||||
-rw-r--r-- | test/option/environment-overrides.py | 44 | ||||
-rw-r--r-- | test/option/help-options.py | 68 | ||||
-rw-r--r-- | test/option/no-print-directory.py | 41 | ||||
-rw-r--r-- | test/option/print-directory.py | 44 | ||||
-rw-r--r-- | test/option/taskmastertrace.py | 100 | ||||
-rw-r--r-- | test/option/tree-all.py | 24 | ||||
-rw-r--r-- | test/option/tree-lib.py | 4 |
8 files changed, 425 insertions, 44 deletions
diff --git a/test/option/d.py b/test/option/d.py new file mode 100644 index 0000000..0f8a9a5 --- /dev/null +++ b/test/option/d.py @@ -0,0 +1,144 @@ +#!/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 the -d option is ignored. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', "") + +test.run(arguments = '-d .', + stderr = "Warning: ignoring -d option\n") + +test.pass_test() + +# + +test.subdir('subdir') + +test.write('SConstruct', """ +env = Environment() +env.Program(target = 'aaa', source = 'aaa.c') +env.Program(target = 'bbb', source = 'bbb.c') +SConscript('subdir/SConscript') +""") + +test.write(['subdir', 'SConscript'], """ +env = Environment() +env.Program(target = 'ccc', source = 'ccc.c') +env.Program(target = 'ddd', source = 'ddd.c') +""") + +test.write('aaa.c', """ +int +main(int argc, char *argv) +{ + argv[argc++] = "--"; + printf("aaa.c\n"); + exit (0); +} +""") + +test.write('bbb.c', """ +int +main(int argc, char *argv) +{ + argv[argc++] = "--"; + printf("bbb.c\n"); + exit (0); +} +""") + +test.write(['subdir', 'ccc.c'], """ +int +main(int argc, char *argv) +{ + argv[argc++] = "--"; + printf("subdir/ccc.c\n"); + exit (0); +} +""") + +test.write(['subdir', 'ddd.c'], """ +int +main(int argc, char *argv) +{ + argv[argc++] = "--"; + printf("subdir/ddd.c\n"); + exit (0); +} +""") + +test.run(arguments = '-d .', stdout = """ +Target aaa: aaa.o +Checking aaa + Checking aaa.o + Checking aaa.c + Rebuilding aaa.o: out of date. +cc -c -o aaa.o aaa.c +Rebuilding aaa: out of date. +cc -o aaa aaa.o +Target aaa.o: aaa.c +Target bbb: bbb.o +Checking bbb + Checking bbb.o + Checking bbb.c + Rebuilding bbb.o: out of date. +cc -c -o bbb.o bbb.c +Rebuilding bbb: out of date. +cc -o bbb bbb.o +Target bbb.o: bbb.c +Target subdir/ccc/g: subdir/ccc.o +Checking subdir/ccc/g + Checking subdir/ccc/g.o + Checking subdir/ccc/g.c + Rebuilding subdir/ccc/g.o: out of date. +cc -c -o subdir/ccc/g.o subdir/ccc.c +Rebuilding subdir/ccc/g: out of date. +cc -o subdir/ccc/g subdir/ccc.o +Target subdir/ccc/g.o: subdir/ccc.c +Target subdir/ddd/g: subdir/ddd.o +Checking subdir/ddd/g + Checking subdir/ddd/g.o + Checking subdir/ddd/g.c + Rebuilding subdir/ddd/g.o: out of date. +cc -c -o subdir/ddd/g.o subdir/ddd.c +Rebuilding subdir/ddd/g: out of date. +cc -o subdir/ddd/g subdir/ddd.o +Target subdir/ddd/g.o: subdir/ddd.c +""") + +test.run(program = test.workpath('aaa'), stdout = "aaa.c\n") +test.run(program = test.workpath('bbb'), stdout = "bbb.c\n") +test.run(program = test.workpath('subdir/ccc'), stdout = "subdir/ccc.c\n") +test.run(program = test.workpath('subdir/ddd'), stdout = "subdir/ddd.c\n") + +test.pass_test() + diff --git a/test/option/environment-overrides.py b/test/option/environment-overrides.py new file mode 100644 index 0000000..078bfea --- /dev/null +++ b/test/option/environment-overrides.py @@ -0,0 +1,44 @@ +#!/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 the -e and --environment-overrides options are ignored. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', "") + +test.run(arguments = '-e .', + stderr = "Warning: ignoring -e option\n") + +test.run(arguments = '--environment-overrides .', + stderr = "Warning: ignoring --environment-overrides option\n") + +test.pass_test() + diff --git a/test/option/help-options.py b/test/option/help-options.py new file mode 100644 index 0000000..5f8270f --- /dev/null +++ b/test/option/help-options.py @@ -0,0 +1,68 @@ +#!/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 behavior of the -H and --help-options options. +""" + +import re +import string + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', "") + +test.run(arguments = '-H') + +test.fail_test(string.find(test.stdout(), '-H, --help-options') == -1) +test.fail_test(string.find(test.stdout(), '--debug=TYPE') == -1) + +# Validate that the help output lists the options in case-insensitive +# alphabetical order. + +# Don't include in the sorted comparison the options that are ignored +# for compatibility. They're all printed at the top of the list. +ignored_re = re.compile('.*Ignored for compatibility\\.\n', re.S) +stdout = ignored_re.sub('', test.stdout()) + +lines = string.split(stdout, '\n') +lines = filter(lambda x: x[:3] == ' -', lines) +lines = map(lambda x: x[3:], lines) +lines = map(lambda x: x[0] == '-' and x[1:] or x, lines) +options = map(lambda x: string.split(x)[0], lines) +options = map(lambda x: x[-1] == ',' and x[:-1] or x, options) +lowered = map(lambda x: string.lower(x), options) +sorted = lowered[:] +sorted.sort() +if lowered != sorted: + print "lowered =", lowered + print "sorted =", sorted + test.fail_test() + +test.pass_test() + diff --git a/test/option/no-print-directory.py b/test/option/no-print-directory.py new file mode 100644 index 0000000..bb0abbf --- /dev/null +++ b/test/option/no-print-directory.py @@ -0,0 +1,41 @@ +#!/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 the --no-print-directory option is ignored. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', "") + +test.run(arguments = '--no-print-directory .', + stderr = "Warning: ignoring --no-print-directory option\n") + +test.pass_test() + diff --git a/test/option/print-directory.py b/test/option/print-directory.py new file mode 100644 index 0000000..a5d8fcf --- /dev/null +++ b/test/option/print-directory.py @@ -0,0 +1,44 @@ +#!/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 the -w and --print-directory options are ignored. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', "") + +test.run(arguments = '-w .', + stderr = "Warning: ignoring -w option\n") + +test.run(arguments = '--print-directory .', + stderr = "Warning: ignoring --print-directory option\n") + +test.pass_test() + diff --git a/test/option/taskmastertrace.py b/test/option/taskmastertrace.py index 3139504..30e15aa 100644 --- a/test/option/taskmastertrace.py +++ b/test/option/taskmastertrace.py @@ -46,23 +46,43 @@ env.Command('Tfile.mid', 'Tfile.in', Copy('$TARGET', '$SOURCE')) test.write('Tfile.in', "Tfile.in\n") expect_stdout = test.wrap_stdout("""\ -Taskmaster: '.': children: - ['SConstruct', 'Tfile.in', 'Tfile.mid', 'Tfile.out'] - waiting on unfinished children: - ['SConstruct', 'Tfile.in', 'Tfile.mid', 'Tfile.out'] -Taskmaster: 'SConstruct': evaluating SConstruct -Taskmaster: 'Tfile.in': evaluating Tfile.in -Taskmaster: 'Tfile.mid': children: - ['Tfile.in'] - evaluating Tfile.mid + +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: Looking for a node to evaluate +Taskmaster: Considering node <no_state 'Tfile.in'> and its children: +Taskmaster: Evaluating <pending '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'> Copy("Tfile.mid", "Tfile.in") -Taskmaster: 'Tfile.out': children: - ['Tfile.mid'] - evaluating Tfile.out + +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'> Copy("Tfile.out", "Tfile.mid") -Taskmaster: '.': children: - ['SConstruct', 'Tfile.in', 'Tfile.mid', 'Tfile.out'] - evaluating . + +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: Looking for a node to evaluate +Taskmaster: No candidate anymore. + """) test.run(arguments='--taskmastertrace=- .', stdout=expect_stdout) @@ -81,21 +101,41 @@ Copy("Tfile.out", "Tfile.mid") test.run(arguments='--taskmastertrace=trace.out .', stdout=expect_stdout) expect_trace = """\ -Taskmaster: '.': children: - ['SConstruct', 'Tfile.in', 'Tfile.mid', 'Tfile.out'] - waiting on unfinished children: - ['SConstruct', 'Tfile.in', 'Tfile.mid', 'Tfile.out'] -Taskmaster: 'SConstruct': evaluating SConstruct -Taskmaster: 'Tfile.in': evaluating Tfile.in -Taskmaster: 'Tfile.mid': children: - ['Tfile.in'] - evaluating Tfile.mid -Taskmaster: 'Tfile.out': children: - ['Tfile.mid'] - evaluating Tfile.out -Taskmaster: '.': children: - ['SConstruct', 'Tfile.in', 'Tfile.mid', 'Tfile.out'] - evaluating . + +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: Looking for a node to evaluate +Taskmaster: Considering node <no_state 'Tfile.in'> and its children: +Taskmaster: Evaluating <pending '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: 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: 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: Looking for a node to evaluate +Taskmaster: No candidate anymore. + """ test.must_match('trace.out', expect_trace) diff --git a/test/option/tree-all.py b/test/option/tree-all.py index 163d286..0a0af7d 100644 --- a/test/option/tree-all.py +++ b/test/option/tree-all.py @@ -97,8 +97,8 @@ tree1 = """ """ % locals() test.run(arguments = "--tree=all Foo.xxx") -if string.find(test.stdout(), tree1) == -1: - sys.stdout.write('Did not find expected tree in the following output:\n') +if string.count(test.stdout(), tree1) != 1: + sys.stdout.write('Did not find expected tree (or found duplicate) in the following output:\n') sys.stdout.write(test.stdout()) test.fail_test() @@ -163,14 +163,14 @@ tree3 = """ """ % locals() test.run(arguments = "--tree=all,prune .") -if string.find(test.stdout(), tree3) == -1: - sys.stdout.write('Did not find expected tree in the following output:\n') +if string.count(test.stdout(), tree3) != 1: + sys.stdout.write('Did not find expected tree (or found duplicate) in the following output:\n') sys.stdout.write(test.stdout()) test.fail_test() test.run(arguments = "--tree=prune .") -if string.find(test.stdout(), tree3) == -1: - sys.stdout.write('Did not find expected tree in the following output:\n') +if string.count(test.stdout(), tree3) != 1: + sys.stdout.write('Did not find expected tree (or found duplicate) in the following output:\n') sys.stdout.write(test.stdout()) test.fail_test() @@ -203,14 +203,14 @@ tree4 = """ test.run(arguments = '-c Foo.xxx') test.run(arguments = "--no-exec --tree=all,status Foo.xxx") -if string.find(test.stdout(), tree4) == -1: - sys.stdout.write('Did not find expected tree in the following output:\n') +if string.count(test.stdout(), tree4) != 1: + sys.stdout.write('Did not find expected tree (or found duplicate) in the following output:\n') sys.stdout.write(test.stdout()) test.fail_test() test.run(arguments = "--no-exec --tree=status Foo.xxx") -if string.find(test.stdout(), tree4) == -1: - sys.stdout.write('Did not find expected tree in the following output:\n') +if string.count(test.stdout(), tree4) != 1: + sys.stdout.write('Did not find expected tree (or found duplicate) in the following output:\n') sys.stdout.write(test.stdout()) test.fail_test() @@ -226,8 +226,8 @@ THIS SHOULD CAUSE A BUILD FAILURE test.run(arguments = "--tree=all Foo.xxx", status = 2, stderr = None) -if string.find(test.stdout(), tree1) == -1: - sys.stdout.write('Did not find expected tree in the following output:\n') +if string.count(test.stdout(), tree1) != 1: + sys.stdout.write('Did not find expected tree (or found duplicate) in the following output:\n') sys.stdout.write(test.stdout()) test.fail_test() diff --git a/test/option/tree-lib.py b/test/option/tree-lib.py index fc29d50..8858b74 100644 --- a/test/option/tree-lib.py +++ b/test/option/tree-lib.py @@ -47,7 +47,7 @@ env = Environment(LIBPREFIX='', EXESUFFIX='.exe') env.AppendENVPath('PATH', '.') l = env.Library( 'util.lib', 'util.c' ) -p = env.Program( 'test.exe', 'main.c', LIBS=l ) +p = env.Program( 'test_tree_lib.exe', 'main.c', LIBS=l ) env.Command( 'foo.h', p, '$SOURCE > $TARGET') """) @@ -71,7 +71,7 @@ util(void) """) expect = """ - +-test.exe + +-test_tree_lib.exe +-main.obj +-util.lib +-util.obj |