Test-Smoke-Database

 view release on metacpan or  search on metacpan

lib/Test/Smoke/Database.pm  view on Meta::CPAN

  $self->{HTML} = new Test::Smoke::Database::Display($self);
  print scalar(localtime),
    ": New run with Test::Smoke::Database version $VERSION\n"
      if ($self->{opts}->{verbose});
  return $self;
}

#------------------------------------------------------------------------------
# db
#------------------------------------------------------------------------------
sub db(\%) { return $_[0]->{DB}; }

#------------------------------------------------------------------------------
# HTML
#------------------------------------------------------------------------------
sub HTML(\%) { return $_[0]->{HTML}; }


#------------------------------------------------------------------------------
# build_graph
#------------------------------------------------------------------------------

lib/Test/Smoke/Database/DB.pm  view on Meta::CPAN

sub distinct(\%$) {
  my ($self, $col)=@_;
  my $req = "select distinct $col from builds where smoke>=$limit 
             order by $col";
  return $self->{DBH}->selectcol_arrayref($req) || undef;
}

#------------------------------------------------------------------------------
# nb
#------------------------------------------------------------------------------
sub nb(\%) {
  my $self = shift;
  my $req = "select count(*) from builds";
  $req .=" where smoke >= $limit" if $limit;
  return $self->one_shot($req);
}

#------------------------------------------------------------------------------
# last50
#------------------------------------------------------------------------------
sub last50(\%) {

lib/Test/Smoke/Database/Display.pm  view on Meta::CPAN

  $self->{CGI} = $indexer->{opts}->{cgi};
  $self->{DB} = $indexer->{DB};
  $limite = $indexer->{opts}->{limit};
  $ENV{SCRIPT_NAME}='localhost' if !$ENV{SCRIPT_NAME};
  return $self;
}

#------------------------------------------------------------------------------
# db
#------------------------------------------------------------------------------
sub db(\%) { return $_[0]->{DB}; }

#------------------------------------------------------------------------------
# header
#------------------------------------------------------------------------------
sub header_html(\%) {
  my $self = shift;
  my $u = $self->{opts}->{url_base} || $ENV{BASE} || '/perl/smoke';
  if (!$ENV{SCRIPT_NAME}) {
    $ENV{SCRIPT_NAME} = $ENV{CGI_BASE} || '/cgi-bin';
    $ENV{SCRIPT_NAME}.='/smoke_db.cgi';

lib/Test/Smoke/Database/Display.pm  view on Meta::CPAN

    $bu.=Tr({-class=>'mod'.$i++%2}, td($author), td($_->[0]));
  }
  $buf.=table({-class => 'box', -border=> 1},
	      Tr(th(cw("Author")), th(cw("Nb smoke"))), $bu);
  return $buf
}

#------------------------------------------------------------------------------
# cw
#------------------------------------------------------------------------------
sub cw($$) {
  my ($word, $size)= @_;
  $size = 10 if !$size;
  return ($word || "").(" " x ($size - ($word ? length($word) :0 )));
}

#------------------------------------------------------------------------------
# cn
#------------------------------------------------------------------------------
sub cn($) {
  return ( ($_[0] <10) ? '&nbsp;'.$_[0] : $_[0]);
}

#------------------------------------------------------------------------------
# compl_url
#------------------------------------------------------------------------------
sub compl_url(\%) {
  my $self = shift;
  my $buf;
  foreach ('os','osver','archi','cc','ccver','smoke') {



( run in 1.176 second using v1.01-cache-2.11-cpan-524268b4103 )