#!/bin/sh set -e cd "$CAFTEST_CAF" exec 2>>tests/tmp/wrap.log export HTTP_COOKIE=$(cat "tests/tmp/cookie") export CAFTEST_URLBASE=file:/// tests/cgi "$@" | perl -pe ' next if m/^$/..0; next unless m/Set-Cookie: (\w+=[^; ]+)/; my $cf = "tests/tmp/cookie"; open C, ">", "$cf.new" or die "$cf $!"; print C $1 or die $!; close C or die $!; rename "$cf.new", $cf or die "$cf $!"; '