]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/python | |
2 | ||
3 | # Copyright 2008 Jurko Gospodnetic | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
5 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | # Tests different aspects of Boost Builds automated testing support. | |
8 | ||
9 | import BoostBuild | |
10 | ||
11 | ||
12 | ################################################################################ | |
13 | # | |
14 | # test_files_with_spaces_in_their_name() | |
15 | # -------------------------------------- | |
16 | # | |
17 | ################################################################################ | |
18 | ||
19 | def test_files_with_spaces_in_their_name(): | |
20 | """Regression test making sure test result files get created correctly when | |
21 | testing files with spaces in their name. | |
22 | """ | |
23 | ||
24 | t = BoostBuild.Tester(use_test_config=False) | |
25 | ||
26 | t.write("valid source.cpp", "int main() {}\n"); | |
27 | ||
28 | t.write("invalid source.cpp", "this is not valid source code"); | |
29 | ||
30 | t.write("jamroot.jam", """ | |
31 | import testing ; | |
32 | testing.compile "valid source.cpp" ; | |
33 | testing.compile-fail "invalid source.cpp" ; | |
34 | """) | |
35 | ||
36 | t.run_build_system(status=0) | |
37 | t.expect_addition("bin/invalid source.test/$toolset/debug*/invalid source.obj") | |
38 | t.expect_addition("bin/invalid source.test/$toolset/debug*/invalid source.test") | |
39 | t.expect_addition("bin/valid source.test/$toolset/debug*/valid source.obj") | |
40 | t.expect_addition("bin/valid source.test/$toolset/debug*/valid source.test") | |
41 | ||
42 | t.expect_content("bin/valid source.test/$toolset/debug*/valid source.test", \ | |
43 | "passed" ) | |
44 | t.expect_content( \ | |
45 | "bin/invalid source.test/$toolset/debug*/invalid source.test", \ | |
46 | "passed" ) | |
47 | t.expect_content( \ | |
48 | "bin/invalid source.test/$toolset/debug*/invalid source.obj", \ | |
49 | "failed as expected" ) | |
50 | ||
51 | t.cleanup() | |
52 | ||
53 | ||
54 | ################################################################################ | |
55 | # | |
56 | # main() | |
57 | # ------ | |
58 | # | |
59 | ################################################################################ | |
60 | ||
61 | test_files_with_spaces_in_their_name() |