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