issue350.t 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. #! /usr/bin/perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=350
  3. # special-case Moose XS. walker: missing packages
  4. # see also t/moose-test.pl
  5. use strict;
  6. BEGIN {
  7. unless (-d '.git' and !$ENV{NO_AUTHOR}) {
  8. print "1..0 #SKIP Compile Moose only if -d .git\n";
  9. exit;
  10. }
  11. unshift @INC, 't';
  12. require TestBC;
  13. }
  14. use Test::More;
  15. use Config;
  16. eval "use Moose;";
  17. if ($@) {
  18. plan skip_all => "Moose required for testing issue 350" ;
  19. } else {
  20. plan tests => 1;
  21. }
  22. # my $DEBUGGING = ($Config::Config{ccflags} =~ m/-DDEBUGGING/);
  23. my $todo = ($] > 5.017) ? "TODO " : "";
  24. ctestok(1, 'C,-O3', 'ccode350i', <<'EOF', $todo.'C #350 Moose deps');
  25. package Foo::Moose;
  26. use Moose;
  27. has bar => (is => "rw", isa => "Int");
  28. package main;
  29. my $moose = Foo::Moose->new;
  30. print "ok" if 32 == $moose->bar(32);
  31. EOF