OSDN Git Service

tests: skip a test if Perl's Digest::CRC module is not installed
authorJim Meyering <meyering@redhat.com>
Thu, 10 Nov 2011 18:15:29 +0000 (19:15 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 10 Nov 2011 18:17:34 +0000 (19:17 +0100)
* 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

tests/init.cfg
tests/t0210-gpt-resized-partition-entry-array.sh

index c5fbb5e..3109454 100644 (file)
@@ -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.
index c3d3ee2..7c8b57f 100755 (executable)
@@ -17,6 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../parted $srcdir
+require_perl_digest_crc_
 
 ss=$sector_size_