diff --git a/bin/iutils b/bin/iutils index b406950..7ba498e 100755 --- a/bin/iutils +++ b/bin/iutils @@ -45,7 +45,7 @@ multi MAIN( say "{colored '*', 'yellow bold'} Testing $test-module-name"; for $runable.tests.keys -> $module-name { # Skip this module if it's not the one we are looking for - if $module-filter { + if $module-name { next unless $module-name eq $module-filter; } my $module-failures = 0; diff --git a/lib/IUtils.rakumod b/lib/IUtils.rakumod index e94a3f7..0540148 100644 --- a/lib/IUtils.rakumod +++ b/lib/IUtils.rakumod @@ -33,14 +33,12 @@ class Test { say $_.out.trim.lines.map(*.indent($indent-level + 2)) .join("\n"); } - # say $_.err.elems; - # if $_.err.trim { - # say $_.err.trim.lines.elems; - # say colored('stderr:', 'underline') - # .indent($indent-level + 2); - # say $_.err.trim.lines.map(*.indent($indent-level + 2)) - # .join("\n"); - # } + if $_.err.trim { + say colored('stderr:', 'underline') + .indent($indent-level + 2); + say $_.err.trim.lines.map(*.indent($indent-level + 2)) + .join("\n"); + } return True; } } @@ -145,10 +143,5 @@ sub scan-ipkg(IO::Path:D $ipkg --> PackageInfo:D) { sub scan-packages(--> Array[PackageInfo:D]) is export { my PackageInfo:D @ipkgs = paths(:file(*.ends-with(".ipkg"))).map(*.IO.&scan-ipkg); - # Check out the parents if we didn't find an ipkg - if @ipkgs { - return @ipkgs; - } else { - indir $*CWD.parent, {scan-packages}; - } + return @ipkgs; } diff --git a/lib/IUtils/Compiler.rakumod b/lib/IUtils/Compiler.rakumod index 2c998c1..14cb559 100644 --- a/lib/IUtils/Compiler.rakumod +++ b/lib/IUtils/Compiler.rakumod @@ -79,8 +79,7 @@ sub idris-run(*@cmd) is export { my $err = $proc.err.slurp(:close); if !$proc || $out.contains("Error:") { IdrisError.new( - out => $out, - err => $err, + out => $out, err => $err, exit-code => $proc.exitcode, command => @cmd.Str) .throw; } @@ -111,13 +110,12 @@ sub idris-exec($expr, $file, $output-type? = Unit) is export { } } # Run the expression - my $proc = run 'build/exec/iutils_out', :out, :!err; - my $out = $proc.out.slurp(); - # my $err = $proc.err.slurp(); + my $proc = run 'build/exec/iutils_out', :out, :err; + my $out = $proc.out.slurp(:close); + my $err = $proc.err.slurp(:close); unless $proc { ExpressionError.new( - out => $out, - # err => $err, + out => $out, err => $err, exit-code => $proc.exitcode, expr => $expr ).throw; }