https://github.com/web-platform-tests/wpt
Raw File
Tip revision: a50b8dadb93e9a7a20d2e31a7e5d0449ce37cd2c authored by Harald Alvestrand on 22 March 2018, 18:59:43 UTC
Add memory of last SDP offer/answer created
Tip revision: a50b8da
build-css-testsuites.sh
#!/usr/bin/env sh
set -ex

SCRIPT_DIR=$(dirname $(readlink -f "$0"))
WPT_ROOT=$(readlink -f $SCRIPT_DIR/..)
cd $WPT_ROOT

main() {
    cd $WPT_ROOT/css

    if [ -z $VENV ]; then
        VENV=tools/_virtualenv
    fi

    # Create the virtualenv
    if [ ! -d $VENV ]; then
        if [ -z $PYTHON ]; then
            command -v python
            if [ $? -eq 0 ]; then
                if [ `python -c 'import sys; print(sys.version[0:3])'` == "2.7" ]; then
                    PYTHON=python
                fi
            fi
        fi

        if [ -z $PYTHON ]; then
            command -v python2
            if [ $? -eq 0 ]; then
                PYTHON=python2
            fi
        fi

        if [ -z $PYTHON ]; then
            echo "Please ensure Python 2.7 is installed"
            exit 1
        fi

        virtualenv -p $PYTHON $VENV || { echo "Please ensure virtualenv is installed"; exit 2; }
    fi

    # Install dependencies
    $VENV/bin/pip install -r requirements.txt

    # Error if submodules are not there
    if [ ! -d tools/apiclient -o ! -d tools/w3ctestlib ]; then
        echo 'Please run `git submodule update --init --recursive`'
        exit 1
    fi

    # Run the build script
    $VENV/bin/python tools/build.py "$@"
}

main "$@"
back to top