Skip to content

Instantly share code, notes, and snippets.

View exodist's full-sized avatar

Chad Granum exodist

View GitHub Profile
while (my $file = readdir($PSGI_DIR)) {
next if $file eq 'dev_dev.psgi';
next if $file =~ m/mock/i;
next unless $file =~ m/^(.*)_dev\.psgi$/;
my $name = $1;
local $@;
$APPS{$name} = eval "package $name; do '$PATH/$file'"
or print STDERR "Failed to load $file: $@";
./miniperl -Ilib make_ext.pl lib/auto/Time/HiRes/HiRes.so MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic
Makefile.PL: The "xdefine" exists, skipping the configure step.
("/home/exodist/projects/perl/miniperl Makefile.PL --configure" to force the configure step)
Warning: No Makefile!
make[1]: Entering directory '/home/exodist/projects/perl/dist/Time-HiRes'
make[1]: *** No rule to make target 'all'. Stop.
make[1]: Leaving directory '/home/exodist/projects/perl/dist/Time-HiRes'
make[1]: Entering directory '/home/exodist/projects/perl/dist/Time-HiRes'
make[1]: *** No rule to make target 'all'. Stop.
make[1]: Leaving directory '/home/exodist/projects/perl/dist/Time-HiRes'
@exodist
exodist / test.pl
Created November 6, 2016 21:28
Data from subtest into parent
use Test2::Bundle::Extended;
use Test2::Tools::AsyncSubtest qw/fork_subtest/;
use Test2::API qw/test2_stack/;
# This is a custom event meant to transport our data.
{
package Test2::Event::MyData;
use base 'Test2::Event';
use Test2::Util::HashBase qw/mydata/;
sub no_display { 1 }
t/external/ocsp.t ................. # tcp connect to www.microsoft.com:443 ok
# fingerprint matches
# validation with default CA w/o OCSP ok
t/external/ocsp.t ................. 1/3
# Failed test 'did not get expected OCSP response with stapling'
# at t/external/ocsp.t line 93.
# tcp connect to www.spiegel.de:443 ok
# fingerprint matches
# validation with default CA w/o OCSP ok
# validation with default CA with OCSP defaults ok
sub foo(&) {
my $code = shift;
my @got = $code->();
die "codeblock returned stuff, it should not" if @got;
}
sub blah {
return 1 if defined wantarray;
return;
}
@exodist
exodist / test.pl
Last active August 10, 2016 20:46
use strict;
use warnings;
{
package Ndn::Widget;
sub fob_id { '1' }
sub Fob {
my $self = shift;
@exodist
exodist / NoDiag.pm
Created August 10, 2016 15:46
Plugin you can preload to hide diagnostics messages
package Test2::Plugin::NoDiag;
use strict;
use warnings;
use Test2::API qw/test2_stack test2_add_callback_post_load/;
test2_add_callback_post_load(sub {
test2_stack->top->filter(
sub {
my ($hub, $event) = @_;
@exodist
exodist / test.pl
Created August 10, 2016 14:56
no diag
use Test2::Bundle::Extended;
use Test2::API qw/test2_stack/;
test2_stack->top->filter(
sub {
my ($hub, $event) = @_;
return if $event->isa('Test2::Event::Diag');
return $event;
},
use Test2::API qw/context run_subtest intercept/;
use Test2::Tools::Basic;
use strict;
use warnings;
sub is_int { 1 }; # Stub
sub is_even {
my ($thing, $name) = @_;
my $ctx = context();
@exodist
exodist / Generic.pm
Created June 2, 2016 22:22
Generic.pm
package Test2::Event::Generic;
use strict;
use warnings;
use Carp qw/croak/;
use Scalar::Util qw/reftype/;
our $VERSION = '1.302023';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }