diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/boost/tools/build/test/startup | |
parent | Initial commit. (diff) | |
download | ceph-upstream/18.2.2.tar.xz ceph-upstream/18.2.2.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
11 files changed, 154 insertions, 0 deletions
diff --git a/src/boost/tools/build/test/startup/boost-root/boost-build.jam b/src/boost/tools/build/test/startup/boost-root/boost-build.jam new file mode 100644 index 000000000..19f9df3c5 --- /dev/null +++ b/src/boost/tools/build/test/startup/boost-root/boost-build.jam @@ -0,0 +1,7 @@ +# Copyright 2002 Dave Abrahams +# Copyright 2004 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +# Emulate v1 behavior; with the boost-build file in the boost root directory. +boost-build build ; diff --git a/src/boost/tools/build/test/startup/boost-root/build/boost-build.jam b/src/boost/tools/build/test/startup/boost-root/build/boost-build.jam new file mode 100644 index 000000000..eb2f7970b --- /dev/null +++ b/src/boost/tools/build/test/startup/boost-root/build/boost-build.jam @@ -0,0 +1,6 @@ +# Copyright 2004 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +# The presence of this file emulates the Boost 1.27.0 release +include $(BOOST_ROOT)/tools/build/bootstrap.jam ; diff --git a/src/boost/tools/build/test/startup/boost-root/build/bootstrap.jam b/src/boost/tools/build/test/startup/boost-root/build/bootstrap.jam new file mode 100644 index 000000000..982be4a6e --- /dev/null +++ b/src/boost/tools/build/test/startup/boost-root/build/bootstrap.jam @@ -0,0 +1,7 @@ +# Copyright 2004 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +ECHO build system bootstrapped ; +DEPENDS all : nothing ; +NOTFILE nothing ; diff --git a/src/boost/tools/build/test/startup/bootstrap-env/boost-build.jam b/src/boost/tools/build/test/startup/bootstrap-env/boost-build.jam new file mode 100644 index 000000000..1835ce1ba --- /dev/null +++ b/src/boost/tools/build/test/startup/bootstrap-env/boost-build.jam @@ -0,0 +1,5 @@ +# Copyright 2002 Dave Abrahams +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +boost-build ; diff --git a/src/boost/tools/build/test/startup/bootstrap-explicit/boost-build.jam b/src/boost/tools/build/test/startup/bootstrap-explicit/boost-build.jam new file mode 100644 index 000000000..571077851 --- /dev/null +++ b/src/boost/tools/build/test/startup/bootstrap-explicit/boost-build.jam @@ -0,0 +1,6 @@ +# Copyright 2002 Dave Abrahams +# Copyright 2004 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +boost-build ../boost-root/build ; diff --git a/src/boost/tools/build/test/startup/bootstrap-implicit/readme.txt b/src/boost/tools/build/test/startup/bootstrap-implicit/readme.txt new file mode 100644 index 000000000..0278716e5 --- /dev/null +++ b/src/boost/tools/build/test/startup/bootstrap-implicit/readme.txt @@ -0,0 +1,5 @@ +Copyright 2002 Dave Abrahams +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +This file is only here so that cvs update -P won't fail to create a directory diff --git a/src/boost/tools/build/test/startup/no-bootstrap1/boost-build.jam b/src/boost/tools/build/test/startup/no-bootstrap1/boost-build.jam new file mode 100644 index 000000000..d98b5cdfa --- /dev/null +++ b/src/boost/tools/build/test/startup/no-bootstrap1/boost-build.jam @@ -0,0 +1,6 @@ +# Copyright 2002 Dave Abrahams +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +# Bootstrap file not found via implicit lookup in BOOST_BUILD_PATH +boost-build ; diff --git a/src/boost/tools/build/test/startup/no-bootstrap1/subdir/readme.txt b/src/boost/tools/build/test/startup/no-bootstrap1/subdir/readme.txt new file mode 100644 index 000000000..00f428d44 --- /dev/null +++ b/src/boost/tools/build/test/startup/no-bootstrap1/subdir/readme.txt @@ -0,0 +1,5 @@ +Copyright 2002 Dave Abrahams +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +This file is only here so cvs update -P will create the directory. diff --git a/src/boost/tools/build/test/startup/no-bootstrap2/boost-build.jam b/src/boost/tools/build/test/startup/no-bootstrap2/boost-build.jam new file mode 100644 index 000000000..dffe883e2 --- /dev/null +++ b/src/boost/tools/build/test/startup/no-bootstrap2/boost-build.jam @@ -0,0 +1,6 @@ +# Copyright 2002 Dave Abrahams +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +# Bootstrap file not found via explicit lookup in . +boost-build . ; diff --git a/src/boost/tools/build/test/startup/no-bootstrap3/boost-build.jam b/src/boost/tools/build/test/startup/no-bootstrap3/boost-build.jam new file mode 100644 index 000000000..9b4dceb22 --- /dev/null +++ b/src/boost/tools/build/test/startup/no-bootstrap3/boost-build.jam @@ -0,0 +1,5 @@ +# Copyright 2002 Dave Abrahams +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +# Call to boost-build is intentionally missing diff --git a/src/boost/tools/build/test/startup_v2.py b/src/boost/tools/build/test/startup_v2.py new file mode 100644 index 000000000..0cd7ef3c3 --- /dev/null +++ b/src/boost/tools/build/test/startup_v2.py @@ -0,0 +1,96 @@ +#!/usr/bin/python + +# Copyright 2002 Dave Abrahams +# Copyright 2003, 2004 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +import BoostBuild +import os.path +import re + + +def check_for_existing_boost_build_jam(t): + """ + This test depends on no boost-build.jam file existing in any of the + folders along the current folder's path. If it does exist, not only would + this test fail but it could point to a completely wrong Boost Build + installation, thus causing headaches when attempting to diagnose the + problem. That is why we explicitly check for this scenario. + + """ + problem = find_up_to_root(t.workdir, "boost-build.jam") + if problem: + BoostBuild.annotation("misconfiguration", """\ +This test expects to be run from a folder with no 'boost-build.jam' file in any +of the folders along its path. + +Working folder: + '%s' + +Problematic boost-build.jam found at: + '%s' + +Please remove this file or change the test's working folder and rerun the test. +""" % (t.workdir, problem)) + t.fail_test(1, dump_stdio=False, dump_stack=False) + + +def find_up_to_root(folder, name): + last = "" + while last != folder: + candidate = os.path.join(folder, name) + if os.path.exists(candidate): + return candidate + last = folder + folder = os.path.dirname(folder) + + +def match_re(actual, expected): + return re.match(expected, actual, re.DOTALL) != None + + +t = BoostBuild.Tester(match=match_re, boost_build_path="", pass_toolset=0) +t.set_tree("startup") +check_for_existing_boost_build_jam(t) + +t.run_build_system(status=1, stderr= +r"""Unable to load B2: could not find 'boost-build\.jam' +.*Attempted search from .* up to the root at '.*'""") + +t.run_build_system(status=1, subdir="no-bootstrap1", + stderr= +r"""Unable to load B2: could not find build system\. +----------------------------------------------- +.*attempted to load the build system by invoking +.*'boost-build ;' +.*but we were unable to find 'bootstrap\.jam' in the specified directory or in BOOST_BUILD_PATH:""") + +# Descend to a subdirectory which /does not/ contain a boost-build.jam file, +# and try again to test the crawl-up behavior. +t.run_build_system(status=1, subdir=os.path.join("no-bootstrap1", "subdir"), + stderr=r"Unable to load B2: could not find build system\." + r".*attempted to load the build system by invoking" + r".*'boost-build ;'" + r".*but we were unable to find 'bootstrap\.jam' in the specified directory or in BOOST_BUILD_PATH:") + +t.run_build_system(status=1, subdir="no-bootstrap2", + stderr=r"Unable to load B2: could not find build system\." + r".*attempted to load the build system by invoking" + r".*'boost-build \. ;'" + r".*but we were unable to find 'bootstrap\.jam' in the specified directory or in BOOST_BUILD_PATH:") + +t.run_build_system(status=1, subdir='no-bootstrap3', stderr= +r"""Unable to load B2 +.*boost-build\.jam' was found.* +However, it failed to call the 'boost-build' rule to indicate the location of the build system.""") + +# Test bootstrapping based on BOOST_BUILD_PATH. +t.run_build_system(["-sBOOST_BUILD_PATH=../boost-root/build"], + subdir="bootstrap-env", stdout="build system bootstrapped") + +# Test bootstrapping based on an explicit path in boost-build.jam. +t.run_build_system(subdir="bootstrap-explicit", + stdout="build system bootstrapped") + +t.cleanup() |