Created
August 29, 2017 14:20
-
-
Save colomon/58dd2861239235027561a32c94a7a520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Results <success no-import hung crash>; | |
sub check-file($file) { | |
# say "working on $file"; | |
my $proc = Proc::Async.new('utils/sat_nlib', $file); | |
$proc.stdout(:bin).tap: { Nil } | |
$proc.stderr(:bin).tap: { Nil } | |
my $promise; | |
await Promise.anyof($promise = $proc.start, Promise.at(now + 20)); | |
if $promise.status != Kept { | |
$proc.kill; | |
return Results::hung; | |
} | |
return Results::crash if $promise.result.signal > 0; | |
return Results::no-import if $promise.result.exitcode > 0; | |
return Results::success; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment