HAMT

 view release on metacpan or  search on metacpan

t/20-abi.t  view on Meta::CPAN


for my $round (1 .. 5) { my @r = HAMT::_abi_selftest(); }
is(HAMT::_live_blocks(), $blocks, 'nor has running it five more times');

# ---- a consumer can find the header -------------------------------------------------
ok(eval { require HAMT::Install::Files; 1 }, 'HAMT::Install::Files loads') or diag $@;
{
    no warnings 'once';
    my $core = $HAMT::Install::Files::CORE;
    ok(defined $core && -f "$core/hamt_abi.h", 'and names a directory that holds hamt_abi.h');
    my $text = do { local (@ARGV, $/) = ("$core/hamt_abi.h"); <> } // '';
    like($text, qr/^#define HAMT_ABI_VERSION 1$/m, 'which declares the version the table reports');
    unlike($text, qr/#\s*include\s+"hamt\//, 'and includes none of the private headers, which are not installed');
}

done_testing;

xt/core-harness.t  view on Meta::CPAN

# which is what lets ASan see a byte past the end of one. Then with every
# allocation going through the pool, as it does in the built library, so
# every check runs again on blocks that have been used before.
local $ENV{CC} = $cc;
my $extra = $ENV{HAMT_HARNESS_CFLAGS} // '';
for my $mode (['', ''], ['-DHAMT_HARNESS_POOL', ' (pooled)']) {
    my ($flag, $tag) = @$mode;
    local $ENV{HAMT_HARNESS_CFLAGS} = "$extra $flag";
    my $out = `sh xt/c/run.sh "$dir" 2>"$dir/err"`;
    my $rc  = $? >> 8;
    my $err = do { local (@ARGV, $/) = ("$dir/err"); <> } // '';

    my ($seen, $planned) = (0, undef);
    for my $line (split /\n/, $out) {
        if ($line =~ /^(not )?ok \d+ - (.*)$/) {
            ok(!$1, "$2$tag");
            $seen++;
        }
        elsif ($line =~ /^1\.\.(\d+)$/) {
            $planned = $1;
        }



( run in 1.126 second using v1.01-cache-2.11-cpan-145b269f2f3 )