Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/startup_v1.py @ 32

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

updated boost from 1_33_1 to 1_34_1

File size: 2.8 KB
Line 
1#!/usr/bin/python
2
3# Copyright 2002 Dave Abrahams
4# Copyright 2003, 2004, 2005 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
8from BoostBuild import Tester
9import os
10import re
11
12def expect_substring(actual,expected):
13    return actual.find(expected) != -1
14
15def match_re(actual,expected):
16    return re.match(expected,actual,re.DOTALL) != None
17
18# Test the v1 startup behavior
19t = Tester(
20    executable='bjam'
21    , match=match_re
22    , boost_build_path=''
23    , pass_toolset=0
24    )
25
26t.set_tree('startup')
27
28#if os.name == 'nt':
29#    t.run_build_system(
30#        status=1, stdout="You didn't set BOOST_ROOT", match = expect_substring)
31
32t.run_build_system(
33    extra_args = '-sBOOST_ROOT=.', status=1
34    , stdout=r'''Unable to load Boost\.Build: could not find "boost-build\.jam".'''
35    )
36
37os.chdir('no-bootstrap1')
38
39t.run_build_system(
40    extra_args = '-sBOOST_ROOT=.', status=1
41    , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
42    + r'''.*attempted to load the build system by invoking'''
43    + r'''.*'boost-build ;'.*'''
44    + r'''but we were unable to find "bootstrap\.jam"'''
45    )
46
47# Descend to a subdirectory which /doesn't/ contain a boost-build.jam
48# file, and try again to test the crawl-up behavior.
49os.chdir('subdir')
50
51t.run_build_system(
52    extra_args = '-sBOOST_ROOT=.', status=1
53    , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
54    + r'''.*attempted to load the build system by invoking'''
55    + r'''.*'boost-build ;'.*'''
56    + r'''but we were unable to find "bootstrap\.jam"'''
57    )
58
59os.chdir('../../no-bootstrap2')
60
61t.run_build_system(
62    extra_args = '-sBOOST_ROOT=.', status=1
63    , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
64    + r'''.*attempted to load the build system by invoking'''
65    + r'''.*'boost-build \. ;'.*'''
66    + r'''but we were unable to find "bootstrap\.jam"'''
67    )
68
69os.chdir('../no-bootstrap3')
70
71t.run_build_system(
72    extra_args = '-sBOOST_ROOT=.', status=1
73    , stdout=r'''Unable to load Boost.Build
74.*boost-build.jam" was found.*
75However, it failed to call the "boost-build" rule'''
76    )
77
78# test bootstrapping based on BOOST_BUILD_PATH
79os.chdir('../bootstrap-env')
80t.run_build_system(
81    extra_args = '-sBOOST_ROOT=../boost-root -sBOOST_BUILD_PATH=../boost-root/build'
82    , stdout = 'build system bootstrapped'
83    )
84
85# test bootstrapping based on an explicit path in boost-build.jam
86os.chdir('../bootstrap-explicit')
87t.run_build_system(
88    extra_args = '-sBOOST_ROOT=../boost-root'
89    , stdout = 'build system bootstrapped'
90    )
91
92# test bootstrapping based on BOOST_ROOT
93os.chdir('../bootstrap-implicit')
94t.run_build_system(
95    extra_args = '-sBOOST_ROOT=../boost-root'
96    , stdout = 'build system bootstrapped'
97    )
98
99t.cleanup()
Note: See TracBrowser for help on using the repository browser.