diff options
Diffstat (limited to 'test/SConscript')
-rw-r--r-- | test/SConscript/variables.py | 52 |
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: |