print stderr
print "Actual STDERR ============"
print self.stderr()
+ print "STDOUT ==================="
+ print self.stdout()
raise TestFailed
def up_to_date(self, arguments = None, **kw):
+RELEASE 0.05 -
+
+ From Charles Crain:
+
+ - Allow a library to specified as a command-line source file, not just
+ in the LIBS construction variable.
+
+
+
RELEASE 0.04 - Wed, 30 Jan 2002 11:09:42 -0600
From Charles Crain:
BuilderBase.__init__(self, name, action, prefix, suffix, src_suffix,
node_factory, scanner)
self.src_builder = src_builder
+ self.dictSrcSuffix = {}
+ for suff in self.src_builder.src_suffixes():
+ self.dictSrcSuffix[suff] = None
def __call__(self, env, target = None, source = None):
slist = SCons.Util.scons_str2nodes(source, self.node_factory)
src_suffix = env.subst(self.src_suffix)
for snode in slist:
path, ext = os.path.splitext(snode.abspath)
- if not src_suffix or ext != src_suffix:
+ if self.dictSrcSuffix.has_key(ext):
tgt = self.src_builder(env, target = [ path ],
source=snode)
if not SCons.Util.is_List(tgt):
src_suffix='.bar',
suffix='.foo')
builder2 = SCons.Builder.MultiStepBuilder(name = "builder2",
- action='foo',
- src_builder = builder1)
+ action='bar',
+ src_builder = builder1,
+ src_suffix = '.foo')
tgt = builder2(env, target='baz', source='test.bar test2.foo test3.txt')
- flag = 0
- for snode in tgt.sources:
- if snode.path == 'test.foo':
- flag = 1
- assert snode.sources[0].path == 'test.bar'
- assert flag
-
+ assert str(tgt.sources[0]) == 'test.foo', str(tgt.sources[0])
+ assert str(tgt.sources[0].sources[0]) == 'test.bar', \
+ str(tgt.sources[0].sources[0])
+ assert str(tgt.sources[1]) == 'test2.foo', str(tgt.sources[1])
+ assert str(tgt.sources[2]) == 'test3.txt', str(tgt.sources[2])
+
def test_CompositeBuilder(self):
"""Testing CompositeBuilder class."""
builder = SCons.Builder.Builder(name = "builder",
test = TestSCons.TestSCons()
test.write('SConstruct', """
-env = Environment(LIBS = [ 'foo1', 'foo2', 'foo3' ],
+env = Environment(LIBS = [ 'foo1', 'foo2' ],
LIBPATH = [ '.' ])
env.Library(target = 'foo1', source = 'f1.c')
env.Library(target = 'foo2', source = 'f2a.c f2b.c f2c.c')
-env.Library(target = 'foo3', source = ['f3a.c', 'f3b.c', 'f3c.c'])
-env.Program(target = 'prog', source = 'prog.c')
+libtgt=env.Library(target = 'foo3', source = ['f3a.c', 'f3b.c', 'f3c.c'])
+env.Program(target = 'prog', source = [ 'prog.c', libtgt ])
""")
test.write('f1.c', r"""