]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/python | |
2 | ||
3 | # Copyright 2004 Vladimir Prus | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
5 | # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) | |
6 | ||
7 | # Test that the user can define his own rule that will call built-in main target | |
8 | # rule and that this will work. | |
9 | ||
10 | import BoostBuild | |
11 | ||
12 | ||
13 | t = BoostBuild.Tester(use_test_config=False) | |
14 | ||
15 | t.write("jamfile.jam", """ | |
16 | my-test : test.cpp ; | |
17 | """) | |
18 | ||
19 | t.write("test.cpp", """ | |
20 | int main() {} | |
21 | """) | |
22 | ||
23 | t.write("jamroot.jam", """ | |
24 | using testing ; | |
25 | ||
26 | rule my-test ( name ? : sources + ) | |
27 | { | |
28 | name ?= test ; | |
29 | unit-test $(name) : $(sources) ; # /site-config//cppunit /util//testMain ; | |
30 | } | |
31 | ||
32 | IMPORT $(__name__) : my-test : : my-test ; | |
33 | """) | |
34 | ||
35 | t.run_build_system() | |
36 | t.expect_addition("bin/$toolset/debug*/test.passed") | |
37 | ||
38 | t.cleanup() |