mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
eaea80007c
At least on my Linux machine using zsh, this line was interpreted as ( cd "$build_dir" || echo ... ) && exit 1 instead of the intended cd "$build_dir" || ( echo ... && exit 1 ) ...meaning that it always exited regardless of whether it found the build dir or not. So, let's make the intended precedence explicit.
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
|