summaryrefslogtreecommitdiffstats
path: root/test/option
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2021-04-09 23:47:27 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2021-04-09 23:51:40 (GMT)
commitd335bfb56e5af75d98ef92d2b5e3f8787ea5e0e5 (patch)
treebf7e4c28ed0d6e904667e11ae536be55b94ae6e5 /test/option
parentcb7788470022e2e62e4c67a622693c0422ee7627 (diff)
downloadSCons-d335bfb56e5af75d98ef92d2b5e3f8787ea5e0e5.zip
SCons-d335bfb56e5af75d98ef92d2b5e3f8787ea5e0e5.tar.gz
SCons-d335bfb56e5af75d98ef92d2b5e3f8787ea5e0e5.tar.bz2
Add docs for --experimental switch
Diffstat (limited to 'test/option')
-rw-r--r--test/option/fixture/.exclude_tests0
-rw-r--r--test/option/fixture/SConstruct__experimental.py6
-rw-r--r--test/option/option--experimental.py62
3 files changed, 68 insertions, 0 deletions
diff --git a/test/option/fixture/.exclude_tests b/test/option/fixture/.exclude_tests
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/option/fixture/.exclude_tests
diff --git a/test/option/fixture/SConstruct__experimental.py b/test/option/fixture/SConstruct__experimental.py
new file mode 100644
index 0000000..3641bb0
--- /dev/null
+++ b/test/option/fixture/SConstruct__experimental.py
@@ -0,0 +1,6 @@
+DefaultEnvironment(tools=[])
+env = Environment(tools=[])
+
+exp=GetOption('experimental')
+print("Experimental=%s"%exp)
+print("All=%s"%('all' in exp)) \ No newline at end of file
diff --git a/test/option/option--experimental.py b/test/option/option--experimental.py
new file mode 100644
index 0000000..75c7f9b
--- /dev/null
+++ b/test/option/option--experimental.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+#
+# MIT License
+#
+# Copyright The SCons Foundation
+#
+# 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.
+
+"""
+Test the --experimental option.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.file_fixture('fixture/SConstruct__experimental.py', 'SConstruct')
+
+tests = [
+ ('.', [], 'False'),
+ ('--experimental=all', ['all'], 'True'),
+ ('--experimental=none', ['none'], 'False'),
+]
+
+for args, exper, all_str in tests:
+ read_string = """Experimental=%s
+All=%s
+""" % (exper, all_str)
+ test.run(arguments=args,
+ stdout=test.wrap_stdout(read_str=read_string, build_str="scons: `.' is up to date.\n"))
+
+test.run(arguments='--experimental=warp_drive',
+ stderr="""usage: scons [OPTION] [TARGET] ...
+
+SCons Error: option --experimental: invalid choice: 'warp_drive' (choose from 'all', 'none')
+""",
+ status=2)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: