Make env.SConscript() expand dirs names.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 25 May 2004 14:12:47 +0000 (14:12 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 25 May 2004 14:12:47 +0000 (14:12 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@987 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Script/SConscript.py
test/SConscript.py

index 405ce717ad5bd69512361b836ef4e694e713689e..81450e945140bb931c34ea22c52d866464e42b36 100644 (file)
@@ -493,6 +493,13 @@ class SConsEnvironment(SCons.Environment.Base):
         for key, val in kw.items():
             if SCons.Util.is_String(val):
                 val = self.subst(val)
+            elif SCons.Util.is_List(val):
+                result = []
+                for v in val:
+                    if SCons.Util.is_String(v):
+                        v = self.subst(v)
+                    result.append(v)
+                val = result
             subst_kw[key] = val
 
         files, exports = self._get_SConscript_filenames(ls, subst_kw)
index 69b7a822eaf3db5135b0726a6b423c58313578c1..e70fb362990ad8613ac5b81c3759c5ff5e6b8949 100644 (file)
@@ -364,24 +364,42 @@ test.run(arguments = ".",
                                    build_str = "scons: `.' is up to date.\n"))
 
 # Test calling SConscript through a construction environment.
-test.subdir('sub')
+test.subdir('sub1', 'sub2')
+
 test.write("SConstruct", """\
-env = Environment(SUBDIR='sub')
+env = Environment(SUB1='sub1', SUB2='sub2')
 print "SConstruct"
 x = 'xxx'
-env.Export("x")
-env.SConscript('$SUBDIR/SConscript')
+y = 'yyy'
+env.Export(["x", "y"])
+env.SConscript('$SUB1/SConscript')
+env.SConscript(dirs=['$SUB2'])
 """)
 
-test.write(['sub', 'SConscript'], """\
+test.write(['sub1', 'SConscript'], """\
 env = Environment()
 env.Import("x")
-print "sub/SConscript"
+print "sub1/SConscript"
 print "x =", x
 """)
 
+test.write(['sub2', 'SConscript'], """\
+env = Environment()
+env.Import("y")
+print "sub2/SConscript"
+print "y =", y
+""")
+
+expect = """\
+SConstruct
+sub1/SConscript
+x = xxx
+sub2/SConscript
+y = yyy
+"""
+
 test.run(arguments = ".",
-         stdout = test.wrap_stdout(read_str = "SConstruct\nsub/SConscript\nx = xxx\n",
+         stdout = test.wrap_stdout(read_str = expect,
                                    build_str = "scons: `.' is up to date.\n"))
 
 test.write("SConstruct", """\