macOS CI / build-and-test (push) Skipped
Replace the LpArgs argv builder with the deterministic TicketWriteResolver (locked 1-10 write order, Stage 2 overrides win unconditionally, no raw, nil overrides emit no write) and spool via a headless NSPrintOperation over TargetPageCanvasView instead of the CUPS lp binary. RecordingTargetSpooler (DEBUG) logs deterministic request lines to ICCERY_TEST_SPOOL_LOG for tests. Single spool job toggle switches printAllPages between per-page requests and one multi-page job. CupsService keeps lpstat/lpoptions enumeration but loses printTarget; ProcessID.lp* renamed cupsLp*; LpArgs, its tests and the lp fixture deleted.
26 lines
1.1 KiB
Bash
Executable File
26 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# Mock printtarg for Milestone2UITests. Writes N 2x2 TIFFs, a pretty
|
|
# manifest on stdout, and a fake .ti2 next to the basename (last argv).
|
|
# N defaults to 1; ICCERY_MOCK_PRINTTARG_PAGES raises it for the
|
|
# single-spool-job granularity test (#201 D5).
|
|
# Exit code is overridable via ICCERY_MOCK_PRINTTARG_EXIT.
|
|
last=""
|
|
for arg in "$@"; do last="$arg"; done
|
|
if [ "${ICCERY_MOCK_PRINTTARG_EXIT:-0}" -ne 0 ]; then
|
|
echo "mock printtarg failure" >&2
|
|
exit "$ICCERY_MOCK_PRINTTARG_EXIT"
|
|
fi
|
|
pages="${ICCERY_MOCK_PRINTTARG_PAGES:-1}"
|
|
i=1
|
|
printf '{\n "event": "manifest",\n "pages": [\n'
|
|
while [ "$i" -le "$pages" ]; do
|
|
echo 'SUkqAAgAAAAKAAABAwABAAAAAgAAAAEBAwABAAAAAgAAAAIBAwABAAAACAAAAAMBAwABAAAAAQAAAAYBAwABAAAAAQAAABEBBAABAAAAhgAAABUBAwABAAAAAQAAABYBAwABAAAAAgAAABcBBAABAAAABAAAABwBAwABAAAAAQAAAAAAAAA8eLTw' | /usr/bin/base64 -D > "page$i.tif"
|
|
sep=","
|
|
if [ "$i" -eq "$pages" ]; then sep=""; fi
|
|
printf ' {"filename": "page%s.tif", "patches": 4, "width_mm": 210, "height_mm": 297}%s\n' "$i" "$sep"
|
|
i=$((i + 1))
|
|
done
|
|
printf ' ]\n}\n'
|
|
touch "$last.ti2"
|
|
exit 0
|