summaryrefslogtreecommitdiffstats
path: root/test/CPPPATH.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-11-22 14:10:14 (GMT)
committerSteven Knight <knight@baldmt.com>2001-11-22 14:10:14 (GMT)
commit139a0052dc0bff059dc9b8cf1739396304e7c129 (patch)
treeab6d8e92abb65f4f8a15bdd926bcbeedd038d04d /test/CPPPATH.py
parent872263c70af22c6dd1a1f4f0eb1445a2310a205b (diff)
downloadSCons-139a0052dc0bff059dc9b8cf1739396304e7c129.zip
SCons-139a0052dc0bff059dc9b8cf1739396304e7c129.tar.gz
SCons-139a0052dc0bff059dc9b8cf1739396304e7c129.tar.bz2
Complete CPPPATH work.
Diffstat (limited to 'test/CPPPATH.py')
-rw-r--r--test/CPPPATH.py40
1 files changed, 32 insertions, 8 deletions
diff --git a/test/CPPPATH.py b/test/CPPPATH.py
index 32c00b6..345603b 100644
--- a/test/CPPPATH.py
+++ b/test/CPPPATH.py
@@ -29,12 +29,13 @@ import TestSCons
test = TestSCons.TestSCons()
test.write('foo.c',
-"""#include "include/foo.h"
+"""#include "foo.h"
#include <stdio.h>
int main(void)
{
- printf(TEST_STRING);
+ printf(FOO_STRING);
+ printf(BAR_STRING);
return 0;
}
""")
@@ -43,29 +44,52 @@ test.subdir('include')
test.write('include/foo.h',
"""
-#define TEST_STRING "Bad news\n"
+#define FOO_STRING "foo.h 1\n"
+#include "bar.h"
+""")
+
+test.write('include/bar.h',
+"""
+#define BAR_STRING "bar.h 1\n"
""")
test.write('SConstruct', """
-env = Environment()
+env = Environment(CPPPATH = ['include'])
env.Program(target='prog', source='foo.c')
-#env.Depends(target='foo.c', dependency='include/foo.h')
""")
test.run(arguments = 'prog')
test.run(program = test.workpath('prog'),
- stdout = "Bad news\n")
+ stdout = "foo.h 1\nbar.h 1\n")
+
+test.up_to_date(arguments = 'prog')
test.unlink('include/foo.h')
test.write('include/foo.h',
"""
-#define TEST_STRING "Good news\n"
+#define FOO_STRING "foo.h 2\n"
+#include "bar.h"
""")
test.run(arguments = 'prog')
test.run(program = test.workpath('prog'),
- stdout = "Good news\n")
+ stdout = "foo.h 2\nbar.h 1\n")
+
+test.up_to_date(arguments = 'prog')
+
+test.unlink('include/bar.h')
+test.write('include/bar.h',
+"""
+#define BAR_STRING "bar.h 2\n"
+""")
+
+test.run(arguments = 'prog')
+
+test.run(program = test.workpath('prog'),
+ stdout = "foo.h 2\nbar.h 2\n")
+
+test.up_to_date(arguments = 'prog')
test.pass_test()