Skip to content

Instantly share code, notes, and snippets.

@dwarring
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwarring/12c1e32440a8aea43337 to your computer and use it in GitHub Desktop.
Save dwarring/12c1e32440a8aea43337 to your computer and use it in GitHub Desktop.
Bisection for parrot failures of advent-2010-day14.t etc
# rakudo bisections on parrot
# david warring 15-09-2014
# --------------------------
sub capture-said($code) {
my $output = '';
temp $*OUT = class {
method print(*@args) {
$output ~= @args.join;
}
}
$code();
return $output.lines;
}
my @out = capture-said {say "lah lah lah..." };
my $bisection = 2;
# --- bisection 1 ---
# - this stopped capturing output on parrot
# good: 65db2a6df4ffb08e3eb1d5fc68563ce2dc6c455e
# bad: f97cc9dbe9659d70a0fb41957b1f9bf5682e82b1
say "captured: /{@out}/";
exit( "{@out}" ~~ /lah/ ?? 0 !! 1)
if $bisection == 1;
# -- bisection 2 ---
# hang in capture-said(); statement: return $output.lines
# good: c3bd133cbd86286681dcb0f16cba507d3aecf60b
# bad: 2ad5b8e3e4006b204826424fa48341387ecf6bec
exit;
@dwarring
Copy link
Author

Note: Test::plan() [and roast] were broken on parrot for much of the bisections.

I used the above gist and the following shell script to bisect:

#!/bin/bash
echo "running...";
# this wont work across nqp versions
perl Configure.pl --backends=parrot && make && timeout 30s ./perl6-p /tmp/gistfile1.txt;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment