firefox/run-tests-wayland

105 lines
3.0 KiB
Plaintext
Raw Normal View History

2020-12-10 20:59:50 +00:00
#!/usr/bin/bash
2020-12-22 06:24:42 +00:00
# usage: run-tests-wayland offscreen [test flavour]
if ! [ $1 ] ; then
echo "Missing test params!"
echo ""
echo "usage: run-tests-wayland offscreen [test_flavour]"
echo ""
echo " offscreen can be 0 or 1"
echo " test_flavour can be xpc ref moch crash"
exit
fi
2020-12-10 20:59:50 +00:00
set -x
2020-12-14 14:12:55 +00:00
OFFSCREEN_TESTING=$1
2020-12-10 20:59:50 +00:00
2020-12-22 06:24:42 +00:00
RUN_XPCSHELL_TEST=0
RUN_REFTEST=0
RUN_MOCHITEST=0
RUN_CRASHTEST=0
SELECTED_TEST=$2
2021-03-23 09:29:22 +00:00
if [ "$SELECTED_TEST" = "xpc" ] ; then
2020-12-22 06:24:42 +00:00
RUN_XPCSHELL_TEST=1
2021-03-23 09:29:22 +00:00
elif [ "$SELECTED_TEST" = "ref" ] ; then
2020-12-22 06:24:42 +00:00
RUN_REFTEST=1
2021-03-23 09:29:22 +00:00
elif [ "$SELECTED_TEST" = "moch" ] ; then
2020-12-22 06:24:42 +00:00
RUN_MOCHITEST=1
2021-03-23 09:29:22 +00:00
elif [ "$SELECTED_TEST" = "crash" ] ; then
2020-12-22 06:24:42 +00:00
RUN_CRASHTEST=1
else
2021-03-23 09:29:22 +00:00
RUN_XPCSHELL_TEST=0
2020-12-22 06:24:42 +00:00
RUN_REFTEST=1
2021-03-23 09:29:22 +00:00
RUN_MOCHITEST=0
RUN_CRASHTEST=0
2020-12-22 06:24:42 +00:00
fi
2020-12-14 14:12:55 +00:00
MACH_USE_SYSTEM_PYTHON=1
MOZ_NODE_PATH=/usr/bin/node
MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4"
TEST_DIR="test_results"
2020-12-22 06:24:42 +00:00
mkdir $TEST_DIR
2020-12-10 20:59:50 +00:00
# Fix for system nss
ln -s /usr/bin/certutil objdir/dist/bin/certutil
ln -s /usr/bin/pk12util objdir/dist/bin/pk12util
NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
2020-12-14 14:12:55 +00:00
export MOZ_ENABLE_WAYLAND=1
if [ $OFFSCREEN_TESTING -ne 0 ] ; then
xvfb-run -s "-screen 0 1600x1200x24" -n 80 mutter --wayland --nested &
if [ -z "$WAYLAND_DISPLAY" ] ; then
export WAYLAND_DISPLAY=wayland-0
else
export WAYLAND_DISPLAY=wayland-1
fi
sleep 10
retry_count=0
max_retries=5
until [ $retry_count -gt $max_retries ]; do
if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then
retry_count=$(($max_retries + 1))
else
retry_count=$(($retry_count + 1))
echo "Waiting for Mutter, retry: $retry_count"
sleep 2
fi
done
fi
2020-12-22 06:24:42 +00:00
if [ $RUN_XPCSHELL_TEST -ne 0 ] ; then
./mach xpcshell-test 2>&1 | cat - | tee $TEST_DIR/xpcshell
./mach xpcshell-test --enable-webrender 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr
2020-12-22 06:24:42 +00:00
fi
2020-12-14 14:12:55 +00:00
2020-12-10 20:59:50 +00:00
# Basic render testing
2021-03-24 18:31:06 +00:00
export TEST_PARAMS="--setpref reftest.ignoreWindowSize=true"
2020-12-10 20:59:50 +00:00
export TEST_FLAVOUR=""
2020-12-22 06:24:42 +00:00
if [ $RUN_REFTEST -ne 0 ] ; then
2021-03-24 18:31:06 +00:00
./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
2020-12-22 06:24:42 +00:00
fi
if [ $RUN_CRASHTEST -ne 0 ] ; then
2021-03-24 18:31:06 +00:00
./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
2020-12-22 06:24:42 +00:00
fi
if [ $RUN_MOCHITEST -ne 0 ] ; then
2021-03-24 18:31:06 +00:00
./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
2020-12-22 06:24:42 +00:00
fi
2020-12-10 20:59:50 +00:00
# WebRender testing
export TEST_PARAMS="--enable-webrender $TEST_PARAMS"
export TEST_FLAVOUR="-wr"
2020-12-22 06:24:42 +00:00
if [ $RUN_REFTEST -ne 0 ] ; then
2021-03-24 18:31:06 +00:00
./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR
2020-12-22 06:24:42 +00:00
fi
if [ $RUN_CRASHTEST -ne 0 ] ; then
2021-03-24 18:31:06 +00:00
./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR
2020-12-22 06:24:42 +00:00
fi
if [ $RUN_MOCHITEST -ne 0 ] ; then
2021-03-24 18:31:06 +00:00
./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR
2020-12-22 06:24:42 +00:00
fi
2020-12-10 20:59:50 +00:00
rm -f objdir/dist/bin/certutil
rm -f objdir/dist/bin/pk12util