summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-02-14 03:22:34 (GMT)
committerSteven Knight <knight@baldmt.com>2005-02-14 03:22:34 (GMT)
commit08d7c4cd103fb39b6010b980209a777ceea1ead2 (patch)
tree1fea16d051dcdb1147ced94deefb11fd31b151c5 /test
parent35451af4f3052befef3b41b3a971b3a8025b0577 (diff)
downloadSCons-08d7c4cd103fb39b6010b980209a777ceea1ead2.zip
SCons-08d7c4cd103fb39b6010b980209a777ceea1ead2.tar.gz
SCons-08d7c4cd103fb39b6010b980209a777ceea1ead2.tar.bz2
Don't read up entire directories to decide if an Alias is up-to-date.
Diffstat (limited to 'test')
-rw-r--r--test/DirSource.py103
-rw-r--r--test/option/debug-tree.py2
2 files changed, 84 insertions, 21 deletions
diff --git a/test/DirSource.py b/test/DirSource.py
index 84d8185..6d225c6 100644
--- a/test/DirSource.py
+++ b/test/DirSource.py
@@ -38,59 +38,124 @@ import TestSCons
test = TestSCons.TestSCons()
test.subdir('bsig', [ 'bsig', 'subdir' ],
- 'csig', [ 'csig', 'subdir' ])
-test.write([ 'bsig', 'foo.txt' ], 'foo.txt\n')
-test.write([ 'bsig', 'subdir', 'bar.txt'], 'bar.txt\n')
-test.write([ 'csig', 'foo.txt' ], 'foo.txt\n')
-test.write([ 'csig', 'subdir', 'bar.txt' ], 'bar.txt\n')
-test.write('junk.txt', 'junk.txt\n')
+ 'csig', [ 'csig', 'subdir' ],
+ 'cmd-bsig', [ 'cmd-bsig', 'subdir' ],
+ 'cmd-csig', [ 'cmd-csig', 'subdir' ])
-test.write('SConstruct',
-"""def writeTarget(target, source, env):
+test.write('SConstruct', """\
+def writeTarget(target, source, env):
f=open(str(target[0]), 'wb')
f.write("stuff\\n")
f.close()
return 0
-test_bld_dir = Builder(action=writeTarget, source_factory=Dir)
+test_bld_dir = Builder(action=writeTarget,
+ source_factory=Dir,
+ source_scanner=DirScanner)
test_bld_file = Builder(action=writeTarget)
-env_bsig = Environment()
-env_bsig['BUILDERS']['TestDir'] = test_bld_dir
-env_bsig['BUILDERS']['TestFile'] = test_bld_file
+env = Environment()
+env['BUILDERS']['TestDir'] = test_bld_dir
+env['BUILDERS']['TestFile'] = test_bld_file
+env_bsig = env.Copy()
env_bsig.TargetSignatures('build')
env_bsig.TestFile(source='junk.txt', target='bsig/junk.out')
env_bsig.TestDir(source='bsig', target='bsig.out')
+env_bsig.Command('cmd-bsig-noscan.out', 'cmd-bsig', writeTarget)
+env_bsig.Command('cmd-bsig.out', 'cmd-bsig', writeTarget,
+ source_scanner=DirScanner)
-env_csig = env_bsig.Copy()
+env_csig = env.Copy()
env_csig.TargetSignatures('content')
env_csig.TestFile(source='junk.txt', target='csig/junk.out')
env_csig.TestDir(source='csig', target='csig.out')
+env_csig.Command('cmd-csig-noscan.out', 'cmd-csig', writeTarget)
+env_csig.Command('cmd-csig.out', 'cmd-csig', writeTarget,
+ source_scanner=DirScanner)
""")
+test.write([ 'bsig', 'foo.txt' ], 'foo.txt 1\n')
+test.write([ 'bsig', 'subdir', 'bar.txt'], 'bar.txt 1\n')
+test.write([ 'csig', 'foo.txt' ], 'foo.txt 1\n')
+test.write([ 'csig', 'subdir', 'bar.txt' ], 'bar.txt 1\n')
+test.write([ 'cmd-bsig', 'foo.txt' ], 'foo.txt 1\n')
+test.write([ 'cmd-bsig', 'subdir', 'bar.txt' ], 'bar.txt 1\n')
+test.write([ 'cmd-csig', 'foo.txt' ], 'foo.txt 1\n')
+test.write([ 'cmd-csig', 'subdir', 'bar.txt' ], 'bar.txt 1\n')
+test.write('junk.txt', 'junk.txt\n')
+
test.run(arguments=".", stderr=None)
test.must_match('bsig.out', 'stuff\n')
test.must_match('csig.out', 'stuff\n')
+test.must_match('cmd-bsig.out', 'stuff\n')
+test.must_match('cmd-csig.out', 'stuff\n')
+test.must_match('cmd-bsig-noscan.out', 'stuff\n')
+test.must_match('cmd-csig-noscan.out', 'stuff\n')
test.up_to_date(arguments='bsig.out')
test.up_to_date(arguments='csig.out')
+test.up_to_date(arguments='cmd-bsig.out')
+test.up_to_date(arguments='cmd-csig.out')
+test.up_to_date(arguments='cmd-bsig-noscan.out')
+test.up_to_date(arguments='cmd-csig-noscan.out')
+
+test.write([ 'bsig', 'foo.txt' ], 'foo.txt 2\n')
+test.not_up_to_date(arguments='bsig.out')
-test.write([ 'bsig', 'foo.txt' ], 'foo2.txt\n')
+test.write([ 'bsig', 'new.txt' ], 'new.txt\n')
test.not_up_to_date(arguments='bsig.out')
-test.write([ 'csig', 'foo.txt' ], 'foo2.txt\n')
+test.write([ 'csig', 'foo.txt' ], 'foo.txt 2\n')
test.not_up_to_date(arguments='csig.out')
-test.write([ 'bsig', 'foo.txt' ], 'foo3.txt\n')
+test.write([ 'csig', 'new.txt' ], 'new.txt\n')
+test.not_up_to_date(arguments='csig.out')
+
+test.write([ 'cmd-bsig', 'foo.txt' ], 'foo.txt 2\n')
+test.not_up_to_date(arguments='cmd-bsig.out')
+test.up_to_date(arguments='cmd-bsig-noscan.out')
+
+test.write([ 'cmd-bsig', 'new.txt' ], 'new.txt\n')
+test.not_up_to_date(arguments='cmd-bsig.out')
+test.up_to_date(arguments='cmd-bsig-noscan.out')
+
+test.write([ 'cmd-csig', 'foo.txt' ], 'foo.txt 2\n')
+test.not_up_to_date(arguments='cmd-csig.out')
+test.up_to_date(arguments='cmd-csig-noscan.out')
+
+test.write([ 'cmd-csig', 'new.txt' ], 'new.txt\n')
+test.not_up_to_date(arguments='cmd-csig.out')
+test.up_to_date(arguments='cmd-csig-noscan.out')
+
+test.write([ 'bsig', 'subdir', 'bar.txt' ], 'bar.txt 2\n')
test.not_up_to_date(arguments='bsig.out')
-test.write([ 'bsig', 'subdir', 'bar.txt' ], 'bar2.txt\n')
+test.write([ 'bsig', 'subdir', 'new.txt' ], 'new.txt\n')
test.not_up_to_date(arguments='bsig.out')
-test.write([ 'csig', 'subdir', 'bar.txt' ], 'bar2.txt\n')
+test.write([ 'csig', 'subdir', 'bar.txt' ], 'bar.txt 2\n')
+test.not_up_to_date(arguments='csig.out')
+
+test.write([ 'csig', 'subdir', 'new.txt' ], 'new.txt\n')
test.not_up_to_date(arguments='csig.out')
-test.write('junk.txt', 'junk2.txt\n')
+test.write([ 'cmd-bsig', 'subdir', 'bar.txt' ], 'bar.txt 2\n')
+test.not_up_to_date(arguments='cmd-bsig.out')
+test.up_to_date(arguments='cmd-bsig-noscan.out')
+
+test.write([ 'cmd-bsig', 'subdir', 'new.txt' ], 'new.txt\n')
+test.not_up_to_date(arguments='cmd-bsig.out')
+test.up_to_date(arguments='cmd-bsig-noscan.out')
+
+test.write([ 'cmd-csig', 'subdir', 'bar.txt' ], 'bar.txt 2\n')
+test.not_up_to_date(arguments='cmd-csig.out')
+test.up_to_date(arguments='cmd-csig-noscan.out')
+
+test.write([ 'cmd-csig', 'subdir', 'new.txt' ], 'new.txt\n')
+test.not_up_to_date(arguments='cmd-csig.out')
+test.up_to_date(arguments='cmd-csig-noscan.out')
+
+test.write('junk.txt', 'junk.txt 2\n')
test.not_up_to_date(arguments='bsig.out')
# XXX For some reason, 'csig' is still reported as up to date.
# XXX Comment out this test until someone can look at it.
diff --git a/test/option/debug-tree.py b/test/option/debug-tree.py
index 4bb1229..e7847af 100644
--- a/test/option/debug-tree.py
+++ b/test/option/debug-tree.py
@@ -89,13 +89,11 @@ tree2 = """
+-.
+-SConstruct
+-bar.c
- +-bar.h
+-bar.ooo
| +-bar.c
| +-bar.h
| +-foo.h
+-foo.c
- +-foo.h
+-foo.ooo
| +-foo.c
| +-foo.h