| #!/usr/bin/env bash |
| |
| # This script uses MESOS_SOURCE_DIR and MESOS_BUILD_DIR which come |
| # from configuration substitutions. |
| MESOS_SOURCE_DIR=@abs_top_srcdir@ |
| MESOS_BUILD_DIR=@abs_top_builddir@ |
| |
| # Use colors for errors. |
| . ${MESOS_SOURCE_DIR}/support/colors.sh |
| |
| # Force the use of the Python interpreter configured during building. |
| test ! -z "${PYTHON}" && \ |
| echo "${RED}Ignoring PYTHON environment variable (using @PYTHON@)${NORMAL}" |
| |
| PYTHON=@PYTHON@ |
| |
| SETUPTOOLS=`echo ${MESOS_BUILD_DIR}/3rdparty/setuptools-*/` |
| |
| # Just warn in the case when build with --disable-bundled. |
| test ! -e ${SETUPTOOLS} && \ |
| echo "${RED}Failed to find ${SETUPTOOLS}${NORMAL}" |
| |
| PROTOBUF=`echo ${MESOS_BUILD_DIR}/3rdparty/protobuf-*/python/` |
| |
| test ! -e ${PROTOBUF} && \ |
| echo "${RED}Failed to find ${PROTOBUF}${NORMAL}" |
| |
| MESOS_EGGS=$(find ${MESOS_BUILD_DIR}/src/python/dist -name "*.egg" | tr "\\n" ":") |
| |
| SCRIPT=${MESOS_SOURCE_DIR}/src/examples/python/test_framework.py |
| |
| test ! -e ${SCRIPT} && \ |
| echo "${RED}Failed to find ${SCRIPT}${NORMAL}" && \ |
| exit 1 |
| |
| # Need to run in the directory containing this script so that the |
| # framework is able to find the executor. |
| cd `dirname ${0}` |
| |
| PYTHONPATH="${SETUPTOOLS}:${PROTOBUF}:${MESOS_EGGS}" \ |
| exec ${PYTHON} ${SCRIPT} "${@}" |