Skip to content

Commit 77fc549

Browse files
hawkinswldionne
authored andcommitted
[libc++] Add support for bootstrapping build in libcxx-lit
Add a [-b|--bootstrap] flag to change cxx-test-depends to runtimes-test-depends when testing a build of libcxx from bootstrapping. Signed-off-by: Will Hawkins <[email protected]> Differential Revision: https://reviews.llvm.org/D157045
1 parent 51e7ab2 commit 77fc549

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

libcxx/utils/libcxx-lit

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ PROGNAME="$(basename "${0}")"
66
function usage() {
77
cat <<EOF
88
Usage:
9-
${PROGNAME} [-h|--help] <build-directory> [lit options...] tests...
9+
${PROGNAME} [-h|--help] [-b|--bootstrap] <build-directory> [lit options...] tests...
1010
1111
Shortcut to build the libc++ testing dependencies and run the libc++ tests with Lit.
1212
13+
[-b|--bootstrap] Configure tests to run against a bootstrap build of libcxx.
1314
<build-directory> The path to the build directory to use for building the library.
1415
[lit options...] Optional options to pass to 'llvm-lit'.
1516
tests... Paths of the tests to run. Those paths are relative to '<monorepo-root>'.
@@ -21,12 +22,16 @@ $ libcxx-lit build/ -sv libcxx/test/std/utilities/
2122
EOF
2223
}
2324

24-
for arg in $@; do
25-
if [[ "${arg}" == "-h" || "${arg}" == "--help" ]]; then
26-
usage
27-
exit 0
28-
fi
29-
done
25+
type="cxx"
26+
if [[ "${1}" == "-h" || "${1}" == "--help" ]]; then
27+
usage
28+
exit 0
29+
fi
30+
31+
if [[ "${1}" == "-b" || "${1}" == "--bootstrap" ]]; then
32+
type="runtimes"
33+
shift
34+
fi
3035

3136
if [[ $# -lt 1 ]]; then
3237
usage
@@ -36,5 +41,9 @@ fi
3641
build_dir="${1}"
3742
shift
3843

39-
cmake --build "${build_dir}" --target cxx-test-depends
44+
if [[ "${type}" == "runtimes" ]]; then
45+
echo "N.B.: In a bootstrap build, lit needs a prefix to work correctly;"
46+
echo " See libcxx/docs/Testinglibcxx.rst for more information."
47+
fi
48+
cmake --build "${build_dir}" --target ${type}-test-depends
4049
"${build_dir}/bin/llvm-lit" ${@}

0 commit comments

Comments
 (0)