Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 55 lines (47 sloc) 1.373 kB
ad8de41 @tadzik Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
1 #!/usr/bin/env perl6
2 use Panda;
3 use Shell::Command;
4 use JSON::Tiny;
5
6 multi gen-result($) {
7 { prereq => True, build => True, test => True }
8 }
9
10 multi gen-result(X::Panda $ex) {
11 return do given $ex.stage {
12 when 'resolve' | 'fetch' {
13 { prereq => False }
14 }
15 when 'build' {
16 { prereq => True, build => False }
17 }
18 when 'test' {
19 { prereq => True, build => True, test => False }
20 }
21 }
22 }
23
24 sub MAIN ($projectsfile) {
25 try mkdir "installlib";
26 %*ENV<PERL6LIB> = "{cwd}/installlib/lib:" ~ %*ENV<PERL6LIB>;
27 my $panda = Panda.new(
28 srcdir => "{cwd}/masstest/pandadir/src",
29 destdir => "{cwd}/installlib",
30 statefile => "{cwd}/masstest/pandadir/state",
31 projectsfile => $projectsfile,
32 );
33
34 my %log;
35
36 for $panda.ecosystem.project-list -> $p {
37 my $x = $panda.ecosystem.get-project($p);
38 # don't waste time if it has already been installed once
39 if $panda.ecosystem.project-get-state($x) ne 'absent' {
40 %log{$p} = gen-result(Any);
41 next;
42 }
43 try $panda.resolve($p);
44 %log{$p} = gen-result($! // 'chocolate cake');
45 }
46
47 shell 'rm -rf masstest/';
48 shell 'rm -rf installlib/';
49
50 given open('results.json', :w) {
51 .say: to-json %log;
52 .close;
53 }
54 }
Something went wrong with that request. Please try again.