X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=tests%2Fwrap;fp=tests%2Fwrap;h=937820f4a7c129299c2a088daf91204805700ea3;hb=4e743c20f98b7ae5b8170b65c73d1ba60cb183b1;hp=0000000000000000000000000000000000000000;hpb=b7f76b8d0d95ef36b323f19741eb5355f4be28ee;p=cgi-auth-flexible.git diff --git a/tests/wrap b/tests/wrap new file mode 100755 index 0000000..937820f --- /dev/null +++ b/tests/wrap @@ -0,0 +1,15 @@ +#!/bin/sh +set -e +cd "$CAFTEST_CAF" +exec 2>>tests/tmp/log +export HTTP_COOKIE=$(cat "tests/tmp/cookie") +export CAFTEST_URL=file:///cgi-bin/wrap +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 $!"; +'