]>
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)
11 t
= BoostBuild
.Tester()
13 t
.write("jamroot.jam", """
15 cpp-pch pch : pch.hpp : <toolset>msvc:<source>pch.cpp <include>. ;
16 exe hello : hello.cpp pch : <include>. ;
19 t
.write("pch.hpp.bad", """
23 # Note that pch.hpp is written after pch.hpp.bad, so its timestamp will not be
24 # less than timestamp of pch.hpp.bad.
25 t
.write("pch.hpp", """
29 TestClass( int, int ) {}
33 t
.write("pch.cpp", """#include <pch.hpp>
36 t
.write("hello.cpp", """#include <pch.hpp>
37 int main() { TestClass c(1, 2); }
41 t
.expect_addition("bin/$toolset/debug/hello.exe")
44 # Now make the header unusable, without changing timestamp. If everything is OK,
45 # Boost.Build will not recreate PCH, and compiler will happily use pre-compiled
46 # header, not noticing that the real header is bad.
48 t
.copy_preserving_timestamp("pch.hpp.bad", "pch.hpp")
50 t
.rm("bin/$toolset/debug/hello.obj")
53 t
.expect_addition("bin/$toolset/debug/hello.obj")