Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 81 lines (69 sloc) 2.032 kb
ad8de41 Tadeusz Sośnierz 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
46eada4 Solomon Foster Every exception is a failure, not just the carefully constructed Panda e...
colomon authored
6 sub gen-result-success() {
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
7 { prereq => True, build => True, test => True }
8 }
9
46eada4 Solomon Foster Every exception is a failure, not just the carefully constructed Panda e...
colomon authored
10 sub gen-result-failure($ex) {
4fe033f Solomon Foster Make exception handling more robust.
colomon authored
11 my %res = do given $ex.?stage {
9f7ecd1 Tadeusz Sośnierz Panda is now fixed. Adjust
authored
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 }
4fe033f Solomon Foster Make exception handling more robust.
colomon authored
21 default {
22 say $ex.perl;
23 { prereq => False }
24 }
9f7ecd1 Tadeusz Sośnierz Panda is now fixed. Adjust
authored
25 };
4fe033f Solomon Foster Make exception handling more robust.
colomon authored
26 %res<description> = $ex.?description // $ex.perl;
46eada4 Solomon Foster Every exception is a failure, not just the carefully constructed Panda e...
colomon authored
27 %res
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
28 }
29
30 sub MAIN ($projectsfile) {
31 try mkdir "installlib";
a5eb593 Solomon Foster Custom Build.pm modules need path.
colomon authored
32 @*INC.push("{cwd}/installlib/lib");
5228d87 Moritz Lenz silence a warning
moritz authored
33 %*ENV<PERL6LIB> = "{cwd}/installlib/lib:" ~ (%*ENV<PERL6LIB> // '');
9f7ecd1 Tadeusz Sośnierz Panda is now fixed. Adjust
authored
34 try unlink "{cwd}/state";
0d67c41 Tadeusz Sośnierz Make it panda2-compatible
authored
35 my $e = Panda::Ecosystem.new(
36 statefile => "{cwd}/state",
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
37 projectsfile => $projectsfile,
9f7ecd1 Tadeusz Sośnierz Panda is now fixed. Adjust
authored
38 ) but role {
39 method flush-states { }
40 };
0d67c41 Tadeusz Sośnierz Make it panda2-compatible
authored
41 my $panda = Panda.new(
42 ecosystem => $e,
43 installer => Panda::Installer.new(destdir => "{cwd}/installlib")
44 );
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
45
46 my %log;
47
ad6a7bf Tadeusz Sośnierz Include some statistics in the results
authored
48 my $start = time;
49
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
50 for $panda.ecosystem.project-list -> $p {
51 my $x = $panda.ecosystem.get-project($p);
52 # don't waste time if it has already been installed once
53 if $panda.ecosystem.project-get-state($x) ne 'absent' {
46eada4 Solomon Foster Every exception is a failure, not just the carefully constructed Panda e...
colomon authored
54 %log{$p} = gen-result-success;
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
55 next;
56 }
57 try $panda.resolve($p);
46eada4 Solomon Foster Every exception is a failure, not just the carefully constructed Panda e...
colomon authored
58 %log{$p} = $! ?? gen-result-failure($!) !! gen-result-success;
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
59 }
60
ad6a7bf Tadeusz Sośnierz Include some statistics in the results
authored
61 my $end = time;
62
63 %log<_statistics> = {
64 runtime => $end - $start,
65 compiler => $*PERL<compiler><name>,
4fe033f Solomon Foster Make exception handling more robust.
colomon authored
66 version => $*PERL<compiler><ver>.Str,
ad6a7bf Tadeusz Sośnierz Include some statistics in the results
authored
67 datetime => DateTime.new(now).Str
68 }
69
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
70 shell 'rm -rf installlib/';
71
72 given open('results.json', :w) {
73 .say: to-json %log;
74 .close;
75 }
ad6a7bf Tadeusz Sośnierz Include some statistics in the results
authored
76
77 say '';
78 say 'Smoke test results have been written to results.json';
79 say '====================================================';
ad8de41 Tadeusz Sośnierz Rename masstest to smoker. Make it generate JSON instead of an HTML file
authored
80 }
Something went wrong with that request. Please try again.