summaryrefslogtreecommitdiffstats
path: root/test/scons-time/run/option
diff options
context:
space:
mode:
Diffstat (limited to 'test/scons-time/run/option')
-rw-r--r--test/scons-time/run/option/help.py59
-rw-r--r--test/scons-time/run/option/next-run.py99
-rw-r--r--test/scons-time/run/option/no-args.py42
-rw-r--r--test/scons-time/run/option/no-exec.py49
-rw-r--r--test/scons-time/run/option/number.py48
-rw-r--r--test/scons-time/run/option/outdir.py51
-rw-r--r--test/scons-time/run/option/prefix.py48
-rw-r--r--test/scons-time/run/option/python.py64
-rw-r--r--test/scons-time/run/option/quiet.py96
-rw-r--r--test/scons-time/run/option/scons.py59
-rw-r--r--test/scons-time/run/option/subdir.py59
-rw-r--r--test/scons-time/run/option/verbose.py161
12 files changed, 835 insertions, 0 deletions
diff --git a/test/scons-time/run/option/help.py b/test/scons-time/run/option/help.py
new file mode 100644
index 0000000..304992f
--- /dev/null
+++ b/test/scons-time/run/option/help.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 the run -h option (and variants) prints help.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+expect = [
+ "Usage: scons-time run [OPTIONS] [FILE ...]\n",
+ " -h, --help Print this help and exit\n",
+ " -n, --no-exec No execute, just print command lines\n",
+ " -q, --quiet Don't print command lines\n",
+ " -v, --verbose Display output of commands\n",
+]
+
+test.run(arguments = 'run -h')
+
+test.must_contain_all_lines('Standard output', test.stdout(), expect)
+
+test.run(arguments = 'run -?')
+
+test.must_contain_all_lines('Standard output', test.stdout(), expect)
+
+test.run(arguments = 'run --help')
+
+test.must_contain_all_lines('Standard output', test.stdout(), expect)
+
+test.run(arguments = 'help run')
+
+test.must_contain_all_lines('Standard output', test.stdout(), expect)
+
+test.pass_test()
diff --git a/test/scons-time/run/option/next-run.py b/test/scons-time/run/option/next-run.py
new file mode 100644
index 0000000..8a23939
--- /dev/null
+++ b/test/scons-time/run/option/next-run.py
@@ -0,0 +1,99 @@
+#!/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 script finds the next run number based on the
+contents of the directory, even when specified with --outdir.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.subdir('sub')
+
+test.write_fake_scons_py()
+
+test.write_sample_project('foo.tar.gz')
+
+test.run(arguments = 'run foo.tar.gz')
+
+test.must_exist('foo-000-0.log',
+ 'foo-000-0.prof',
+ 'foo-000-1.log',
+ 'foo-000-1.prof',
+ 'foo-000-2.log',
+ 'foo-000-2.prof')
+
+test.must_not_exist('foo-001-0.log',
+ 'foo-001-0.prof',
+ 'foo-001-1.log',
+ 'foo-001-1.prof',
+ 'foo-001-2.log',
+ 'foo-001-2.prof')
+
+test.run(arguments = 'run foo.tar.gz')
+
+test.must_exist('foo-001-0.log',
+ 'foo-001-0.prof',
+ 'foo-001-1.log',
+ 'foo-001-1.prof',
+ 'foo-001-2.log',
+ 'foo-001-2.prof')
+
+test.must_not_exist('foo-002-0.log',
+ 'foo-002-0.prof',
+ 'foo-002-1.log',
+ 'foo-002-1.prof',
+ 'foo-002-2.log',
+ 'foo-002-2.prof')
+
+test.run(arguments = 'run foo.tar.gz')
+
+test.must_exist('foo-002-0.log',
+ 'foo-002-0.prof',
+ 'foo-002-1.log',
+ 'foo-002-1.prof',
+ 'foo-002-2.log',
+ 'foo-002-2.prof')
+
+test.run(arguments = 'run --outdir sub foo.tar.gz')
+
+test.must_exist(['sub', 'foo-000-0.log'],
+ ['sub', 'foo-000-0.prof'],
+ ['sub', 'foo-000-1.log'],
+ ['sub', 'foo-000-1.prof'],
+ ['sub', 'foo-000-2.log'],
+ ['sub', 'foo-000-2.prof'])
+
+test.must_not_exist('foo-003-0.log',
+ 'foo-003-0.prof',
+ 'foo-003-1.log',
+ 'foo-003-1.prof',
+ 'foo-003-2.log',
+ 'foo-003-2.prof')
+
+test.pass_test()
diff --git a/test/scons-time/run/option/no-args.py b/test/scons-time/run/option/no-args.py
new file mode 100644
index 0000000..520b27d
--- /dev/null
+++ b/test/scons-time/run/option/no-args.py
@@ -0,0 +1,42 @@
+#!/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 the error when the run command is passed no arguments.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+expect = """\
+scons-time: run: No arguments or -f config file specified.
+ Type "scons-time help run" for help.
+"""
+
+test.run(arguments = 'run', status = 1, stderr = expect)
+
+test.pass_test()
diff --git a/test/scons-time/run/option/no-exec.py b/test/scons-time/run/option/no-exec.py
new file mode 100644
index 0000000..a2eab74
--- /dev/null
+++ b/test/scons-time/run/option/no-exec.py
@@ -0,0 +1,49 @@
+#!/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 run -n and --no-exec options don't actually create the
+expected output files.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.write_sample_project('foo.tar.gz')
+
+test.run(arguments = 'run -n foo.tar.gz')
+
+test.run(arguments = 'run --no-exec foo.tar.gz')
+
+test.must_not_exist('foo-000-0.log',
+ 'foo-000-0.prof',
+ 'foo-000-1.log',
+ 'foo-000-1.prof',
+ 'foo-000-2.log',
+ 'foo-000-2.prof')
+
+test.pass_test()
diff --git a/test/scons-time/run/option/number.py b/test/scons-time/run/option/number.py
new file mode 100644
index 0000000..ddf2d86
--- /dev/null
+++ b/test/scons-time/run/option/number.py
@@ -0,0 +1,48 @@
+#!/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 the run --number option specifies the run number.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.write_fake_scons_py()
+
+test.write_sample_project('foo.tar.gz')
+
+test.run(arguments = 'run --number 77 foo.tar.gz')
+
+test.must_exist('foo-077-0.log',
+ 'foo-077-0.prof',
+ 'foo-077-1.log',
+ 'foo-077-1.prof',
+ 'foo-077-2.log',
+ 'foo-077-2.prof')
+
+test.pass_test()
diff --git a/test/scons-time/run/option/outdir.py b/test/scons-time/run/option/outdir.py
new file mode 100644
index 0000000..f60eba0
--- /dev/null
+++ b/test/scons-time/run/option/outdir.py
@@ -0,0 +1,51 @@
+
+#!/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 specifying an alternate output directory with the --outdir option.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.subdir('sub')
+
+test.write_fake_scons_py()
+
+test.write_sample_project('foo.tar.gz')
+
+test.run(arguments = 'run --outdir sub foo.tar.gz')
+
+test.must_exist(['sub', 'foo-000-0.log'],
+ ['sub', 'foo-000-0.prof'],
+ ['sub', 'foo-000-1.log'],
+ ['sub', 'foo-000-1.prof'],
+ ['sub', 'foo-000-2.log'],
+ ['sub', 'foo-000-2.prof'])
+
+test.pass_test()
diff --git a/test/scons-time/run/option/prefix.py b/test/scons-time/run/option/prefix.py
new file mode 100644
index 0000000..6bc9619
--- /dev/null
+++ b/test/scons-time/run/option/prefix.py
@@ -0,0 +1,48 @@
+#!/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 specifying an alternate file prefix with the --prefix option.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.write_fake_scons_py()
+
+test.write_sample_project('foo.tar.gz')
+
+test.run(arguments = 'run --prefix bar foo.tar.gz')
+
+test.must_exist('bar-000-0.log',
+ 'bar-000-0.prof',
+ 'bar-000-1.log',
+ 'bar-000-1.prof',
+ 'bar-000-2.log',
+ 'bar-000-2.prof')
+
+test.pass_test()
diff --git a/test/scons-time/run/option/python.py b/test/scons-time/run/option/python.py
new file mode 100644
index 0000000..bd12efe
--- /dev/null
+++ b/test/scons-time/run/option/python.py
@@ -0,0 +1,64 @@
+#!/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 the run --python option to specify an alternatie Python executable.
+"""
+
+import os
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.write_sample_project('foo.tar.gz')
+
+my_python_py = test.workpath('my_python.py')
+
+test.write(my_python_py, """\
+#!/usr/bin/env python
+import sys
+profile = ''
+for arg in sys.argv[1:]:
+ if arg.startswith('--profile='):
+ profile = arg[10:]
+ break
+sys.stdout.write('my_python.py: %s\\n' % profile)
+""")
+
+os.chmod(my_python_py, 0755)
+
+test.run(arguments = 'run --python %s foo.tar.gz' % my_python_py)
+
+prof0 = test.workpath('foo-000-0.prof')
+prof1 = test.workpath('foo-000-1.prof')
+prof2 = test.workpath('foo-000-2.prof')
+
+test.must_match('foo-000-0.log', "my_python.py: %s\n" % prof0)
+test.must_match('foo-000-1.log', "my_python.py: %s\n" % prof1)
+test.must_match('foo-000-2.log', "my_python.py: %s\n" % prof2)
+
+test.pass_test()
diff --git a/test/scons-time/run/option/quiet.py b/test/scons-time/run/option/quiet.py
new file mode 100644
index 0000000..5d5d7cf
--- /dev/null
+++ b/test/scons-time/run/option/quiet.py
@@ -0,0 +1,96 @@
+#!/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 run -q and --quiet options suppress build output.
+"""
+
+import re
+
+import TestSCons_time
+
+python = TestSCons_time.python
+
+test = TestSCons_time.TestSCons_time(match = TestSCons_time.match_re)
+test.diff_function = TestSCons_time.diff_re
+
+
+def tempdir_re(*args):
+ import os
+ import os.path
+ import string
+ import tempfile
+
+ sep = re.escape(os.sep)
+ args = (tempfile.gettempdir(), 'scons-time-',) + args
+ x = apply(os.path.join, args)
+ x = re.escape(x)
+ x = string.replace(x, 'time\\-', 'time\\-[^%s]*' % sep)
+ return x
+
+scons_py = re.escape(test.workpath('src', 'script', 'scons.py'))
+src_engine = re.escape(test.workpath('src', 'engine'))
+
+tmp_scons_time = tempdir_re()
+tmp_scons_time_foo = tempdir_re('foo')
+
+
+test.write_fake_scons_py()
+
+foo_tar_gz = test.write_sample_project('foo.tar.gz')
+
+expect = """\
+%(scons_py)s
+ --version
+SCONS_LIB_DIR = %(src_engine)s
+SConstruct file directory: %(tmp_scons_time_foo)s
+""" % locals()
+
+test.run(arguments = 'run -q foo.tar.gz', stdout = expect)
+
+test.must_exist('foo-000-0.log',
+ 'foo-000-0.prof',
+ 'foo-000-1.log',
+ 'foo-000-1.prof',
+ 'foo-000-2.log',
+ 'foo-000-2.prof')
+
+scons_py = test.workpath('src/script/scons.py')
+
+src_engine = test.workpath('src/engine')
+
+test.run(arguments = 'run -q foo.tar.gz', stdout = expect)
+
+test.must_exist('foo-001-0.log',
+ 'foo-001-0.prof',
+ 'foo-001-1.log',
+ 'foo-001-1.prof',
+ 'foo-001-2.log',
+ 'foo-001-2.prof')
+
+test.run(arguments = 'run --quiet foo.tar.gz', stdout = expect)
+
+test.pass_test()
diff --git a/test/scons-time/run/option/scons.py b/test/scons-time/run/option/scons.py
new file mode 100644
index 0000000..14ac18d
--- /dev/null
+++ b/test/scons-time/run/option/scons.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 the run --scons option to specify an alternatie SCons script.
+"""
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.write_sample_project('foo.tar.gz')
+
+my_scons_py = test.workpath('my_scons.py')
+
+test.write(my_scons_py, """\
+import sys
+profile = ''
+for arg in sys.argv[1:]:
+ if arg.startswith('--profile='):
+ profile = arg[10:]
+ break
+print 'my_scons.py: %s' % profile
+""")
+
+test.run(arguments = 'run --scons %s foo.tar.gz' % my_scons_py)
+
+prof0 = test.workpath('foo-000-0.prof')
+prof1 = test.workpath('foo-000-1.prof')
+prof2 = test.workpath('foo-000-2.prof')
+
+test.must_match('foo-000-0.log', "my_scons.py: %s\n" % prof0)
+test.must_match('foo-000-1.log', "my_scons.py: %s\n" % prof1)
+test.must_match('foo-000-2.log', "my_scons.py: %s\n" % prof2)
+
+test.pass_test()
diff --git a/test/scons-time/run/option/subdir.py b/test/scons-time/run/option/subdir.py
new file mode 100644
index 0000000..b96d0e6
--- /dev/null
+++ b/test/scons-time/run/option/subdir.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 we change to a subdirectory before building if asked to do so.
+"""
+
+import os
+import re
+
+import TestSCons_time
+
+test = TestSCons_time.TestSCons_time()
+
+test.write_fake_scons_py()
+
+test.write_sample_project('foo.tar.gz', 'subdir')
+
+test.run(arguments = 'run --subdir subdir foo.tar.gz')
+
+test.must_exist('foo-000-0.log',
+ 'foo-000-0.prof',
+ 'foo-000-1.log',
+ 'foo-000-1.prof',
+ 'foo-000-2.log',
+ 'foo-000-2.prof')
+
+expect = [
+ 'SConstruct file directory: .*%ssubdir$' % re.escape(os.sep),
+]
+
+content = test.read(test.workpath('foo-000-0.log'), mode='r')
+
+test.must_contain_all_lines('foo-000-0.log', content, expect, re.search)
+
+test.pass_test()
diff --git a/test/scons-time/run/option/verbose.py b/test/scons-time/run/option/verbose.py
new file mode 100644
index 0000000..cdf5b5a
--- /dev/null
+++ b/test/scons-time/run/option/verbose.py
@@ -0,0 +1,161 @@
+#!/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 run -v and --verbose options display command output.
+"""
+
+import re
+
+import TestSCons_time
+
+_python_ = re.escape(TestSCons_time._python_)
+
+
+test = TestSCons_time.TestSCons_time(match = TestSCons_time.match_re)
+test.diff_function = TestSCons_time.diff_re
+
+
+def tempdir_re(*args):
+ import os
+ import os.path
+ import string
+ import tempfile
+
+ sep = re.escape(os.sep)
+ args = (tempfile.gettempdir(), 'scons-time-',) + args
+ x = apply(os.path.join, args)
+ x = re.escape(x)
+ x = string.replace(x, 'time\\-', 'time\\-[^%s]*' % sep)
+ return x
+
+scons_py = re.escape(test.workpath('src', 'script', 'scons.py'))
+src_engine = re.escape(test.workpath('src', 'engine'))
+
+tmp_scons_time = tempdir_re()
+tmp_scons_time_foo = tempdir_re('foo')
+
+
+test.write_fake_scons_py()
+
+foo_tar_gz = test.write_sample_project('foo.tar.gz')
+
+expect = """\
+%(scons_py)s
+ --version
+SCONS_LIB_DIR = %(src_engine)s
+SConstruct file directory: %(tmp_scons_time_foo)s
+""" % locals()
+
+test.run(arguments = 'run -q foo.tar.gz', stdout = expect)
+
+test.must_exist('foo-000-0.log',
+ 'foo-000-0.prof',
+ 'foo-000-1.log',
+ 'foo-000-1.prof',
+ 'foo-000-2.log',
+ 'foo-000-2.prof')
+
+time_re = r'\[\d\d:\d\d:\d\d\]'
+
+scons_flags = '--debug=count --debug=memory --debug=time --debug=memoizer'
+
+
+expect = """\
+scons-time%(time_re)s: mkdir %(tmp_scons_time)s
+scons-time%(time_re)s: cd %(tmp_scons_time)s
+scons-time%(time_re)s: tar xzf %(foo_tar_gz)s
+scons-time%(time_re)s: cd foo
+scons-time%(time_re)s: find \\* -type f | xargs cat > /dev/null
+scons-time%(time_re)s: export SCONS_LIB_DIR=%(src_engine)s
+scons-time%(time_re)s: %(_python_)s %(scons_py)s --version
+%(scons_py)s
+ --version
+SCONS_LIB_DIR = %(src_engine)s
+SConstruct file directory: %(tmp_scons_time_foo)s
+scons-time%(time_re)s: %(_python_)s %(scons_py)s %(scons_flags)s --profile=%(prof0)s --help 2>&1 \\| tee %(log0)s
+%(scons_py)s
+ --debug=count
+ --debug=memory
+ --debug=time
+ --debug=memoizer
+ --profile=%(prof0)s
+ --help
+SCONS_LIB_DIR = %(src_engine)s
+SConstruct file directory: %(tmp_scons_time_foo)s
+scons-time%(time_re)s: %(_python_)s %(scons_py)s %(scons_flags)s --profile=%(prof1)s 2>&1 \\| tee %(log1)s
+%(scons_py)s
+ --debug=count
+ --debug=memory
+ --debug=time
+ --debug=memoizer
+ --profile=%(prof1)s
+SCONS_LIB_DIR = %(src_engine)s
+SConstruct file directory: %(tmp_scons_time_foo)s
+scons-time%(time_re)s: %(_python_)s %(scons_py)s %(scons_flags)s --profile=%(prof2)s 2>&1 \\| tee %(log2)s
+%(scons_py)s
+ --debug=count
+ --debug=memory
+ --debug=time
+ --debug=memoizer
+ --profile=%(prof2)s
+SCONS_LIB_DIR = %(src_engine)s
+SConstruct file directory: %(tmp_scons_time_foo)s
+scons-time%(time_re)s: cd .*
+scons-time%(time_re)s: rm -rf %(tmp_scons_time)s
+"""
+
+foo_tar_gz = re.escape(foo_tar_gz)
+
+log0 = re.escape(test.workpath('foo-001-0.log'))
+log1 = re.escape(test.workpath('foo-001-1.log'))
+log2 = re.escape(test.workpath('foo-001-2.log'))
+
+prof0 = re.escape(test.workpath('foo-001-0.prof'))
+prof1 = re.escape(test.workpath('foo-001-1.prof'))
+prof2 = re.escape(test.workpath('foo-001-2.prof'))
+
+test.run(arguments = 'run -v foo.tar.gz', stdout = expect % locals())
+
+test.must_exist('foo-001-0.log',
+ 'foo-001-0.prof',
+ 'foo-001-1.log',
+ 'foo-001-1.prof',
+ 'foo-001-2.log',
+ 'foo-001-2.prof')
+
+log0 = re.escape(test.workpath('foo-002-0.log'))
+log1 = re.escape(test.workpath('foo-002-1.log'))
+log2 = re.escape(test.workpath('foo-002-2.log'))
+
+prof0 = re.escape(test.workpath('foo-002-0.prof'))
+prof1 = re.escape(test.workpath('foo-002-1.prof'))
+prof2 = re.escape(test.workpath('foo-002-2.prof'))
+
+test.run(arguments = 'run --verbose foo.tar.gz', stdout = expect % locals())
+
+
+test.pass_test()