summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-10-19 06:36:57 (GMT)
committerSteven Knight <knight@baldmt.com>2002-10-19 06:36:57 (GMT)
commit276f24218f1e730fed31fa9f9072cdd464adb7b3 (patch)
tree278e8603a6c798f3ecb244d75105da3ab3449825 /test
parent24f95ab2762edefba6fc7afd3a302c2d2d69c5e1 (diff)
downloadSCons-276f24218f1e730fed31fa9f9072cdd464adb7b3.zip
SCons-276f24218f1e730fed31fa9f9072cdd464adb7b3.tar.gz
SCons-276f24218f1e730fed31fa9f9072cdd464adb7b3.tar.bz2
Fixes for tests following the Repository/BuildDir refactoring. (Charles Crain).
Diffstat (limited to 'test')
-rw-r--r--test/BuildDir.py33
-rw-r--r--test/CPPPATH.py4
-rw-r--r--test/Repository/BuildDir.py52
-rw-r--r--test/option--U.py2
-rw-r--r--test/option--implicit-cache.py2
5 files changed, 59 insertions, 34 deletions
diff --git a/test/BuildDir.py b/test/BuildDir.py
index 349ed51..e4c6943 100644
--- a/test/BuildDir.py
+++ b/test/BuildDir.py
@@ -80,11 +80,11 @@ var6 = Dir('../build/var6')
BuildDir('build/var1', src)
-BuildDir(var2, src, duplicate=0)
-BuildDir(var3, src)
+BuildDir(var2, src)
+BuildDir(var3, src, duplicate=0)
BuildDir(var4, src, duplicate=0)
-BuildDir(var5, src)
-BuildDir(var6, src, duplicate=0)
+BuildDir(var5, src, duplicate=0)
+BuildDir(var6, src)
env = Environment(CPPPATH='#src', F77PATH='#src')
SConscript('build/var1/SConscript', "env")
@@ -256,6 +256,31 @@ def equal_stats(x,y):
return (stat.S_IMODE(x[stat.ST_MODE]) == stat.S_IMODE(y[stat.ST_MODE]) and
x[stat.ST_MTIME] == y[stat.ST_MTIME])
+# Make sure we did duplicate the source files in build/var2,
+# and that their stats are the same:
+test.fail_test(not os.path.exists(test.workpath('test', 'build', 'var2', 'f1.c')))
+test.fail_test(not os.path.exists(test.workpath('test', 'build', 'var2', 'f2.in')))
+test.fail_test(not equal_stats(test.workpath('test', 'build', 'var2', 'f1.c'), test.workpath('test', 'src', 'f1.c')))
+test.fail_test(not equal_stats(test.workpath('test', 'build', 'var2', 'f2.in'), test.workpath('test', 'src', 'f2.in')))
+
+# Make sure we didn't duplicate the source files in build/var3.
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var3', 'f1.c')))
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var3', 'f2.in')))
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var3', 'b1.f')))
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var3', 'b2.in')))
+
+# Make sure we didn't duplicate the source files in build/var4.
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var4', 'f1.c')))
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var4', 'f2.in')))
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var4', 'b1.f')))
+test.fail_test(os.path.exists(test.workpath('test', 'build', 'var4', 'b2.in')))
+
+# Make sure we didn't duplicate the source files in build/var5.
+test.fail_test(os.path.exists(test.workpath('build', 'var5', 'f1.c')))
+test.fail_test(os.path.exists(test.workpath('build', 'var5', 'f2.in')))
+test.fail_test(os.path.exists(test.workpath('build', 'var5', 'b1.f')))
+test.fail_test(os.path.exists(test.workpath('build', 'var5', 'b2.in')))
+
# verify that header files in the source directory are scanned properly:
test.write(['test', 'src', 'f1.h'], r"""
#define F1_STR "f1.c 2\n"
diff --git a/test/CPPPATH.py b/test/CPPPATH.py
index 45216c8..a2cae10 100644
--- a/test/CPPPATH.py
+++ b/test/CPPPATH.py
@@ -49,7 +49,7 @@ obj = env.Object(target='foobar/prog', source='subdir/prog.c')
env.Program(target='prog', source=obj)
SConscript('subdir/SConscript', "env")
-BuildDir('variant', 'subdir', duplicate=0)
+BuildDir('variant', 'subdir', 0)
include = Dir('include')
env = Environment(CPPPATH=[include])
SConscript('variant/SConscript', "env")
@@ -168,7 +168,7 @@ obj = env.Object(target='foobar/prog', source='subdir/prog.c')
env.Program(target='prog', source=obj)
SConscript('subdir/SConscript', "env")
-BuildDir('variant', 'subdir')
+BuildDir('variant', 'subdir', 0)
include = Dir('include')
env = Environment(CPPPATH=['inc2', include])
SConscript('variant/SConscript', "env")
diff --git a/test/Repository/BuildDir.py b/test/Repository/BuildDir.py
index 905c618..6687937 100644
--- a/test/Repository/BuildDir.py
+++ b/test/Repository/BuildDir.py
@@ -38,8 +38,8 @@ opts = "-Y " + test.workpath('repository')
#
test.write(['repository', 'SConstruct'], r"""
-BuildDir('build0', 'src')
-BuildDir('build1', 'src', duplicate=0)
+BuildDir('build0', 'src', duplicate=0)
+BuildDir('build1', 'src', duplicate=1)
SConscript('build0/SConscript')
SConscript('build1/SConscript')
""")
@@ -78,9 +78,9 @@ repository/src/bbb.in
repository/src/ccc.in
""")
-test.fail_test(not os.path.exists('work1/build0/aaa.in'))
-test.fail_test(not os.path.exists('work1/build0/bbb.in'))
-test.fail_test(not os.path.exists('work1/build0/ccc.in'))
+test.fail_test(os.path.exists('work1/build0/aaa.in'))
+test.fail_test(os.path.exists('work1/build0/bbb.in'))
+test.fail_test(os.path.exists('work1/build0/ccc.in'))
test.fail_test(not os.path.exists('work1/build0/aaa.mid'))
test.fail_test(not os.path.exists('work1/build0/bbb.mid'))
test.fail_test(not os.path.exists('work1/build0/ccc.mid'))
@@ -91,9 +91,9 @@ repository/src/bbb.in
repository/src/ccc.in
""")
-test.fail_test(os.path.exists('work1/build1/aaa.in'))
-test.fail_test(os.path.exists('work1/build1/bbb.in'))
-test.fail_test(os.path.exists('work1/build1/ccc.in'))
+test.fail_test(not os.path.exists('work1/build1/aaa.in'))
+test.fail_test(not os.path.exists('work1/build1/bbb.in'))
+test.fail_test(not os.path.exists('work1/build1/ccc.in'))
test.fail_test(not os.path.exists('work1/build1/aaa.mid'))
test.fail_test(not os.path.exists('work1/build1/bbb.mid'))
test.fail_test(not os.path.exists('work1/build1/ccc.mid'))
@@ -111,9 +111,9 @@ work1/src/bbb.in
repository/src/ccc.in
""")
-test.fail_test(not os.path.exists('work1/build0/aaa.in'))
-test.fail_test(not os.path.exists('work1/build0/bbb.in'))
-test.fail_test(not os.path.exists('work1/build0/ccc.in'))
+test.fail_test(os.path.exists('work1/build0/aaa.in'))
+test.fail_test(os.path.exists('work1/build0/bbb.in'))
+test.fail_test(os.path.exists('work1/build0/ccc.in'))
test.fail_test(not os.path.exists('work1/build0/aaa.mid'))
test.fail_test(not os.path.exists('work1/build0/bbb.mid'))
test.fail_test(not os.path.exists('work1/build0/ccc.mid'))
@@ -124,9 +124,9 @@ work1/src/bbb.in
repository/src/ccc.in
""")
-test.fail_test(os.path.exists('work1/build1/aaa.in'))
-test.fail_test(os.path.exists('work1/build1/bbb.in'))
-test.fail_test(os.path.exists('work1/build1/ccc.in'))
+test.fail_test(not os.path.exists('work1/build1/aaa.in'))
+test.fail_test(not os.path.exists('work1/build1/bbb.in'))
+test.fail_test(not os.path.exists('work1/build1/ccc.in'))
test.fail_test(not os.path.exists('work1/build1/aaa.mid'))
test.fail_test(not os.path.exists('work1/build1/bbb.mid'))
test.fail_test(not os.path.exists('work1/build1/ccc.mid'))
@@ -144,17 +144,17 @@ test.writable('repository', 0)
#
test.run(chdir = 'work2', options = opts, arguments = '.')
-test.fail_test(not os.path.exists('work2/build0/aaa.in'))
-test.fail_test(not os.path.exists('work2/build0/bbb.in'))
-test.fail_test(not os.path.exists('work2/build0/ccc.in'))
+test.fail_test(os.path.exists('work2/build0/aaa.in'))
+test.fail_test(os.path.exists('work2/build0/bbb.in'))
+test.fail_test(os.path.exists('work2/build0/ccc.in'))
test.fail_test(os.path.exists('work2/build0/aaa.mid'))
test.fail_test(os.path.exists('work2/build0/bbb.mid'))
test.fail_test(os.path.exists('work2/build0/ccc.mid'))
test.fail_test(os.path.exists('work2/build0/output'))
-test.fail_test(os.path.exists('work2/build1/aaa.in'))
-test.fail_test(os.path.exists('work2/build1/bbb.in'))
-test.fail_test(os.path.exists('work2/build1/ccc.in'))
+test.fail_test(not os.path.exists('work2/build1/aaa.in'))
+test.fail_test(not os.path.exists('work2/build1/bbb.in'))
+test.fail_test(not os.path.exists('work2/build1/ccc.in'))
test.fail_test(os.path.exists('work2/build1/aaa.mid'))
test.fail_test(os.path.exists('work2/build1/bbb.mid'))
test.fail_test(os.path.exists('work2/build1/ccc.mid'))
@@ -173,9 +173,9 @@ work2/src/bbb.in
repository/src/ccc.in
""")
-test.fail_test(not os.path.exists('work2/build0/aaa.in'))
-test.fail_test(not os.path.exists('work2/build0/bbb.in'))
-test.fail_test(not os.path.exists('work2/build0/ccc.in'))
+test.fail_test(os.path.exists('work2/build0/aaa.in'))
+test.fail_test(os.path.exists('work2/build0/bbb.in'))
+test.fail_test(os.path.exists('work2/build0/ccc.in'))
test.fail_test(os.path.exists('work2/build0/aaa.mid'))
test.fail_test(not os.path.exists('work2/build0/bbb.mid'))
test.fail_test(os.path.exists('work2/build0/ccc.mid'))
@@ -186,9 +186,9 @@ work2/src/bbb.in
repository/src/ccc.in
""")
-test.fail_test(os.path.exists('work2/build1/aaa.in'))
-test.fail_test(os.path.exists('work2/build1/bbb.in'))
-test.fail_test(os.path.exists('work2/build1/ccc.in'))
+test.fail_test(not os.path.exists('work2/build1/aaa.in'))
+test.fail_test(not os.path.exists('work2/build1/bbb.in'))
+test.fail_test(not os.path.exists('work2/build1/ccc.in'))
test.fail_test(os.path.exists('work2/build1/aaa.mid'))
test.fail_test(not os.path.exists('work2/build1/bbb.mid'))
test.fail_test(os.path.exists('work2/build1/ccc.mid'))
diff --git a/test/option--U.py b/test/option--U.py
index 0160015..23e82b1 100644
--- a/test/option--U.py
+++ b/test/option--U.py
@@ -52,7 +52,7 @@ Default(env.B(target = 'sub1/foo.out', source = 'sub1/foo.in'))
Export('env')
SConscript('sub2/SConscript')
Default(env.B(target = 'sub3/baz.out', source = 'sub3/baz.in'))
-BuildDir('sub2b', 'sub2', duplicate=0)
+BuildDir('sub2b', 'sub2')
SConscript('sub2b/SConscript')
Default(env.B(target = 'sub2/xxx.out', source = 'xxx.in'))
SConscript('SConscript')
diff --git a/test/option--implicit-cache.py b/test/option--implicit-cache.py
index 186b637..4e5cf1e 100644
--- a/test/option--implicit-cache.py
+++ b/test/option--implicit-cache.py
@@ -52,7 +52,7 @@ obj = env.Object(target='prog', source='subdir/prog.c')
env.Program(target='prog', source=obj)
SConscript('subdir/SConscript', "env")
-BuildDir('variant', 'subdir')
+BuildDir('variant', 'subdir', 0)
include = Dir('include')
env = Environment(CPPPATH=['inc2', include])
SConscript('variant/SConscript', "env")