Skip to content

[build-script] Make libdispatch available to TestFoundation and XCTest tests if built #3191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -2393,13 +2393,19 @@ for host in "${ALL_HOSTS[@]}"; do
if [[ "${SKIP_TEST_XCTEST}" ]]; then
continue
fi
# If libdispatch is being built then XCTest will need access to it
if [[ ! "${SKIP_BUILD_LIBDISPATCH}" ]] ; then
LIBDISPATCH_BUILD_DIR="$(build_directory ${host} libdispatch)"
LIBDISPATCH_BUILD_ARGS="--libdispatch-src-dir=${LIBDISPATCH_SOURCE_DIR} --libdispatch-build-dir=${LIBDISPATCH_BUILD_DIR}"
fi
echo "--- Running tests for ${product} ---"
SWIFTC_BIN="$(build_directory_bin ${LOCAL_HOST} swift)/swiftc"
FOUNDATION_BUILD_DIR=$(build_directory ${host} foundation)
XCTEST_BUILD_DIR=$(build_directory ${host} xctest)
call "${XCTEST_SOURCE_DIR}"/build_script.py test \
--swiftc="${SWIFTC_BIN}" \
--foundation-build-dir="${FOUNDATION_BUILD_DIR}/Foundation" \
${LIBDISPATCH_BUILD_ARGS} \
"${XCTEST_BUILD_DIR}"
echo "--- Finished tests for ${product} ---"
continue
Expand All @@ -2413,12 +2419,18 @@ for host in "${ALL_HOSTS[@]}"; do
if [[ "${SKIP_TEST_FOUNDATION}" ]]; then
continue
fi
# If libdispatch is being built, TestFoundation will need access to it
if [[ ! "${SKIP_BUILD_LIBDISPATCH}" ]] ; then
LIBDISPATCH_LIB_DIR=":$(build_directory ${host} libdispatch)/src/.libs"
else
LIBDISPATCH_LIB_DIR=""
fi
echo "--- Running tests for ${product} ---"
build_dir=$(build_directory ${host} ${product})
XCTEST_BUILD_DIR=$(build_directory ${host} xctest)
with_pushd "${FOUNDATION_SOURCE_DIR}" \
call ${NINJA_BIN} TestFoundation
call env LD_LIBRARY_PATH="$(get_host_install_destdir ${host})$(get_host_install_prefix ${host})"/lib/swift/:"${build_dir}/Foundation":"${XCTEST_BUILD_DIR}":${LD_LIBRARY_PATH} "${build_dir}"/TestFoundation/TestFoundation
call env LD_LIBRARY_PATH="$(get_host_install_destdir ${host})$(get_host_install_prefix ${host})"/lib/swift/:"${build_dir}/Foundation":"${XCTEST_BUILD_DIR}""${LIBDISPATCH_LIB_DIR}":${LD_LIBRARY_PATH} "${build_dir}"/TestFoundation/TestFoundation
echo "--- Finished tests for ${product} ---"
continue
;;
Expand Down