mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
0c77b3bf59
This change enables using the rebaseline-libweb-test script with Debug and Sanitizer builds — and allows specifying which build to use when using rebaseline-libweb-test to generate new test-expectations files. The mechanism used is to check the BUILD_PRESET environment variable. Otherwise, without this change, there’s no way to use the rebaseline-libweb-test script with Debug and Sanitizer builds — except by manually hacking the script locally to hardcode a directory name.
40 lines
1.1 KiB
Bash
Executable file
40 lines
1.1 KiB
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)
|
||
|
||
if [[ "$BUILD_PRESET" == "Sanitizer" ]]; then
|
||
build_dir=$LADYBIRD_SOURCE_DIR/Build/ladybird-sanitizers
|
||
elif [[ "$BUILD_PRESET" == "Debug" ]]; then
|
||
build_dir=$LADYBIRD_SOURCE_DIR/Build/ladybird-debug
|
||
else
|
||
build_dir=$LADYBIRD_SOURCE_DIR/Build/ladybird
|
||
fi
|
||
|
||
cd "$build_dir" || echo "Couldn’t cd to build directory" >&2 && exit 1
|
||
|
||
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
|