_existsp = os.path.exists
def LinkFunc(target, source, env):
- src = str(source[0])
- dest = str(target[0])
+ src = source[0].path
+ dest = target[0].path
dir, file = os.path.split(dest)
if dir and not os.path.isdir(dir):
os.makedirs(dir)
bar51 = test.workpath('build', 'var5', 'bar1' + _exe)
bar52 = test.workpath('build', 'var5', 'bar2' + _exe)
-test.subdir('work1', 'work2')
+test.subdir('work1', 'work2', 'work3')
test.write(['work1', 'SConstruct'], """
src = Dir('src')
test.up_to_date(chdir='work2', arguments='.')
+test.write( ['work3', 'SConstruct'], """\
+SConscriptChdir(0)
+BuildDir('build', '.', duplicate=1 )
+SConscript( 'build/SConscript' )
+""")
+
+test.write( ['work3', 'SConscript'], """\
+import sys
+headers = ['existing.h', 'non_existing.h']
+for header in headers:
+ h = File( header )
+ contents = h.get_contents()
+ sys.stderr.write( '%s:%s\\n' % (header, contents))
+""")
+
+test.write( ['work3', 'existing.h'], """\
+/* a header file */\
+""")
+
+test.run(chdir='work3',
+ stdout=test.wrap_stdout('scons: "." is up to date.\n'),
+ stderr="""\
+existing.h:/* a header file */
+non_existing.h:
+""")
+
test.pass_test()
+