From: Jim Meyering Date: Thu, 10 Nov 2011 18:15:29 +0000 (+0100) Subject: tests: skip a test if Perl's Digest::CRC module is not installed X-Git-Tag: android-x86-4.4-r1~89 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=c52cf0b120b0767009dd13be1e90dd12b4198641;p=android-x86%2Fexternal-parted.git tests: skip a test if Perl's Digest::CRC module is not installed * tests/init.cfg (require_perl_digest_crc_): New function. * tests/t0210-gpt-resized-partition-entry-array.sh: Use it. Reported by Keshav P R in http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10530/focus=10589 --- diff --git a/tests/init.cfg b/tests/init.cfg index c5fbb5e..3109454 100644 --- a/tests/init.cfg +++ b/tests/init.cfg @@ -31,6 +31,16 @@ require_udevadm_settle_() || skip_ 'udevadm command is required for this test' } +require_perl_digest_crc_() +{ + local ok=0 + local t + t=$(perl -le 'use Digest::CRC qw(crc32); print crc32("123")') \ + && test $t = 2286445522 && ok=1 + test $ok = 1 \ + || skip_ "this test requires Perl's Digest::CRC module" +} + # We need two cleanup functions. One, cleanup_final_, is sometimes # used (transparently) via t-local.sh's modprobe/rmmod code. # The other is used e.g., to unmount. diff --git a/tests/t0210-gpt-resized-partition-entry-array.sh b/tests/t0210-gpt-resized-partition-entry-array.sh index c3d3ee2..7c8b57f 100755 --- a/tests/t0210-gpt-resized-partition-entry-array.sh +++ b/tests/t0210-gpt-resized-partition-entry-array.sh @@ -17,6 +17,7 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../parted $srcdir +require_perl_digest_crc_ ss=$sector_size_