clean up error display
This commit is contained in:
parent
c5ff918640
commit
cab0cb5ce1
10
bin/iutils
10
bin/iutils
|
@ -8,6 +8,7 @@ use IUtils::Regexes;
|
||||||
use IUtils::Compiler;
|
use IUtils::Compiler;
|
||||||
|
|
||||||
# TODO: Add filtering for tests based on module/name
|
# TODO: Add filtering for tests based on module/name
|
||||||
|
# TODO: Move some of this functionality into methods for the relevant structs
|
||||||
#| Execute the tests in an idris project
|
#| Execute the tests in an idris project
|
||||||
multi MAIN(
|
multi MAIN(
|
||||||
"test",
|
"test",
|
||||||
|
@ -46,15 +47,14 @@ multi MAIN(
|
||||||
}
|
}
|
||||||
my $testf = colored $test, 'underline';
|
my $testf = colored $test, 'underline';
|
||||||
if $! {
|
if $! {
|
||||||
|
# TODO: Don't show stdout if its empty
|
||||||
$module-failures += 1;
|
$module-failures += 1;
|
||||||
my $stdout = $1.err.lines.map(*.indent(8)).join("\n");
|
|
||||||
say "{colored '+', 'red'} $testf: {colored 'FAIL', 'red bold'}"
|
say "{colored '+', 'red'} $testf: {colored 'FAIL', 'red bold'}"
|
||||||
.indent(4);
|
.indent(4);
|
||||||
say "stdout:".indent(6);
|
say "stdout:".indent(6);
|
||||||
$!.err.lines.map(*.indent(8)).join("\n");
|
say $!.err.lines.map(*.indent(8)).join("\n");
|
||||||
say "stderr:".indent(6);
|
say (colored 'exit code', 'red').indent(6),
|
||||||
$!.err.lines.map(*.indent(8)).join("\n");
|
": {$!.exit-code}";
|
||||||
say "exit code: {$!.exit-code}"
|
|
||||||
} else {
|
} else {
|
||||||
say "{colored '+', 'green'} $testf: {colored 'pass', 'green'}"
|
say "{colored '+', 'green'} $testf: {colored 'pass', 'green'}"
|
||||||
.indent(4);
|
.indent(4);
|
||||||
|
|
|
@ -66,6 +66,7 @@ sub idris-run(*@cmd) is export {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# TODO: Special handling for IO Bool to make this eaiser
|
||||||
#| Exec the expression with the given name in the given file
|
#| Exec the expression with the given name in the given file
|
||||||
sub idris-exec($expr, $file) is export {
|
sub idris-exec($expr, $file) is export {
|
||||||
idris-run '--find-ipkg', '--exec', $expr, $file
|
idris-run '--find-ipkg', '--exec', $expr, $file
|
||||||
|
|
Loading…
Reference in a new issue