summaryrefslogtreecommitdiffstats
path: root/test/option--implicit-cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/option--implicit-cache.py')
-rw-r--r--test/option--implicit-cache.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/option--implicit-cache.py b/test/option--implicit-cache.py
index fb5ace2..9a28271 100644
--- a/test/option--implicit-cache.py
+++ b/test/option--implicit-cache.py
@@ -72,6 +72,11 @@ r"""
#define BAR_STRING "include/bar.h 1\n"
""")
+test.write(['include', 'baz.h'],
+r"""
+#define BAZ_STRING "include/baz.h 1\n"
+""")
+
test.write(['subdir', 'prog.c'],
r"""
#include <foo.h>
@@ -134,6 +139,50 @@ test.run(program = test.workpath(variant_prog),
test.up_to_date(arguments = args)
+# Make sure that changing the order of includes causes rebuilds and
+# doesn't produce redundant rebuilds:
+test.write(['include', 'foo.h'],
+r"""
+#define FOO_STRING "include/foo.h 2\n"
+#include "bar.h"
+#include "baz.h"
+""")
+
+test.run(arguments = "--implicit-cache " + args)
+
+test.run(program = test.workpath(prog),
+ stdout = "subdir/prog.c\ninclude/foo.h 2\ninclude/bar.h 1\n")
+
+test.run(program = test.workpath(subdir_prog),
+ stdout = "subdir/prog.c\nsubdir/include/foo.h 1\nsubdir/include/bar.h 1\n")
+
+test.run(program = test.workpath(variant_prog),
+ stdout = "subdir/prog.c\ninclude/foo.h 2\ninclude/bar.h 1\n")
+
+test.up_to_date(arguments = args)
+
+test.write(['include', 'foo.h'],
+r"""
+#define FOO_STRING "include/foo.h 2\n"
+#include "baz.h"
+#include "bar.h"
+""")
+
+test.run(arguments = "--implicit-cache " + args)
+
+test.run(program = test.workpath(prog),
+ stdout = "subdir/prog.c\ninclude/foo.h 2\ninclude/bar.h 1\n")
+
+test.run(program = test.workpath(subdir_prog),
+ stdout = "subdir/prog.c\nsubdir/include/foo.h 1\nsubdir/include/bar.h 1\n")
+
+test.run(program = test.workpath(variant_prog),
+ stdout = "subdir/prog.c\ninclude/foo.h 2\ninclude/bar.h 1\n")
+
+test.up_to_date(arguments = args)
+
+
+
# Add inc2/foo.h that should shadow include/foo.h, but
# because of implicit dependency caching, scons doesn't
# detect this: