summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-01-11 16:03:15 (GMT)
committerSteven Knight <knight@baldmt.com>2004-01-11 16:03:15 (GMT)
commit5bdf1b1d6be250335f01d86d917269aed6a26952 (patch)
tree3067e5d198248d3c8d124f43426bf995a24ffa4f /test
parent625c821133e9f75c2f5a8e0e91603c23a93250e7 (diff)
downloadSCons-5bdf1b1d6be250335f01d86d917269aed6a26952.zip
SCons-5bdf1b1d6be250335f01d86d917269aed6a26952.tar.gz
SCons-5bdf1b1d6be250335f01d86d917269aed6a26952.tar.bz2
Better error handling if someone tries to add a non-Node as a source, dependency or ignored dependency of a Node.
Diffstat (limited to 'test')
-rw-r--r--test/Depends.py14
-rw-r--r--test/Ignore.py14
-rw-r--r--test/Program.py13
3 files changed, 41 insertions, 0 deletions
diff --git a/test/Depends.py b/test/Depends.py
index 530c3c9..a7d1bdf 100644
--- a/test/Depends.py
+++ b/test/Depends.py
@@ -140,4 +140,18 @@ test.fail_test(test.read(['subdir', 'f4.out']) !=
test.fail_test(test.read('f5.out') != "f5.in\nsubdir/foo.dep 3\n")
test.fail_test(test.read(['sub2', 'f6.out']) != "f6.in 3\nsubdir/bar.dep 3\n")
+#
+test.write('SConstruct', """\
+env = Environment()
+file1 = File('file1')
+file2 = File('file2')
+env.Depends(file1, [[file2, 'file3']])
+""")
+
+test.run(status = 2, stderr = """
+scons: *** attempted to add a non-Node dependency to file1:
+\t['file2', 'file3'] is a <type 'list'>, not a Node
+File "SConstruct", line 4, in ?
+""")
+
test.pass_test()
diff --git a/test/Ignore.py b/test/Ignore.py
index 5e9650e..06db727 100644
--- a/test/Ignore.py
+++ b/test/Ignore.py
@@ -108,4 +108,18 @@ test.fail_test(test.read(['subdir', 'f3.out']) !=
test.up_to_date(arguments = '.')
+#
+test.write('SConstruct', """\
+env = Environment()
+file1 = File('file1')
+file2 = File('file2')
+env.Ignore(file1, [[file2, 'file3']])
+""")
+
+test.run(status = 2, stderr = """
+scons: *** attempted to ignore a non-Node dependency of file1:
+\t['file2', 'file3'] is a <type 'list'>, not a Node
+File "SConstruct", line 4, in ?
+""")
+
test.pass_test()
diff --git a/test/Program.py b/test/Program.py
index f231ac1..7c0eb46 100644
--- a/test/Program.py
+++ b/test/Program.py
@@ -327,4 +327,17 @@ test.fail_test(not (oldtime3 == os.path.getmtime(foo3)))
test.fail_test(not (oldtime4 == os.path.getmtime(foo4)))
test.fail_test(not (oldtime5 == os.path.getmtime(foo5)))
+#
+test.write('SConstruct', """\
+file1 = File('file1.c')
+file2 = File('file2.c')
+Program('foo', [file1, [file2, 'file3.c']])
+""")
+
+test.run(status = 2, stderr = """
+scons: *** attempted to add a non-Node as source of foo:
+\t['file2.c', 'file3.c'] is a <type 'list'>, not a Node
+File "SConstruct", line 3, in ?
+""")
+
test.pass_test()