diff options
author | Steven Knight <knight@baldmt.com> | 2001-12-20 04:40:12 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-12-20 04:40:12 (GMT) |
commit | 8526ba0bb9938ddf3ceca8ca917c77f7b1505f55 (patch) | |
tree | 724169956a0e4bef7a271ad4b46d8dca4cee3d2b /test/SConscript.py | |
parent | 98bdd799b0c61d2bf1004a9dc39976e4a31abc9c (diff) | |
download | SCons-8526ba0bb9938ddf3ceca8ca917c77f7b1505f55.zip SCons-8526ba0bb9938ddf3ceca8ca917c77f7b1505f55.tar.gz SCons-8526ba0bb9938ddf3ceca8ca917c77f7b1505f55.tar.bz2 |
Fix Export(), add Import() and Return()
Diffstat (limited to 'test/SConscript.py')
-rw-r--r-- | test/SConscript.py | 91 |
1 files changed, 90 insertions, 1 deletions
diff --git a/test/SConscript.py b/test/SConscript.py index b463f7e..5172040 100644 --- a/test/SConscript.py +++ b/test/SConscript.py @@ -30,16 +30,105 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ import os + print "SConstruct", os.getcwd() SConscript('SConscript') + +x1 = "SConstruct x1" +x2 = "SConstruct x2" +x3,x4 = SConscript('SConscript1', "x1 x2") +assert x3 == "SConscript1 x3" +assert x4 == "SConscript1 x4" + + +(x3,x4) = SConscript('SConscript2', ["x1","x2"]) +assert x3 == "SConscript2 x3" +assert x4 == "SConscript2 x4" + +Export("x1 x2") +SConscript('SConscript3') +Import("x1 x2") +assert x1 == "SConscript3 x1" +assert x2 == "SConscript3 x2" + +x1 = "SConstruct x1" +x2 = "SConstruct x2" +Export("x1","x2") +SConscript('SConscript4') +Import("x1"," x2") +assert x1 == "SConscript4 x1" +assert x2 == "SConscript4 x2" + """) -# XXX I THINK THEY SHOULD HAVE TO RE-IMPORT OS HERE test.write('SConscript', """ + +# os should not be automajically imported: +assert not globals().has_key("os") + import os print "SConscript " + os.getcwd() """) +test.write('SConscript1', """ +Import("x1 x2") +assert x1 == "SConstruct x1" +assert x2 == "SConstruct x2" + +x3 = "SConscript1 x3" +x4 = "SConscript1 x4" +Return("x3 x4") +""") + + + +test.write('SConscript2', """ +Import("x1","x2") +assert x1 == "SConstruct x1" +assert x2 == "SConstruct x2" +x3 = "SConscript2 x3" +x4 = "SConscript2 x4" +Return("x3","x4") +""") + +test.write('SConscript3', """ +Import("x1 x2") +assert x1 == "SConstruct x1" +assert x2 == "SConstruct x2" +x1 = "SConscript3 x1" +x2 = "SConscript3 x2" + +x5 = SConscript('SConscript31', "x1") +Import("x6") +assert x5 == "SConscript31 x5" +assert x6 == "SConscript31 x6" + +Export("x1 x2") + + +""") + +test.write('SConscript31', """ +Import("x1 x2") +assert x1 == "SConscript3 x1" +assert x2 == "SConstruct x2" +x5 = "SConscript31 x5" +x6 = "SConscript31 x6" +Export("x6") +Return("x5") +""") + + +test.write('SConscript4', """ +Import("x1", "x2") +assert x1 == "SConstruct x1" +assert x2 == "SConstruct x2" +x1 = "SConscript4 x1" +x2 = "SConscript4 x2" +Export("x1", "x2") +""") + + wpath = test.workpath() test.run(stdout = "SConstruct %s\nSConscript %s\n" % (wpath, wpath)) |