summaryrefslogtreecommitdiffstats
path: root/test/option--implicit-cache.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-04-30 15:35:30 (GMT)
committerSteven Knight <knight@baldmt.com>2003-04-30 15:35:30 (GMT)
commit212d77d88aa4374ef13f2e6bc7edf3395ac9736c (patch)
tree464ca9fd18866613629e2381dfb6b93190a5e2e6 /test/option--implicit-cache.py
parent7ff542f3fb5b361087ef2738a82b5d849e005d45 (diff)
downloadSCons-212d77d88aa4374ef13f2e6bc7edf3395ac9736c.zip
SCons-212d77d88aa4374ef13f2e6bc7edf3395ac9736c.tar.gz
SCons-212d77d88aa4374ef13f2e6bc7edf3395ac9736c.tar.bz2
Provide uniform access to (some) command-line options. (Anthony Roach)
Diffstat (limited to 'test/option--implicit-cache.py')
-rw-r--r--test/option--implicit-cache.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/option--implicit-cache.py b/test/option--implicit-cache.py
index 0e5bf24..e959856 100644
--- a/test/option--implicit-cache.py
+++ b/test/option--implicit-cache.py
@@ -327,5 +327,52 @@ assert string.find(test.stdout(), 'is up to date') != -1, test.stdout()
test.run(arguments = "--implicit-deps-changed " + variant_prog)
assert string.find(test.stdout(), 'is up to date') == -1, test.stdout()
+# Test that Set/GetOption('implicit_cache') works:
+test.write('SConstruct', """
+assert not GetOption('implicit_cache')
+SetOption('implicit_cache', 1)
+assert GetOption('implicit_cache')
+""")
+
+test.run()
+
+test.write('SConstruct', """
+assert GetOption('implicit_cache')
+SetOption('implicit_cache', 0)
+assert GetOption('implicit_cache')
+""")
+
+test.run(arguments='--implicit-cache')
+
+# Test to make sure SetOption('implicit_cache', 1) actually enables implicit caching
+# by detecting the one case where implicit caching causes inaccurate builds:
+test.write('SConstruct', """
+SetOption('implicit_cache', 1)
+env=Environment(CPPPATH=['i1', 'i2'])
+env.Object('foo.c')
+""")
+
+test.subdir('i1')
+test.subdir('i2')
+
+test.write('foo.c', """
+#include <foo.h>
+
+int foo(void)
+{
+ FOO_H_DEFINED
+}
+""")
+
+test.write('i2/foo.h', """
+#define FOO_H_DEFINED int x = 1;
+""")
+
+test.run()
+
+test.write('i1/foo.h', """
+""");
+
+test.run()
test.pass_test()