source = adjustixes(source, None, src_suf)
if target is None:
- target = map(lambda x, s=suf: os.path.splitext(x)[0] + s,
+ target = map(lambda x, s=suf:
+ os.path.splitext(os.path.split(str(x))[1])[0] + s,
source)
else:
target = adjustixes(target, pre, suf)
assert str(tgt[1].sources[0]) == 'h0.c', map(str, tgt[1].sources)
assert str(tgt[1].sources[1]) == 'h1.c', map(str, tgt[1].sources)
+ w = b(env, target='i0.w', source=['i0.x'])
+ y = b(env, target='i1.y', source=['i1.z'])
+ tgt = b(env, source=[w, y])
+ assert len(tgt) == 2, map(str, tgt)
+ assert str(tgt[0]) == 'i0.o'
+ assert str(tgt[1]) == 'i1.o'
+ assert len(tgt[0].sources) == 2, map(str, tgt[0].sources)
+ assert str(tgt[0].sources[0]) == 'i0.w', map(str, tgt[0].sources)
+ assert str(tgt[0].sources[1]) == 'i1.y', map(str, tgt[0].sources)
+ assert len(tgt[1].sources) == 2, map(str, tgt[1].sources)
+ assert str(tgt[1].sources[0]) == 'i0.w', map(str, tgt[1].sources)
+ assert str(tgt[1].sources[1]) == 'i1.y', map(str, tgt[1].sources)
+
if __name__ == "__main__":
suite = unittest.makeSuite(BuilderTestCase, 'test_')
b = Builder(action=cat, suffix='.out', src_suffix='.in')
env = Environment(BUILDERS={'Build':b})
env.Build('aaa.in')
+n = env.Build('bbb.in', 'bbb.input')
+env.Build(n)
""")
test.write(['subdir', 'aaa.in'], "subdir/aaa.in\n")
+test.write(['subdir', 'bbb.input'], "subdir/bbb.input\n")
#
test.run(arguments = '.')
test.fail_test(test.read(['subdir', 'aaa.out']) != "subdir/aaa.in\n")
+test.fail_test(test.read(['subdir', 'bbb.out']) != "subdir/bbb.input\n")
#
test.pass_test()