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