Bug 1729777 [wpt PR 30405] - Parsing for contain-intrinsic-size: auto <length>, a...
[gecko.git] / testing / web-platform / tests / css / build-css-testsuites.sh
blob5cb26179b8dbe4423885bcc7c8d687bab224df91
1 #!/usr/bin/env sh
2 set -ex
4 SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P)
5 WPT_ROOT=$SCRIPT_DIR/..
6 cd $WPT_ROOT
8 main() {
9 cd $WPT_ROOT/css
11 if [ -z $VENV ]; then
12 VENV=tools/_virtualenv
15 # Create the virtualenv
16 if [ ! -d $VENV ]; then
17 if [ -z $PYTHON ]; then
18 command -v python
19 if [ $? -eq 0 ]; then
20 if [ `python -c 'import sys; print(sys.version[0:3])'` == "2.7" ]; then
21 PYTHON=python
26 if [ -z $PYTHON ]; then
27 command -v python2
28 if [ $? -eq 0 ]; then
29 PYTHON=python2
33 if [ -z $PYTHON ]; then
34 echo "Please ensure Python 2.7 is installed"
35 exit 1
38 # The maximum Unicode code point is U+10FFFF = 1114111
39 if [ `$PYTHON -c 'import sys; print(sys.maxunicode)'` != "1114111" ]; then
40 echo "UCS-4 support for Python is required"
41 exit 1
44 virtualenv -p $PYTHON $VENV || { echo "Please ensure virtualenv is installed"; exit 2; }
47 # Install dependencies
48 $VENV/bin/pip install -r requirements.txt
50 # Run the build script
51 $VENV/bin/python tools/build.py "$@"
54 main "$@"