tgt = env.Install('export', [ 'build/foo1', 'build/foo2' ])
paths = map(str, tgt)
paths.sort()
- assert paths == [ 'export/foo1', 'export/foo2' ], paths
+ expect = map(os.path.normpath, [ 'export/foo1', 'export/foo2' ])
+ assert paths == expect, paths
for tnode in tgt:
assert tnode.builder == InstallBuilder
dir.path_ = drive + dir.path_
dir.abspath = drive + dir.abspath
dir.abspath_ = drive + dir.abspath_
+ dir.srcpath = dir.path
return self.Root.setdefault(drive, dir)
if head:
# Recursively look up our parent directories.
f1 = fs.File('build/test1')
fs.BuildDir('build', 'src')
f2 = fs.File('build/test2')
- assert f1.srcpath == 'src/test1', f1.srcpath
- assert f2.srcpath == 'src/test2', f2.srcpath
+ assert f1.srcpath == os.path.normpath('src/test1'), f1.srcpath
+ assert f2.srcpath == os.path.normpath('src/test2'), f2.srcpath
fs = SCons.Node.FS.FS()
f1 = fs.File('build/test1')
fs.BuildDir('build/var2', 'src')
f1 = fs.File('build/var1/test1')
f2 = fs.File('build/var2/test1')
- assert f1.srcpath == 'src/test1', f1.srcpath
- assert f2.srcpath == 'src/test1', f2.srcpath
+ assert f1.srcpath == os.path.normpath('src/test1'), f1.srcpath
+ assert f2.srcpath == os.path.normpath('src/test1'), f2.srcpath
# Test to see if file_link() works...
test=TestCmd(workdir='')
}
""")
-test.write('src/f1.h', """
+test.write('src/f1.h', r"""
#define F1_STR "f1.c\n"
""")
-test.write('src/f2.h', """
+test.write('src/f2.h', r"""
#define F2_STR "f2.c\n"
""")
env.Install(dir='export', source=t)
""")
-test.write('f1.c', """
+test.write('f1.c', r"""
#include <stdio.h>
int main(void)
}
""")
-test.write('f2.c', """
+test.write('f2.c', r"""
#include <stdio.h>
int main(void)
oldtime1 = os.path.getmtime(foo1)
oldtime2 = os.path.getmtime(foo2)
-test.write('f1.c', """
+test.write('f1.c', r"""
#include <stdio.h>
int main(void)
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import os.path
+import string
import TestCmd
import TestSCons
bld = Builder(name = 'bld', action = '%s $SOURCES $TARGET')
env = Environment(BUILDERS = [bld])
env.bld(target = 'f1', source = 'f1.in')
-""" % os.path.normpath(no_such_file))
+""" % string.replace(no_such_file, '\\', '\\\\'))
test.run(arguments='-f SConstruct1 .',
stdout = "%s f1.in f1\n" % no_such_file,
bld = Builder(name = 'bld', action = '%s $SOURCES $TARGET')
env = Environment(BUILDERS = [bld])
env.bld(target = 'f2', source = 'f2.in')
-""" % os.path.normpath(not_executable))
+""" % string.replace(not_executable, '\\', '\\\\'))
if os.name == 'nt':
expect = """scons: %s: No such file or directory
bld = Builder(name = 'bld', action = '%s $SOURCES $TARGET')
env = Environment(BUILDERS = [bld])
env.bld(target = 'f3', source = 'f3.in')
-""" % os.path.normpath(test.workdir))
+""" % string.replace(test.workdir, '\\', '\\\\'))
test.run(arguments='-f SConstruct3 .',
stdout = "%s f3.in f3\n" % test.workdir,