diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/tools/build/test/copy_time.py | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/tools/build/test/copy_time.py')
-rwxr-xr-x | src/boost/tools/build/test/copy_time.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/boost/tools/build/test/copy_time.py b/src/boost/tools/build/test/copy_time.py new file mode 100755 index 000000000..a036fe62b --- /dev/null +++ b/src/boost/tools/build/test/copy_time.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# Copyright (c) 2008 Steven Watanabe +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test that the common.copy rule set the modification date of the new file to +# the current time. + +import BoostBuild + +tester = BoostBuild.Tester(use_test_config=False) + +tester.write("test1.cpp", """\ +template<bool, int M, class Next> +struct time_waster { + typedef typename time_waster<true, M-1, time_waster>::type type1; + typedef typename time_waster<false, M-1, time_waster>::type type2; + typedef void type; +}; +template<bool B, class Next> +struct time_waster<B, 0, Next> { + typedef void type; +}; +typedef time_waster<true, 10, void>::type type; +int f() { return 0; } +""") + +tester.write("test2.cpp", """\ +template<bool, int M, class Next> +struct time_waster { + typedef typename time_waster<true, M-1, time_waster>::type type1; + typedef typename time_waster<false, M-1, time_waster>::type type2; + typedef void type; +}; +template<bool B, class Next> +struct time_waster<B, 0, Next> { + typedef void type; +}; +typedef time_waster<true, 10, void>::type type; +int g() { return 0; } +""") + +tester.write("jamroot.jam", """\ +obj test2 : test2.cpp ; +obj test1 : test1.cpp : <dependency>test2 ; +install test2i : test2 : <dependency>test1 ; +""") + +tester.run_build_system() +tester.expect_addition("bin/$toolset/debug*/test2.obj") +tester.expect_addition("bin/$toolset/debug*/test1.obj") +tester.expect_addition("test2i/test2.obj") +tester.expect_nothing_more() + +test2src = tester.read("test2i/test2.obj", binary=True) +test2dest = tester.read("bin/$toolset/debug*/test2.obj", binary=True) +if test2src != test2dest: + BoostBuild.annotation("failure", "The object file was not copied " + "correctly") + tester.fail_test(1) + +tester.run_build_system(["-d1"]) +tester.expect_output_lines("common.copy*", False) +tester.expect_nothing_more() + +tester.cleanup() |