summaryrefslogtreecommitdiff
path: root/t/testlib.pm
blob: d9ff33ff4bfd16c695827bec1b37cce36089e7ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use Build;

sub expand {
  my ($c, @r) = Build::expand(@_);
  return ($c, sort(@r));
}

sub setuptest {
  my ($repo, $conf) = @_;
  my $l = '';
  my $id = '';
  for (split("\n", $repo)) {
    $id = "$1.noarch-0/0/0:" if /^P: (\S+)/;
    s/:/:$id/;
    $l .= "$_\n";
  }
  local *F;
  open(F, '<', \$l);
  my $config = Build::read_config('noarch', [ split("\n", $conf || '') ]);
  Build::readdeps($config, undef, \*F);
  close F;
  return $config;
}

1;