| Index: source/libvpx/test/tools_common.sh
 | 
| diff --git a/source/libvpx/test/tools_common.sh b/source/libvpx/test/tools_common.sh
 | 
| index 8e8d7859219f82fcad38f2c12a59fe72347b0db9..27785c3efe164866c14eddfcf6545265a2ea8002 100755
 | 
| --- a/source/libvpx/test/tools_common.sh
 | 
| +++ b/source/libvpx/test/tools_common.sh
 | 
| @@ -106,22 +106,24 @@ check_git_hashes() {
 | 
|    fi
 | 
|  }
 | 
|  
 | 
| +# $1 is the name of an environment variable containing a directory name to
 | 
| +# test.
 | 
| +test_env_var_dir() {
 | 
| +  local dir=$(eval echo "\${$1}")
 | 
| +  if [ ! -d "${dir}" ]; then
 | 
| +    elog "'${dir}': No such directory"
 | 
| +    elog "The $1 environment variable must be set to a valid directory."
 | 
| +    return 1
 | 
| +  fi
 | 
| +}
 | 
| +
 | 
|  # This script requires that the LIBVPX_BIN_PATH, LIBVPX_CONFIG_PATH, and
 | 
|  # LIBVPX_TEST_DATA_PATH variables are in the environment: Confirm that
 | 
|  # the variables are set and that they all evaluate to directory paths.
 | 
|  verify_vpx_test_environment() {
 | 
| -  if [ ! -d "${LIBVPX_BIN_PATH}" ]; then
 | 
| -    echo "The LIBVPX_BIN_PATH environment variable must be set."
 | 
| -    return 1
 | 
| -  fi
 | 
| -  if [ ! -d "${LIBVPX_CONFIG_PATH}" ]; then
 | 
| -    echo "The LIBVPX_CONFIG_PATH environment variable must be set."
 | 
| -    return 1
 | 
| -  fi
 | 
| -  if [ ! -d "${LIBVPX_TEST_DATA_PATH}" ]; then
 | 
| -    echo "The LIBVPX_TEST_DATA_PATH environment variable must be set."
 | 
| -    return 1
 | 
| -  fi
 | 
| +  test_env_var_dir "LIBVPX_BIN_PATH" \
 | 
| +    && test_env_var_dir "LIBVPX_CONFIG_PATH" \
 | 
| +    && test_env_var_dir "LIBVPX_TEST_DATA_PATH"
 | 
|  }
 | 
|  
 | 
|  # Greps vpx_config.h in LIBVPX_CONFIG_PATH for positional parameter one, which
 | 
| @@ -381,8 +383,7 @@ else
 | 
|    VPX_TEST_TEMP_ROOT=/tmp
 | 
|  fi
 | 
|  
 | 
| -VPX_TEST_RAND=$(awk 'BEGIN { srand(); printf "%d\n",(rand() * 32768)}')
 | 
| -VPX_TEST_OUTPUT_DIR="${VPX_TEST_TEMP_ROOT}/vpx_test_${VPX_TEST_RAND}"
 | 
| +VPX_TEST_OUTPUT_DIR="${VPX_TEST_TEMP_ROOT}/vpx_test_$$"
 | 
|  
 | 
|  if ! mkdir -p "${VPX_TEST_OUTPUT_DIR}" || \
 | 
|     [ ! -d "${VPX_TEST_OUTPUT_DIR}" ]; then
 | 
| @@ -420,7 +421,6 @@ vlog "$(basename "${0%.*}") test configuration:
 | 
|    VPX_TEST_LIST_TESTS=${VPX_TEST_LIST_TESTS}
 | 
|    VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}
 | 
|    VPX_TEST_PREFIX=${VPX_TEST_PREFIX}
 | 
| -  VPX_TEST_RAND=${VPX_TEST_RAND}
 | 
|    VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS}
 | 
|    VPX_TEST_SHOW_PROGRAM_OUTPUT=${VPX_TEST_SHOW_PROGRAM_OUTPUT}
 | 
|    VPX_TEST_TEMP_ROOT=${VPX_TEST_TEMP_ROOT}
 | 
| 
 |