12e947
#!/usr/bin/bash
12e947
# usage: run-tests-wayland [test flavour]
12e947
12e947
set -x
12e947
12e947
RUN_XPCSHELL_TEST=1
12e947
RUN_REFTEST=1
12e947
RUN_MOCHITEST=1
12e947
RUN_CRASHTEST=1
12e947
12e947
while (( "$#" )); do
12e947
  SELECTED_TEST=$1
12e947
  if [ "$SELECTED_TEST" = "xpcshell" ] ; then
12e947
    RUN_XPCSHELL_TEST=1
12e947
  elif [ "$SELECTED_TEST" = "reftest" ] ; then
12e947
    RUN_REFTEST=1
12e947
  elif [ "$SELECTED_TEST" = "mochitest" ] ; then
12e947
    RUN_MOCHITEST=1
12e947
  elif [ "$SELECTED_TEST" = "crashtest" ] ; then
12e947
    RUN_CRASHTEST=1
12e947
  fi
12e947
  shift
12e947
done
12e947
12e947
export MACH_USE_SYSTEM_PYTHON=1
12e947
export MOZ_NODE_PATH=/usr/bin/node
12e947
12e947
MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4"
12e947
TEST_DIR="test_results"
12e947
mkdir $TEST_DIR
12e947
12e947
env | grep "DISPLAY"
12e947
12e947
# Fix for system nss
12e947
ln -s /usr/bin/certutil objdir/dist/bin/certutil
12e947
ln -s /usr/bin/pk12util objdir/dist/bin/pk12util
12e947
12e947
NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
12e947
12e947
export MOZ_ENABLE_WAYLAND=1
12e947
12e947
if [ $RUN_XPCSHELL_TEST -ne 0 ] ; then
12e947
#  ./mach xpcshell-test 2>&1 | cat - | tee $TEST_DIR/xpcshell
12e947
  ./mach xpcshell-test --enable-webrender 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr
12e947
  sleep 60
12e947
fi
12e947
12e947
# Basic render testing
12e947
export TEST_PARAMS="--setpref reftest.ignoreWindowSize=true --setpref widget.wayland.test-workarounds.enabled=true"
12e947
#export TEST_FLAVOUR=""
12e947
#if [ $RUN_REFTEST -ne 0 ] ; then
12e947
#  ./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
12e947
#fi
12e947
#if [ $RUN_CRASHTEST -ne 0 ] ; then
12e947
#  ./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
12e947
#fi
12e947
#if [ $RUN_MOCHITEST -ne 0 ] ; then
12e947
#  ./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
12e947
#fi
12e947
12e947
# WebRender testing
12e947
export TEST_PARAMS="--enable-webrender $TEST_PARAMS"
12e947
export TEST_FLAVOUR="-wr"
12e947
# Use dom/base/test or dom/base/test/chrome for short version
12e947
export MOCHITEST_DIR='dom'
12e947
if [ $RUN_REFTEST -ne 0 ] ; then
12e947
  ./mach reftest $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
12e947
  sleep 60
12e947
fi
12e947
if [ $RUN_CRASHTEST -ne 0 ] ; then
12e947
  ./mach crashtest $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
12e947
  sleep 60
12e947
fi
12e947
if [ $RUN_MOCHITEST -ne 0 ] ; then
12e947
  ./mach mochitest $MOCHITEST_DIR $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
12e947
  sleep 60
12e947
fi
12e947
12e947
rm -f  objdir/dist/bin/certutil
12e947
rm -f  objdir/dist/bin/pk12util