From 4e743c20f98b7ae5b8170b65c73d1ba60cb183b1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 27 Oct 2015 17:12:31 +0000 Subject: [PATCH] Testing: Reorganise files, variables, etc. Signed-off-by: Ian Jackson --- .gitignore | 2 +- TODO | 5 +++-- test.cgi => tests/cgi | 2 +- commit-test.pl => tests/commit-test.pl | 0 test-wrap => tests/wrap | 10 ++++++---- 5 files changed, 11 insertions(+), 8 deletions(-) rename test.cgi => tests/cgi (97%) rename commit-test.pl => tests/commit-test.pl (100%) rename test-wrap => tests/wrap (54%) diff --git a/.gitignore b/.gitignore index 90ab049..9a2e781 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ caf.pdf caf.tex caf.toc caf-srcdump -test-data +tests/tmp diff --git a/TODO b/TODO index 8061b33..c240398 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,7 @@ -REQUEST_METHOD=post CAHTEST_HOME=`pwd` ./test.cgi ; echo +REQUEST_METHOD=post CAFTEST_CAF=`pwd` tests/cgi ; echo -CAFTEST_URL=file:/cgi-bin/test-wrap CAHTEST_HOME=`pwd` w3m -cookie -config /dev/null -o cgi_bin=`pwd` file:///cgi-bin/test-wrap +mkdir tests/tmp +CAFTEST_CAF=`pwd` w3m -cookie -config /dev/null -o cgi_bin=`pwd`/tests file:///cgi-bin/wrap update last in db when we return undef from check_divert diff --git a/test.cgi b/tests/cgi similarity index 97% rename from test.cgi rename to tests/cgi index 3261842..6af2413 100755 --- a/test.cgi +++ b/tests/cgi @@ -10,7 +10,7 @@ use Data::Dumper; #use Carp::Always; $SIG{__DIE__} = sub { Carp::confess(@_) }; -my $dump = "$ENV{'CAHTEST_HOME'}/test-data"; +my $dump = "$ENV{'CAFTEST_CAF'}/tests/tmp"; my @verifier_params =( username_password_error => sub { diff --git a/commit-test.pl b/tests/commit-test.pl similarity index 100% rename from commit-test.pl rename to tests/commit-test.pl diff --git a/test-wrap b/tests/wrap similarity index 54% rename from test-wrap rename to tests/wrap index b896e82..937820f 100755 --- a/test-wrap +++ b/tests/wrap @@ -1,11 +1,13 @@ #!/bin/sh set -e -exec 2>>"$CAHTEST_HOME/test-data/log" -export HTTP_COOKIE=$(cat "$CAHTEST_HOME/test-data/cookie") -./test.cgi "$@" | perl -pe ' +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 = "$ENV{CAHTEST_HOME}/test-data/cookie"; + my $cf = "tests/tmp/cookie"; open C, ">", "$cf.new" or die "$cf $!"; print C $1 or die $!; close C or die $!; -- 2.30.2