tests: allow use of alternative sha1 implementations
commitb36235131e0b5517fc5070c02c72be01c4b7f1f9
authorEric Wong <normalperson@yhbt.net>
Sat, 7 Nov 2009 08:08:18 +0000 (7 08:08 +0000)
committerEric Wong <normalperson@yhbt.net>
Sat, 7 Nov 2009 08:09:41 +0000 (7 00:09 -0800)
tree3c4774be5d51c905dcf9384c4ba5bc7816e7905d
parent1a9a718a3f9a5b582a4a339a9bb9249c2ca392d7
tests: allow use of alternative sha1 implementations

sha1sum(1) is only common GNU systems, and it may be installed
as gsha1sum on *BSDs.  We'll also try using the openssl sha1
implementation, too.  And finally, we'll provide our own Ruby
sha1sum.rb implementation as a last resort.

We go to great lengths to avoid our own Ruby version because we
want to avoid putting too much trust in ourselves, our Ruby
skills, and even the Ruby implementations.  This is especially
with regard to our knowledge and correct usage of Ruby 1.9
encoding support.  It would actually be *easier* to only use
sha1sum.rb and call it a day.  We just choose to support
SHA1 implementations provided by third parties if possible.

Performance is not a factor since sha1sum.rb performance is very
close to the C implementations.
t/bin/sha1sum.rb [new file with mode: 0755]
t/t0100-rack-input-hammer.sh
t/test-lib.sh