summaryrefslogtreecommitdiffstats
path: root/test/SConscript
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2009-05-17 15:54:14 (GMT)
committerGreg Noel <GregNoel@tigris.org>2009-05-17 15:54:14 (GMT)
commit57a356b8284d1b52bdd24009700ce90a7bf5593d (patch)
treea0c7c99979ab2663836dbeff555f78b7b25bbb63 /test/SConscript
parentc0f6d4d67476e09aab5d423f014d4e7a6dc93148 (diff)
downloadSCons-57a356b8284d1b52bdd24009700ce90a7bf5593d.zip
SCons-57a356b8284d1b52bdd24009700ce90a7bf5593d.tar.gz
SCons-57a356b8284d1b52bdd24009700ce90a7bf5593d.tar.bz2
Issue 2229, fix, tests, doc
Diffstat (limited to 'test/SConscript')
-rw-r--r--test/SConscript/variables.py52
1 files changed, 12 insertions, 40 deletions
diff --git a/test/SConscript/variables.py b/test/SConscript/variables.py
index dd51155..828a62c 100644
--- a/test/SConscript/variables.py
+++ b/test/SConscript/variables.py
@@ -33,6 +33,13 @@ import TestSCons
test = TestSCons.TestSCons()
+# SConscript to detect if exported variables are intact
+test.write("SConscript", """
+Import(['x', 'y'])
+assert x == 'x'
+assert y == 'zoom'
+""")
+
# Test exporting all global variables as a list of keys:
test.write("SConstruct", """
x = 'x'
@@ -41,12 +48,6 @@ Export(globals().keys())
SConscript('SConscript')
""")
-test.write("SConscript", """
-Import(['x', 'y'])
-assert x == 'x'
-assert y == 'zoom'
-""")
-
test.run(arguments = ".")
# Test exporting all global variables as a list of keys in SConscript call:
@@ -56,12 +57,6 @@ y = 'zoom'
SConscript('SConscript', globals().keys())
""")
-test.write("SConscript", """
-Import(['x', 'y'])
-assert x == 'x'
-assert y == 'zoom'
-""")
-
test.run(arguments = ".")
# Test exporting all global variables as a dictionary:
@@ -72,12 +67,6 @@ Export(globals())
SConscript('SConscript')
""")
-test.write("SConscript", """
-Import(['x', 'y'])
-assert x == 'x'
-assert y == 'zoom'
-""")
-
test.run(arguments = ".")
# Test exporting all global variables as dictionary in SConscript call:
@@ -87,10 +76,11 @@ y = 'zoom'
SConscript('SConscript', globals())
""")
-test.write("SConscript", """
-Import(['x', 'y'])
-assert x == 'x'
-assert y == 'zoom'
+test.run(arguments = ".")
+
+# Test exporting variables as keywords:
+test.write("SConstruct", """
+Export(x = 'x', y = 'zoom')
""")
test.run(arguments = ".")
@@ -106,12 +96,6 @@ f()
SConscript('SConscript')
""")
-test.write("SConscript", """
-Import(['x', 'y'])
-assert x == 'x'
-assert y == 'zoom'
-""")
-
test.run(arguments = ".")
# Test export of local variables in SConscript call:
@@ -123,12 +107,6 @@ def f():
f()
""")
-test.write("SConscript", """
-Import(['x', 'y'])
-assert x == 'x'
-assert y == 'zoom'
-""")
-
test.run(arguments = ".")
# Test export of local variables as a dictionary:
@@ -142,12 +120,6 @@ f()
SConscript('SConscript')
""")
-test.write("SConscript", """
-Import(['x', 'y'])
-assert x == 'x'
-assert y == 'zoom'
-""")
-
test.run(arguments = ".")
# Test importing all variables: