Thread: [Http-webtest-commits] CVS: HTTP-WebTest/t 05-report.t,1.3,1.4
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <m_...@us...> - 2002-07-31 09:07:48
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv359/t Modified Files: 05-report.t Log Message: Tests for combo of terse parameter and show_*** parameters Index: 05-report.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/05-report.t,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** 05-report.t 8 Apr 2002 06:52:00 -0000 1.3 --- 05-report.t 31 Jul 2002 09:07:46 -0000 1.4 *************** *** 19,23 **** use vars qw($HOSTNAME $PORT $URL $TEST); ! BEGIN { plan tests => 12 } # init tests --- 19,23 ---- use vars qw($HOSTNAME $PORT $URL $TEST); ! BEGIN { plan tests => 14 } # init tests *************** *** 51,58 **** my $opts = { show_html => 'yes' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => [ $TEST ], check_file => 't/test.out/report-html'); } --- 51,58 ---- my $opts = { show_html => 'yes' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => [ $TEST ], check_file => 't/test.out/report-html'); } *************** *** 65,86 **** undef; if($skip) { ! skip($skip, 1); ! skip($skip, 1); } else { my $opts = { show_cookies => 'yes' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $COOKIE_FILTER, ! tests => [ $COOKIE_TEST ], check_file => 't/test.out/report-cookie1'); # note that second time we should send cookie ourselves ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $COOKIE_FILTER, ! tests => [ $COOKIE_TEST ], check_file => 't/test.out/report-cookie2'); } --- 65,85 ---- undef; if($skip) { ! skip($skip, 1) for 1 .. 2; } else { my $opts = { show_cookies => 'yes' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $COOKIE_FILTER, ! tests => [ $COOKIE_TEST ], check_file => 't/test.out/report-cookie1'); # note that second time we should send cookie ourselves ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $COOKIE_FILTER, ! tests => [ $COOKIE_TEST ], check_file => 't/test.out/report-cookie2'); } *************** *** 99,107 **** show_cookies => 'yes' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $COOKIE_FILTER, ! tests => [ $COOKIE_TEST ], check_file => 't/test.out/report-html-cookie'); } --- 98,106 ---- show_cookies => 'yes' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $COOKIE_FILTER, ! tests => [ $COOKIE_TEST ], check_file => 't/test.out/report-html-cookie'); } *************** *** 116,123 **** my $opts = { terse => $terse }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => "t/test.out/report-terse-$terse"); } --- 115,122 ---- my $opts = { terse => $terse }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => "t/test.out/report-terse-$terse"); } *************** *** 132,139 **** my $opts = { default_report => $default_report }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => "t/test.out/default-report-$default_report"); } --- 131,138 ---- my $opts = { default_report => $default_report }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => "t/test.out/default-report-$default_report"); } *************** *** 144,150 **** { my $tests = [ $TEST, ! { url => abs_url($URL, '/non-existent') }, { test_name => 'BlaBla', ! url => abs_url($URL, '/non-existent') }, ]; --- 143,149 ---- { my $tests = [ $TEST, ! { url => abs_url($URL, '/non-existent') }, { test_name => 'BlaBla', ! url => abs_url($URL, '/non-existent') }, ]; *************** *** 152,159 **** default_report => 'no' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => 't/test.out/test-harness-not-ok') } --- 151,158 ---- default_report => 'no' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => 't/test.out/test-harness-not-ok') } *************** *** 167,174 **** default_report => 'no' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => 't/test.out/test-harness-ok') } --- 166,173 ---- default_report => 'no' }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, ! tests => $tests, check_file => 't/test.out/test-harness-ok') } *************** *** 190,199 **** }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $out_filter, ! tests => $tests, check_file => 't/test.out/show-headers') } --- 189,233 ---- }; ! check_webtest(webtest => $WEBTEST, server_url => $URL, ! opts => $opts, out_filter => $out_filter, ! tests => $tests, check_file => 't/test.out/show-headers') + } + + # 13-14: test show_html, show_cookie, show_headers with terse parameter + { + my $skip = $HOSTNAME !~ /\..*\./ ? + 'skip: cannot test cookies - ' . + 'hostname does not contain two dots' : + undef; + if($skip) { + skip($skip, 1) for 1 .. 2; + } else { + my $tests = [ $COOKIE_TEST, + { url => abs_url($URL, '/non-existent') } ]; + + my $out_filter = sub { + $_[0] =~ s/: .*?GMT/: SOMEDAY/g; + $_[0] =~ s|Server: libwww-perl-daemon/[\w\.]*|Server: libwww-perl-daemon/NN|g; + $_[0] =~ s|User-Agent: HTTP-WebTest/[\w\.]*|User-Agent: HTTP-WebTest/NN|g; + $COOKIE_FILTER->($_[0]); + }; + + for my $terse (qw(summary failed_only)) { + my $opts = { terse => $terse, + show_html => 'yes', + show_cookie => 'yes', + show_headers => 'yes' }; + + check_webtest(webtest => $WEBTEST, + server_url => $URL, + opts => $opts, + tests => $tests, + out_filter => $out_filter, + check_file => "t/test.out/report-terse-show-$terse"); + } + } } |