1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright 2002 Dave Abrahams |
---|
4 | # Copyright 2002, 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 | |
---|
11 | t = Tester("--build-system=project-test1", boost_build_path='', pass_toolset=0) |
---|
12 | |
---|
13 | # This test does no modifications, so run in in the invocation dir |
---|
14 | |
---|
15 | os.chdir(t.original_workdir) |
---|
16 | |
---|
17 | |
---|
18 | expected_output1="""Project Roots: |
---|
19 | |
---|
20 | """ |
---|
21 | |
---|
22 | expected_output2="""'%(root-dir-prefix)sdir2': |
---|
23 | |
---|
24 | Module for project-root is 'project-root<%(root-dir-prefix)sdir2>' |
---|
25 | |
---|
26 | Projects: |
---|
27 | |
---|
28 | '/cool-library': |
---|
29 | |
---|
30 | * Parent project: (none) |
---|
31 | * Requirements: <include>/home/ghost/build/boost-cvs |
---|
32 | * Default build: |
---|
33 | * Source location: %(root-dir-prefix)sdir2 |
---|
34 | * Projects to build: |
---|
35 | |
---|
36 | """ |
---|
37 | |
---|
38 | expected_output3="""'%(root-dir)s': |
---|
39 | |
---|
40 | Module for project-root is 'project-root<%(root-dir)s>' |
---|
41 | |
---|
42 | Projects: |
---|
43 | |
---|
44 | '/boost-build-test-project-1': |
---|
45 | |
---|
46 | * Parent project: (none) |
---|
47 | * Requirements: <include>/home/ghost/local/include <threading>multi |
---|
48 | * Default build: |
---|
49 | * Source location: %(root-dir)s |
---|
50 | * Projects to build: dir dir2 |
---|
51 | |
---|
52 | '/boost-build-test-project-1/dir': |
---|
53 | |
---|
54 | * Parent project: %(root-dir)s |
---|
55 | * Requirements: <include>/home/ghost/local/include <threading>multi |
---|
56 | * Default build: <variant>release |
---|
57 | * Source location: %(root-dir-prefix)sdir/src |
---|
58 | * Projects to build: |
---|
59 | |
---|
60 | """ |
---|
61 | |
---|
62 | # Test that correct project structure is created when jam is invoked |
---|
63 | # outside of the source tree. |
---|
64 | expected = (expected_output1 + expected_output2 + expected_output3) % \ |
---|
65 | {"root-dir": "project-test1", |
---|
66 | "root-dir-prefix": "project-test1/" } |
---|
67 | |
---|
68 | t.run_build_system(stdout=expected) |
---|
69 | |
---|
70 | # Test that correct project structure is created when jam is invoked |
---|
71 | # at the top of the source tree. |
---|
72 | expected = (expected_output1 + expected_output3 + expected_output2) % \ |
---|
73 | {"root-dir": ".", |
---|
74 | "root-dir-prefix": "" } |
---|
75 | |
---|
76 | os.chdir("project-test1") |
---|
77 | t.run_build_system(stdout=expected) |
---|
78 | |
---|
79 | t.cleanup() |
---|