Files
craft-libs/scripts/test-pdf-backends.sh
T

32 lines
2.3 KiB
Bash

#!/usr/bin/env bash
# Run transferred backend tests with the complete local patch set. Test copies
# keep Cargo's standalone lock resolution from modifying the vendored source.
set -euo pipefail
root=$(cd "$(dirname "$0")/.." && pwd)
test_root=$(mktemp -d "${TMPDIR:-/tmp}/craft-pdf-backends.XXXXXX")
trap 'rm -rf "$test_root"' EXIT
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$root/target}"
patches=()
for backend in hayro hayro-interpret hayro-syntax hayro-jbig2 hayro-cmap hayro-postscript vello_common vello_cpu kurbo; do
cp -R "$root/vendor/$backend" "$test_root/$backend"
patches+=(--config "patch.crates-io.$backend.path=\"$test_root/$backend\"")
done
for backend in hayro-syntax hayro-interpret hayro hayro-jbig2 hayro-cmap hayro-postscript; do
cargo test --manifest-path "$test_root/$backend/Cargo.toml" --lib "${patches[@]}"
done
cargo test --manifest-path "$test_root/vello_common/Cargo.toml" --lib pdfcraft_tests "${patches[@]}"
cargo test --manifest-path "$test_root/hayro-syntax/Cargo.toml" --lib --features unsafe "${patches[@]}"
cargo test --manifest-path "$test_root/hayro-syntax/Cargo.toml" --doc "${patches[@]}"
cargo test --manifest-path "$test_root/hayro-syntax/Cargo.toml" --lib --no-default-features --features std "${patches[@]}"
cp -R "$root/vendor/linesweeper" "$test_root/linesweeper"
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --lib --test regression
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --lib --test regression --features slow-asserts
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --test paperjs pixmap_distance_counts_coverage
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --test paperjs load_errors_are_reported
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --lib --features generators generators::
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --doc
cargo test --manifest-path "$test_root/kurbo/Cargo.toml" --locked --all-features
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --example visualize_op
cargo test --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --example curve_metrics --features metrics
cargo check --manifest-path "$test_root/linesweeper/Cargo.toml" --locked --all-targets --all-features