Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/pch.py @ 32

Last change on this file since 32 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.3 KB
Line 
1#!/usr/bin/python
2
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)
7
8from BoostBuild import Tester, List
9import string
10import os
11
12t = Tester()
13
14t.write("Jamroot", """
15
16import pch ;
17
18cpp-pch pch : pch.hpp : <toolset>msvc:<source>pch.cpp <include>. ;
19
20exe hello : hello.cpp pch : <include>. ;
21""")
22
23t.write("pch.hpp.bad", """
24THIS WON'T COMPILE
25""")
26
27# Note that pch.hpp is written after pch.hpp.bad, so its timestamp won't
28# be less than timestamp of pch.hpp.bad.
29t.write("pch.hpp", """
30class TestClass {
31public:
32    TestClass(int, int) {}
33};
34
35""")
36
37
38
39t.write("pch.cpp", """ #include <pch.hpp>
40
41""")
42
43t.write("hello.cpp", """ #include <pch.hpp>
44
45int main()
46{
47  TestClass c(1, 2);   
48  return 0;
49}
50
51""")
52
53t.run_build_system()
54
55t.expect_addition("bin/$toolset/debug/hello.exe")
56
57# Now make the header unusable, without changing timestamp.
58# If everything is OK, Boost.Build won't recreate PCH, and
59# compiler will happily use pre-compiled header, not noticing
60# that the real header is bad.
61
62t.copy_preserving_timestamp("pch.hpp.bad", "pch.hpp")
63
64t.rm("bin/$toolset/debug/hello.obj")
65
66t.run_build_system()
67t.expect_addition("bin/$toolset/debug/hello.obj")
68
69t.cleanup()
70
Note: See TracBrowser for help on using the repository browser.