2023-06-01 06:26:33 +00:00
|
|
|
#!/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)
|
2024-07-05 21:17:58 +00:00
|
|
|
|
2024-06-14 14:28:32 +00:00
|
|
|
cd $LADYBIRD_SOURCE_DIR/Build/ladybird
|
2024-07-05 21:17:58 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-06-01 06:26:33 +00:00
|
|
|
mkdir -p $expected_dir
|
2024-07-05 21:17:58 +00:00
|
|
|
$ladybird_headless_binary $mode_flag --layout-test-mode $LADYBIRD_SOURCE_DIR/Tests/LibWeb/$input_dir/$test_name.html > $LADYBIRD_SOURCE_DIR/Tests/LibWeb/$expected_dir/$test_name.txt
|