AFS-PAG
view release on metacpan or search on metacpan
# Throws: Text exception if the module cannot be built in this environment
sub config_kafs {
my ($build) = @_;
my $config = Config::AutoConf->new;
# Checks needed for the generic portability layer.
$config->check_default_headers;
if (!$config->check_header('stdbool.h')) {
$config->check_type('_Bool');
}
$config->check_type('sig_atomic_t', undef, undef,
include(qw(sys/types.h signal.h)));
$config->check_type('ssize_t', undef, undef, include('sys/types.h'));
# Checks needed by all libkafs code.
$config->check_header('sys/ioccom.h');
# If the user passed extra flags into Build.PL, use them for probes.
if ($build->extra_linker_flags) {
my $flags = $build->extra_linker_flags;
my @flags = ref($flags) ? @{$flags} : ($flags);
$config->push_link_flags(@flags);
}
portable/kafs.h view on Meta::CPAN
#include <portable/macros.h>
#include <errno.h>
#ifdef HAVE_SYS_IOCCOM_H
# include <sys/ioccom.h>
#endif
#include <sys/ioctl.h>
BEGIN_DECLS
/* Assume we have some AFS support available and #undef below if not. */
#define HAVE_KAFS 1
/* We have a libkafs or libkopenafs library. */
#if HAVE_K_HASAFS
# if HAVE_KAFS_H
# include <kafs.h>
# elif HAVE_KOPENAFS_H
# include <kopenafs.h>
# else
struct ViceIoctl {
portable/kafs.h view on Meta::CPAN
int k_haspag(void);
int k_pioctl(char *, int, struct ViceIoctl *, int);
int k_setpag(void);
int k_unlog(void);
/* Undo default visibility change. */
#pragma GCC visibility pop
/* We have no kafs implementation available. */
#else
# undef HAVE_KAFS
# define k_hasafs() (0)
# define k_haspag() (0)
# define k_pioctl(p, c, a, f) (errno = ENOSYS, -1)
# define k_setpag() (errno = ENOSYS, -1)
# define k_unlog() (errno = ENOSYS, -1)
#endif
END_DECLS
#endif /* PORTABLE_KAFS_H */
portable/macros.h view on Meta::CPAN
* compilation context, but there's no push and pop available.
*/
#if !defined(__attribute__) && (defined(__llvm__) || defined(__clang__))
# pragma GCC diagnostic ignored "-Wattributes"
#endif
/*
* BEGIN_DECLS is used at the beginning of declarations so that C++
* compilers don't mangle their names. END_DECLS is used at the end.
*/
#undef BEGIN_DECLS
#undef END_DECLS
#ifdef __cplusplus
# define BEGIN_DECLS extern "C" {
# define END_DECLS }
#else
# define BEGIN_DECLS /* empty */
# define END_DECLS /* empty */
#endif
#endif /* !PORTABLE_MACROS_H */
t/lib/Test/RRA.pm view on Meta::CPAN
# so that it will sort properly.
$VERSION = '5.05';
}
# Skip this test unless author tests are requested. Takes a short description
# of what tests this script would perform, which is used in the skip message.
# Calls plan skip_all, which will terminate the program.
#
# $description - Short description of the tests
#
# Returns: undef
sub skip_unless_author {
my ($description) = @_;
if (!$ENV{AUTHOR_TESTING}) {
plan skip_all => "$description only run for author";
}
return;
}
# Skip this test unless doing automated testing or release testing. This is
# used for tests that should be run by CPAN smoke testing or during releases,
# but not for manual installs by end users. Takes a short description of what
# tests this script would perform, which is used in the skip message. Calls
# plan skip_all, which will terminate the program.
#
# $description - Short description of the tests
#
# Returns: undef
sub skip_unless_automated {
my ($description) = @_;
for my $env (qw(AUTOMATED_TESTING RELEASE_TESTING AUTHOR_TESTING)) {
return if $ENV{$env};
}
plan skip_all => "$description normally skipped";
return;
}
# Attempt to load a module and skip the test if the module could not be
# loaded. If the module could be loaded, call its import function manually.
# If the module could not be loaded, calls plan skip_all, which will terminate
# the program.
#
# The special logic here is based on Test::More and is required to get the
# imports to happen in the caller's namespace.
#
# $module - Name of the module to load
# @imports - Any arguments to import, possibly including a version
#
# Returns: undef
sub use_prereq {
my ($module, @imports) = @_;
# If the first import looks like a version, pass it as a bare string.
my $version = q{};
if (@imports >= 1 && $imports[0] =~ m{ \A \d+ (?: [.][\d_]+ )* \z }xms) {
$version = shift(@imports);
}
# Get caller information to put imports in the correct package.
my ($package) = caller;
# Do the import with eval, and try to isolate it from the surrounding
# context as much as possible. Based heavily on Test::More::_eval.
## no critic (BuiltinFunctions::ProhibitStringyEval)
## no critic (ValuesAndExpressions::ProhibitImplicitNewlines)
my ($result, $error, $sigdie);
{
local $@ = undef;
local $! = undef;
local $SIG{__DIE__} = undef;
$result = eval qq{
package $package;
use $module $version \@imports;
1;
};
$error = $@;
$sigdie = $SIG{__DIE__} || undef;
}
# If the use failed for any reason, skip the test.
if (!$result || $error) {
my $name = length($version) > 0 ? "$module $version" : $module;
plan skip_all => "$name required for test";
}
# If the module set $SIG{__DIE__}, we cleared that via local. Restore it.
## no critic (Variables::RequireLocalizedPunctuationVars)
( run in 2.841 seconds using v1.01-cache-2.11-cpan-d80b1682f3f )