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