Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/test/dependency_test.py @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/usr/bin/python
2
3from BoostBuild import Tester, List
4
5t = Tester()
6
7t.set_tree("dependency-test")
8t.run_build_system()
9# Check that main target 'c' was able to find 'x.h' from
10# 'a's dependency graph
11t.expect_addition("bin/$toolset/debug/c.exe")
12
13# Check handling of first level includes.
14
15# Both 'a' and 'b' include "a.h" and should be updated
16t.touch("a.h")
17t.run_build_system()
18
19t.expect_touch("bin/$toolset/debug/a.exe")
20t.expect_touch("bin/$toolset/debug/a.obj")
21t.expect_touch("bin/$toolset/debug/a_c.obj")
22t.expect_touch("bin/$toolset/debug/b.exe")
23t.expect_touch("bin/$toolset/debug/b.obj")
24# Now, <dependency> does not add dependency.
25# It sound weird, but is intentional. Need
26# to rename <dependency> eventually.
27#t.expect_touch("bin/$toolset/debug/main-target-c/c.exe")
28t.ignore("*.tds")
29t.expect_nothing_more()
30
31# Only 'a' include <a.h> and should be updated
32t.touch("src1/a.h")
33t.run_build_system()
34
35t.expect_touch("bin/$toolset/debug/a.exe")
36t.expect_touch("bin/$toolset/debug/a.obj")
37t.expect_touch("bin/$toolset/debug/a_c.obj")
38t.ignore("*.tds")
39t.expect_nothing_more()
40
41# "src/a.h" includes "b.h" (in the same dir)
42t.touch("src1/b.h")
43t.run_build_system()
44t.expect_touch("bin/$toolset/debug/a.exe")
45t.expect_touch("bin/$toolset/debug/a.obj")
46t.expect_touch("bin/$toolset/debug/a_c.obj")
47t.ignore("*.tds")
48t.expect_nothing_more()
49
50# included by "src/b.h". We had a bug: file included via "",
51# like "b.h" is in this case was not scanned at all.
52t.touch("src1/c.h")
53t.run_build_system()
54t.expect_touch("bin/$toolset/debug/a.exe")
55
56t.touch("b.h")
57t.run_build_system()
58t.expect_nothing_more()
59
60# Test dependency on generated header.
61# TODO: we have also to check that generated header is found correctly
62# if it is different for different subvariants. Lacking any toolset
63# support, this check will be implemented later.
64t.touch("x.foo")
65t.run_build_system()
66t.expect_touch("bin/$toolset/debug/a.obj")
67t.expect_touch("bin/$toolset/debug/a_c.obj")
68
69# Check that generated headers are scanned for dependencies as well
70t.touch("src1/z.h")
71t.run_build_system()
72t.expect_touch("bin/$toolset/debug/a.obj")
73t.expect_touch("bin/$toolset/debug/a_c.obj")
74
75t.cleanup()
Note: See TracBrowser for help on using the repository browser.