]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/regression.py
3 # Copyright (C) Vladimir Prus 2003.
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
8 # Test for the regression testing framework.
12 # Create a temporary working directory.
13 t
= BoostBuild
.Tester(use_test_config
=False)
15 t
.write("c.cpp", "\n")
20 int main( int ac, char * av[] )
23 for ( int i = 1; i < ac; ++i )
24 std::cout << av[ i ] << '\\n';
27 t
.write("c-f.cpp", "int\n")
28 t
.write("r-f.cpp", "int main() { return 1; }\n")
30 t
.write("jamroot.jam", "")
31 t
.write("jamfile.jam", """\
34 compile-fail c-f.cpp ;
35 run r.cpp libs//helper : foo bar ;
39 t
.write("libs/jamfile.jam", "lib helper : helper.cpp ;")
40 t
.write("libs/helper.cpp", """\
48 # First test that when outcomes are expected, all .test files are created.
49 t
.run_build_system(["hardcode-dll-paths=false"], stderr
=None, status
=None)
50 t
.expect_addition("bin/c.test/$toolset/debug*/c.test")
51 t
.expect_addition("bin/c-f.test/$toolset/debug*/c-f.test")
52 t
.expect_addition("bin/r.test/$toolset/debug*/r.test")
53 t
.expect_addition("bin/r-f.test/$toolset/debug*/r-f.test")
55 # Make sure args are handled.
56 t
.expect_content("bin/r.test/$toolset/debug*/r.output",
57 "foo\nbar\n*\nEXIT STATUS: 0*\n", True)
59 # Test that input file is handled as well.
63 int main( int ac, char * av[] )
65 for ( int i = 1; i < ac; ++i )
67 std::ifstream ifs( av[ i ] );
68 std::cout << ifs.rdbuf();
73 t
.write("dir/input.txt", "test input")
75 t
.write("jamfile.jam", """\
79 compile-fail c-f.cpp ;
80 run r.cpp : : dir/input.txt ;
83 time compilation : c-obj ;
86 t
.run_build_system(["hardcode-dll-paths=false"])
87 t
.expect_content("bin/r.test/$toolset/debug*/r.output", """\
92 t
.expect_addition('bin/$toolset/debug*/execution.time')
93 t
.expect_addition('bin/$toolset/debug*/compilation.time')
95 # Make sure test failures are detected. Reverse expectation and see if .test
96 # files are created or not.
97 t
.write("jamfile.jam", """\
101 run-fail r.cpp : : dir/input.txt ;
105 t
.touch(BoostBuild
.List("c.cpp c-f.cpp r.cpp r-f.cpp"))
107 t
.run_build_system(["hardcode-dll-paths=false"], stderr
=None, status
=1)
108 t
.expect_removal("bin/c.test/$toolset/debug*/c.test")
109 t
.expect_removal("bin/c-f.test/$toolset/debug*/c-f.test")
110 t
.expect_removal("bin/r.test/$toolset/debug*/r.test")
111 t
.expect_removal("bin/r-f.test/$toolset/debug*/r-f.test")