From: Michael Meffie Date: Mon, 8 Feb 2016 15:10:32 +0000 (-0500) Subject: test: skip buserror test when SIGBUS is not defined in perl POSIX module X-Git-Tag: upstream/1.8.0_pre1^2~160 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c0876aa6b5edb2796330d786660ed4f2075a1fcf;p=packages%2Fo%2Fopenafs.git test: skip buserror test when SIGBUS is not defined in perl POSIX module Older versions of the perl POSIX module do not define the SIGBUS symbol, which causes the opr/softsig-t perl test to fail to compile. Instead of trying to defined SIGBUS, which may be platform dependent, skip the buserror unit test on these older platforms. Change-Id: Ib8cfd77215ea43566e9d47b501d4989556b83734 Reviewed-on: http://gerrit.openafs.org/12186 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/tests/opr/softsig-t b/tests/opr/softsig-t index a2e6fc90c..89e66e5df 100755 --- a/tests/opr/softsig-t +++ b/tests/opr/softsig-t @@ -77,11 +77,17 @@ close(HELPER); is($? & 0x7f, SIGSEGV, "Helper exited on SEGV signal."); # Check that an internal bus error kills the process. - -my ($fh, $path) = mkstemp("/tmp/softsig-t_XXXXXX"); -$pid = open(HELPER, "$softsig_helper -buserror $path |") - or die "Couldn't start test helper."; -close(HELPER); -is($? & 0x7f, SIGBUS, "Helper exited on BUS signal."); -$fh->close; -unlink $path; +# Skip this test when running on ancient versions of Perl +# which do not have SIGBUS defined. +SKIP: { + my $sigbus = eval "SIGBUS"; + skip("Skipping buserror test; SIGBUS constant is not defined.", 1) unless $sigbus; + + my ($fh, $path) = mkstemp("/tmp/softsig-t_XXXXXX"); + $pid = open(HELPER, "$softsig_helper -buserror $path |") + or die "Couldn't start test helper."; + close(HELPER); + is($? & 0x7f, $sigbus, "Helper exited on BUS signal."); + $fh->close; + unlink $path; +}