]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/pch.py
3 # Copyright 2006 Vladimir Prus.
4 # Distributed under the Boost Software License, Version 1.0. (See
5 # accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
12 t
= BoostBuild
.Tester()
14 t
.write("jamroot.jam", """
16 cpp-pch pch : pch.hpp : <toolset>msvc:<source>pch.cpp <include>. ;
17 exe hello : hello.cpp pch : <include>. ;
20 t
.write("pch.hpp.bad", """
24 # Note that pch.hpp is written after pch.hpp.bad, so its timestamp will not be
25 # less than timestamp of pch.hpp.bad.
27 t
.write("pch.hpp", """
31 TestClass( int, int ) {}
35 t
.write("pch.cpp", """#include <pch.hpp>
38 t
.write("hello.cpp", """#include <pch.hpp>
39 int main() { TestClass c(1, 2); }
43 t
.expect_addition("bin/$toolset/debug*/hello.exe")
46 # Now make the header unusable, without changing timestamp. If everything is OK,
47 # Boost.Build will not recreate PCH, and compiler will happily use pre-compiled
48 # header, not noticing that the real header is bad.
50 t
.copy_preserving_timestamp("pch.hpp.bad", "pch.hpp")
52 t
.rm("bin/$toolset/debug/hello.obj")
53 t
.rm("bin/$toolset/debug/*/hello.obj")
56 t
.expect_addition("bin/$toolset/debug*/hello.obj")