This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/Mo.pm | |
+++ b/src/Mo.pm | |
@@ -12,8 +12,8 @@ sub Mo'import { | |
my $d = $a{default}||$a{builder}; | |
*{ $p . $n } = $d | |
? sub { | |
- return $#_ ? $$_{$n} = pop | |
- : ! exists $$_{$n} ? $$_{$n} = $_->$d | |
+ return $$_{$n} = $#_ ? pop | |
+ : ! exists $$_{$n} ? $_->$d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub Mo'import { | |
import warnings; $^H |= 0x602; | |
my $p = caller."'"; | |
@_ = ( ISA, extends, has, sub { | |
my ( $n, %a ) = @_; | |
my $d = $a{default}||$a{builder}; | |
*{ $p . $n } = $d | |
? sub { | |
$#_ ? $_[0]{$n} = $_[1] | |
: exists $_[0]{$n} ? $_[0]{$n} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
package Person::Child; | |
use base 'Person'; | |
__PACKAGE__->attributes('parent'); | |
} | |
my $child = Person::Child->new(); | |
ok $child->parent($p), 'setting parent'; | |
ok $child->name('bob'), 'setting child name'; | |
ok $child->age(5), 'setting child age'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl Build.PL | |
# on linux | |
$ ./Build hudson_test | |
# on windows | |
> Build hudson_test | |
# the result is in hudson_test_output.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Module::Build; | |
my $class = Module::Build->subclass( | |
class => "Module::Build::Custom", | |
code => <<'SUBCLASS' ); | |
sub ACTION_hudson_test { | |
my $self = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Module::Build; | |
my $class = Module::Build->subclass( | |
class => "Module::Build::Custom", | |
code => <<'SUBCLASS' ); | |
sub ACTION_hudson_test { | |
my $self = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Module::Build; | |
my $class = Module::Build->subclass( | |
class => "Module::Build::Custom", | |
code => <<'SUBCLASS' ); | |
sub ACTION_hudson_test { | |
my $self = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Module::Build; | |
my $class = Module::Build->subclass( | |
class => "Module::Build::Custom", | |
code => <<'SUBCLASS' ); | |
sub ACTION_hudson_test { | |
my $self = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub do_tests { | |
my $self = shift; | |
my $tests = $self->find_test_files; | |
if(@$tests) { | |
my $args = $self->tap_harness_args; | |
if($self->use_tap_harness or ($args and %$args)) { | |
$self->run_tap_harness($tests); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl ./Build test merge=1 tap_harness_args=formatter_class=TAP::Formatter::JUnit |