MCPcopy Create free account
hub / github.com/boostorg/build / test_alias_rule

Function test_alias_rule

test/alias.py:18–55  ·  view source on GitHub ↗

Basic alias rule test.

(t)

Source from the content-addressed store, hash-verified

16###############################################################################
17
18def test_alias_rule(t):
19 """Basic alias rule test."""
20
21 t.write("jamroot.jam", """\
22exe a : a.cpp ;
23exe b : b.cpp ;
24exe c : c.cpp ;
25
26alias bin1 : a ;
27alias bin2 : a b ;
28
29alias src : s.cpp ;
30exe hello : hello.cpp src ;
31""")
32
33 t.write("a.cpp", "int main() {}\n")
34 t.copy("a.cpp", "b.cpp")
35 t.copy("a.cpp", "c.cpp")
36 t.copy("a.cpp", "hello.cpp")
37 t.write("s.cpp", "")
38
39 # Check that targets to which "bin1" refers are updated, and only those.
40 t.run_build_system(["bin1"])
41 t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "a.exe a.obj")
42 t.expect_nothing_more()
43
44 # Try again with "bin2"
45 t.run_build_system(["bin2"])
46 t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "b.exe b.obj")
47 t.expect_nothing_more()
48
49 # Try building everything, making sure 'hello' target is created.
50 t.run_build_system()
51 t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * \
52 "hello.exe hello.obj")
53 t.expect_addition("bin/$toolset/debug/s.obj")
54 t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "c.exe c.obj")
55 t.expect_nothing_more()
56
57
58###############################################################################

Callers 1

alias.pyFile · 0.85

Calls 5

copyMethod · 0.80
run_build_systemMethod · 0.80
expect_additionMethod · 0.80
expect_nothing_moreMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected