aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xsrc/test/shell/bazel/bazel_bootstrap_distfile_test.sh12
-rwxr-xr-xsrc/test/shell/testenv.sh19
-rwxr-xr-xtools/test/test-setup.sh6
3 files changed, 21 insertions, 16 deletions
diff --git a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
index 9ae1a2ccf6..9b0375a754 100755
--- a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
+++ b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
@@ -30,20 +30,32 @@ fi
source $(rlocation io_bazel/src/test/shell/integration_test_setup.sh) \
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }
+function _log_progress() {
+ if [[ "$PLATFORM" =~ msys ]]; then
+ log_info "test_bootstrap: $*"
+ fi
+}
+
function test_bootstrap() {
+ _log_progress "start"
local olddir=$(pwd)
WRKDIR=$(mktemp -d ${TEST_TMPDIR}/bazelbootstrap.XXXXXXXX)
mkdir -p "${WRKDIR}" || fail "Could not create workdir"
trap "rm -rf \"$WRKDIR\"" EXIT
cd "${WRKDIR}" || fail "Could not change to work directory"
export SOURCE_DATE_EPOCH=1501234567
+ _log_progress "unzip"
unzip -q "${DISTFILE}"
+ _log_progress "bootstrap"
env EXTRA_BAZEL_ARGS="--curses=no --strategy=Javac=standalone" ./compile.sh \
|| fail "Expected to be able to bootstrap bazel"
+ _log_progress "run"
./output/bazel version > "${TEST_log}" || fail "Generated bazel not working"
./output/bazel shutdown
+ _log_progress "assert"
expect_log "${SOURCE_DATE_EPOCH}"
cd "${olddir}"
+ _log_progress "done"
}
run_suite "bootstrap test"
diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh
index 6a7476cf9d..5293f3f7ba 100755
--- a/src/test/shell/testenv.sh
+++ b/src/test/shell/testenv.sh
@@ -33,7 +33,7 @@ function is_darwin() {
function _log_base() {
prefix=$1
shift
- echo >&2 "${prefix}[$(basename "$0") $(date "+%H:%M:%S.%N (%z)")] $*"
+ echo >&2 "${prefix}[$(basename "$0") $(date "+%Y-%m-%d %H:%M:%S (%z)")] $*"
}
function log_info() {
@@ -45,6 +45,9 @@ function log_fatal() {
exit 1
}
+if ! type rlocation &> /dev/null; then
+ log_fatal "rlocation() is undefined"
+fi
# Set some environment variables needed on Windows.
if is_windows; then
@@ -98,17 +101,6 @@ export PATH="$PATH_TO_BAZEL_WRAPPER:$PATH"
[ -z "$TEST_SRCDIR" ] && log_fatal "TEST_SRCDIR not set!"
BAZEL_RUNFILES="$TEST_SRCDIR/io_bazel"
-if ! type rlocation &> /dev/null; then
- function rlocation() {
- if [[ "$1" = /* ]]; then
- echo $1
- else
- echo "$TEST_SRCDIR/$1"
- fi
- }
- export -f rlocation
-fi
-
# WORKSPACE file
workspace_file="${BAZEL_RUNFILES}/WORKSPACE"
@@ -463,10 +455,11 @@ function cleanup_workspace() {
# Clean-up the bazel install base
function cleanup() {
if [ -d "${BAZEL_INSTALL_BASE:-__does_not_exists__}" ]; then
+ log_info "Cleaning up BAZEL_INSTALL_BASE under $BAZEL_INSTALL_BASE"
# Windows takes its time to shut down Bazel and we can't delete A-server.jar
# until then, so just give it time and keep trying for 2 minutes.
for i in {1..120}; do
- if rm -fr "${BAZEL_INSTALL_BASE}" ; then
+ if rm -fr "${BAZEL_INSTALL_BASE}" >&/dev/null ; then
break
fi
if (( i == 10 )) || (( i == 30 )) || (( i == 60 )) ; then
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh
index 3b7ce2db31..aa6f7223b8 100755
--- a/tools/test/test-setup.sh
+++ b/tools/test/test-setup.sh
@@ -105,12 +105,12 @@ GUNIT_OUTPUT="xml:${XML_OUTPUT_FILE}"
RUNFILES_MANIFEST_FILE="${TEST_SRCDIR}/MANIFEST"
-if [ -z "$RUNFILES_MANIFEST_ONLY" ]; then
+if [[ "${RUNFILES_MANIFEST_ONLY:-}" != "1" ]]; then
function rlocation() {
if is_absolute "$1" ; then
echo "$1"
else
- echo "$(dirname $RUNFILES_MANIFEST_FILE)/$1"
+ echo "$TEST_SRCDIR/$1"
fi
}
else
@@ -118,7 +118,7 @@ else
if is_absolute "$1" ; then
echo "$1"
else
- echo $(grep "^$1 " "${RUNFILES_MANIFEST_FILE}" | sed 's/[^ ]* //')
+ echo "$(grep "^$1 " "${RUNFILES_MANIFEST_FILE}" | sed 's/[^ ]* //')"
fi
}
fi