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