Last active
August 29, 2017 14:32
-
-
Save colomon/0401a5a37144e27529db05e37bad9200 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 } | |
await Promise.anyof(my $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