ladybird/Tests/LibWeb/rebaseline-libweb-test
Andreas Kling dd1b8de671 Ladybird+LibWeb+LibGfx: Add option to force use of fontconfig
This allows us to get identical metrics on macOS and Linux. Without
this, Skia will use CoreText on macOS and give us slightly different
text metrics. That causes layout tests to be slightly different on
different platforms, which is a huge headache. So let's not do that.

You can now launch Ladybird and headless-browser with --force-fontconfig
to load fonts through fontconfig. Tests run in this mode by default.
2024-08-20 09:30:05 +02:00

32 lines
816 B
Bash
Executable file

#!/bin/bash
set +e
t=$1
if echo -n $t | grep ^file: ; then
t=$(echo -n $t | sed s@^file://@@)
fi
if echo -n $t | grep Layout ; then
mode_flag="-d"
else
mode_flag="-T"
fi
input_dir=$(dirname $t)
expected_dir=$(echo $input_dir | sed s/input/expected/)
test_name=$(basename $t .html)
cd $LADYBIRD_SOURCE_DIR/Build/ladybird
if [[ -f ./bin/headless-browser ]]; then
ladybird_headless_binary=./bin/headless-browser
elif [[ -f ./bin/Ladybird.app/Contents/MacOS/headless-browser ]]; then
ladybird_headless_binary=./bin/Ladybird.app/Contents/MacOS/headless-browser
else
echo "ERR: Could not find headless-browser binary" >&2
exit 1
fi
mkdir -p $expected_dir
$ladybird_headless_binary $mode_flag --force-fontconfig --layout-test-mode $input_dir/$test_name.html > $expected_dir/$test_name.txt