1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright 2002 Dave Abrahams |
---|
4 | # Copyright 2003, 2004 Vladimir Prus |
---|
5 | # Distributed under the Boost Software License, Version 1.0. |
---|
6 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
---|
7 | |
---|
8 | from BoostBuild import Tester |
---|
9 | import os |
---|
10 | import re |
---|
11 | |
---|
12 | def match_re(actual,expected): |
---|
13 | return re.match(expected,actual,re.DOTALL) != None |
---|
14 | |
---|
15 | # Test the v1 startup behavior |
---|
16 | t = Tester( |
---|
17 | match= match_re |
---|
18 | , boost_build_path='' |
---|
19 | , pass_toolset=0 |
---|
20 | ) |
---|
21 | |
---|
22 | t.set_tree('startup') |
---|
23 | |
---|
24 | t.run_build_system( |
---|
25 | status=1, stdout=r'''Unable to load Boost\.Build: could not find "boost-build.jam" |
---|
26 | .*Attempted search from .* up to the root''', match = match_re) |
---|
27 | |
---|
28 | os.chdir('no-bootstrap1') |
---|
29 | |
---|
30 | t.run_build_system( |
---|
31 | status=1 |
---|
32 | , stdout=r'''Unable to load Boost\.Build: could not find build system\.''' |
---|
33 | + r'''.*attempted to load the build system by invoking''' |
---|
34 | + r'''.*'boost-build ;'.*''' |
---|
35 | + r'''but we were unable to find "bootstrap\.jam"''' |
---|
36 | ) |
---|
37 | |
---|
38 | # Descend to a subdirectory which /doesn't/ contain a boost-build.jam |
---|
39 | # file, and try again to test the crawl-up behavior. |
---|
40 | os.chdir('subdir') |
---|
41 | |
---|
42 | t.run_build_system( |
---|
43 | status=1 |
---|
44 | , stdout=r'''Unable to load Boost\.Build: could not find build system\.''' |
---|
45 | + r'''.*attempted to load the build system by invoking''' |
---|
46 | + r'''.*'boost-build ;'.*''' |
---|
47 | + r'''but we were unable to find "bootstrap\.jam"''' |
---|
48 | ) |
---|
49 | |
---|
50 | os.chdir('../../no-bootstrap2') |
---|
51 | |
---|
52 | t.run_build_system( |
---|
53 | status=1 |
---|
54 | , stdout=r'''Unable to load Boost\.Build: could not find build system\.''' |
---|
55 | + r'''.*attempted to load the build system by invoking''' |
---|
56 | + r'''.*'boost-build \. ;'.*''' |
---|
57 | + r'''but we were unable to find "bootstrap\.jam"''' |
---|
58 | ) |
---|
59 | |
---|
60 | os.chdir('../no-bootstrap3') |
---|
61 | |
---|
62 | t.run_build_system( |
---|
63 | status=1 |
---|
64 | , stdout=r'''Unable to load Boost.Build |
---|
65 | .*boost-build.jam" was found.* |
---|
66 | However, it failed to call the "boost-build" rule''' |
---|
67 | ) |
---|
68 | |
---|
69 | # test bootstrapping based on BOOST_BUILD_PATH |
---|
70 | os.chdir('../bootstrap-env') |
---|
71 | t.run_build_system( |
---|
72 | extra_args = '-sBOOST_BUILD_PATH=../boost-root/build' |
---|
73 | , stdout = 'build system bootstrapped' |
---|
74 | ) |
---|
75 | |
---|
76 | # test bootstrapping based on an explicit path in boost-build.jam |
---|
77 | os.chdir('../bootstrap-explicit') |
---|
78 | t.run_build_system( |
---|
79 | stdout = 'build system bootstrapped' |
---|
80 | ) |
---|
81 | |
---|
82 | t.cleanup() |
---|
83 | |
---|