gitweb/lib - Alternate ways of capturing outputgitweb/cache-kernel-v5
commit629ca44d8927b6b0e20863999ac1d4493a53aacf
authorJakub Narebski <jnareb@gmail.com>
Tue, 5 Oct 2010 13:13:34 +0000 (5 15:13 +0200)
committerJakub Narebski <jnareb@gmail.com>
Tue, 5 Oct 2010 13:13:34 +0000 (5 15:13 +0200)
tree51848f07409c8f75acbe54b49e62ff411df457e7
parent7256c225739e871309507794c014d9567479bdad
gitweb/lib - Alternate ways of capturing output

Besides GitwebCache::Capture::SelectFH, which uses select(FH) to
redirect 'print LIST' and 'printf FORMAT, LIST' to in-memory file to
capture output, add GitwebCache::Capture::TiedCapture which uses
tie-ing filehandle to capture output, and GitwebCache::Capture::PerlIO
which uses push_layer method from non-core PerlIO::Util module to
capture output.

Add test (which canbe run standalone) for all those implementations,
checking ':utf8' and ':raw' output, and benchmark comparing them
(includes example benchmark tests).  Please note that the test for
alternate implementations is not run from t/t9503-gitweb-caching.sh
test.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
gitweb/lib/GitwebCache/Capture/PerlIO.pm [new file with mode: 0644]
gitweb/lib/GitwebCache/Capture/TiedCapture.pm [new file with mode: 0644]
gitweb/lib/Tie/Restore.pm [new file with mode: 0644]
gitweb/lib/TiedCapture/PerlIO.pm [new file with mode: 0644]
gitweb/lib/TiedCapture/String.pm [new file with mode: 0644]
t/t9504/benchmark_capture_implementations.pl [new file with mode: 0755]
t/t9504/test_capture_implementations.pl [new file with mode: 0755]