brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · a032f5d Raw
50 lines · plain
1#!/usr/bin/env bash2 3set -e4 5PROGNAME="$(basename "${0}")"6function usage() {7cat <<EOF8Usage:9${PROGNAME} [-h|--help] [-b|--bootstrap] <build-directory> [lit options...] tests...10 11Shortcut to build the libc++ testing dependencies and run the libc++ tests with Lit.12 13[-b|--bootstrap]   Configure tests to run against a bootstrap build of libcxx.14<build-directory>  The path to the build directory to use for building the library.15[lit options...]   Optional options to pass to 'llvm-lit'.16tests...           Paths of the tests to run. Those paths are relative to '<monorepo-root>'.17 18Example19=======20$ cmake -S runtimes -B build/ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"21$ libcxx-lit build/ -sv libcxx/test/std/utilities/22EOF23}24 25type="cxx"26if [[ "${1}" == "-h" || "${1}" == "--help" ]]; then27    usage28    exit 029fi30 31if [[ "${1}" == "-b" || "${1}" == "--bootstrap" ]]; then32    type="runtimes"33    shift34fi35 36if [[ $# -lt 1 ]]; then37    usage38    exit 139fi40 41build_dir="${1}"42shift43 44if [[ "${type}" == "runtimes" ]]; then45        echo "N.B.: In a bootstrap build, lit needs a prefix to work correctly;"46        echo "      See libcxx/docs/Testinglibcxx.rst for more information."47fi48cmake --build "${build_dir}" --target ${type}-test-depends49"${build_dir}/bin/llvm-lit" ${@}50