Compare commits
No commits in common. "b28b91d5d2c98fdc0ddb4e873441c6818248dd01" and "c8acc534a9e8a8cbe6833d69d1f98ddfb988b859" have entirely different histories.
b28b91d5d2
...
c8acc534a9
8 changed files with 1 additions and 153 deletions
2
examples/testy/.gitignore
vendored
2
examples/testy/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
build/
|
|
||||||
*.*~
|
|
|
@ -1,10 +0,0 @@
|
||||||
[custom.all.testy]
|
|
||||||
type = "local"
|
|
||||||
path = "."
|
|
||||||
ipkg = "testy.ipkg"
|
|
||||||
test = "test/test.ipkg"
|
|
||||||
|
|
||||||
[custom.all.testy-test]
|
|
||||||
type = "local"
|
|
||||||
path = "test"
|
|
||||||
ipkg = "test.ipkg"
|
|
|
@ -1,11 +0,0 @@
|
||||||
module Testy
|
|
||||||
|
|
||||||
import System
|
|
||||||
import Data.String
|
|
||||||
|
|
||||||
-- @@test Hello World non-null
|
|
||||||
helloNonNull : IO ()
|
|
||||||
helloNonNull =
|
|
||||||
if null "Hello World"
|
|
||||||
then exitFailure
|
|
||||||
else exitSuccess
|
|
|
@ -1,19 +0,0 @@
|
||||||
module Main
|
|
||||||
|
|
||||||
import System
|
|
||||||
|
|
||||||
-- @@test Main Test
|
|
||||||
main : IO ()
|
|
||||||
main = putStrLn "Test successful!"
|
|
||||||
|
|
||||||
-- @@test Failing integration with error message
|
|
||||||
ohNo : IO ()
|
|
||||||
ohNo = do
|
|
||||||
putStrLn "Something horrible has happened"
|
|
||||||
exitFailure
|
|
||||||
|
|
||||||
-- @@test Passing integration with output
|
|
||||||
ohYes : IO ()
|
|
||||||
ohYes = do
|
|
||||||
putStrLn "Something amazing has happened"
|
|
||||||
exitSuccess
|
|
|
@ -1,11 +0,0 @@
|
||||||
module TestModule.Booleans
|
|
||||||
|
|
||||||
import System
|
|
||||||
|
|
||||||
-- @@test Boolean Integration passes
|
|
||||||
doesWork : IO Bool
|
|
||||||
doesWork = pure True
|
|
||||||
|
|
||||||
-- @@test Boolean Integration fails
|
|
||||||
dontWork : IO Bool
|
|
||||||
dontWork = pure False
|
|
|
@ -1,48 +0,0 @@
|
||||||
package testytest
|
|
||||||
version = 0.1.0
|
|
||||||
authors = "Nathan McCarty"
|
|
||||||
-- maintainers =
|
|
||||||
-- license =
|
|
||||||
-- brief =
|
|
||||||
-- readme =
|
|
||||||
-- homepage =
|
|
||||||
-- sourceloc =
|
|
||||||
-- bugtracker =
|
|
||||||
|
|
||||||
-- the Idris2 version required (e.g. langversion >= 0.5.1)
|
|
||||||
-- langversion
|
|
||||||
|
|
||||||
-- packages to add to search path
|
|
||||||
depends = testy
|
|
||||||
|
|
||||||
-- modules to install
|
|
||||||
modules = Main
|
|
||||||
, TestModule.Booleans
|
|
||||||
|
|
||||||
-- main file (i.e. file to load at REPL)
|
|
||||||
main = Main
|
|
||||||
|
|
||||||
-- name of executable
|
|
||||||
executable = "testy-test"
|
|
||||||
-- opts =
|
|
||||||
sourcedir = "src"
|
|
||||||
-- builddir =
|
|
||||||
-- outputdir =
|
|
||||||
|
|
||||||
-- script to run before building
|
|
||||||
-- prebuild =
|
|
||||||
|
|
||||||
-- script to run after building
|
|
||||||
-- postbuild =
|
|
||||||
|
|
||||||
-- script to run after building, before installing
|
|
||||||
-- preinstall =
|
|
||||||
|
|
||||||
-- script to run after installing
|
|
||||||
-- postinstall =
|
|
||||||
|
|
||||||
-- script to run before cleaning
|
|
||||||
-- preclean =
|
|
||||||
|
|
||||||
-- script to run after cleaning
|
|
||||||
-- postclean =
|
|
|
@ -1,47 +0,0 @@
|
||||||
package testy
|
|
||||||
version = 0.1.0
|
|
||||||
authors = "Nathan McCarty"
|
|
||||||
-- maintainers =
|
|
||||||
-- license =
|
|
||||||
-- brief =
|
|
||||||
-- readme =
|
|
||||||
-- homepage =
|
|
||||||
-- sourceloc =
|
|
||||||
-- bugtracker =
|
|
||||||
|
|
||||||
-- the Idris2 version required (e.g. langversion >= 0.5.1)
|
|
||||||
-- langversion
|
|
||||||
|
|
||||||
-- packages to add to search path
|
|
||||||
-- depends =
|
|
||||||
|
|
||||||
-- modules to install
|
|
||||||
modules = Testy
|
|
||||||
|
|
||||||
-- main file (i.e. file to load at REPL)
|
|
||||||
-- main =
|
|
||||||
|
|
||||||
-- name of executable
|
|
||||||
-- executable =
|
|
||||||
-- opts =
|
|
||||||
sourcedir = "src"
|
|
||||||
-- builddir =
|
|
||||||
-- outputdir =
|
|
||||||
|
|
||||||
-- script to run before building
|
|
||||||
-- prebuild =
|
|
||||||
|
|
||||||
-- script to run after building
|
|
||||||
-- postbuild =
|
|
||||||
|
|
||||||
-- script to run after building, before installing
|
|
||||||
-- preinstall =
|
|
||||||
|
|
||||||
-- script to run after installing
|
|
||||||
-- postinstall =
|
|
||||||
|
|
||||||
-- script to run before cleaning
|
|
||||||
-- preclean =
|
|
||||||
|
|
||||||
-- script to run after cleaning
|
|
||||||
-- postclean =
|
|
|
@ -51,8 +51,6 @@ class IdrisError is Exception {
|
||||||
qq:to/END/;
|
qq:to/END/;
|
||||||
Error running idris command: $.command
|
Error running idris command: $.command
|
||||||
Command exited with $.exit-code
|
Command exited with $.exit-code
|
||||||
StdOut:
|
|
||||||
{$.out.lines.map(*.indent: 2).join("\n")}
|
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +75,7 @@ sub idris-run(*@cmd) is export {
|
||||||
my $proc = run "idris2", @cmd, :out, :err;
|
my $proc = run "idris2", @cmd, :out, :err;
|
||||||
my $out = $proc.out.slurp(:close);
|
my $out = $proc.out.slurp(:close);
|
||||||
my $err = $proc.err.slurp(:close);
|
my $err = $proc.err.slurp(:close);
|
||||||
if !$proc || $out.contains("Error:") {
|
unless $proc {
|
||||||
IdrisError.new(
|
IdrisError.new(
|
||||||
out => $out, err => $err,
|
out => $out, err => $err,
|
||||||
exit-code => $proc.exitcode, command => @cmd.Str)
|
exit-code => $proc.exitcode, command => @cmd.Str)
|
||||||
|
@ -119,7 +117,5 @@ sub idris-exec($expr, $file, $output-type? = Unit) is export {
|
||||||
exit-code => $proc.exitcode, expr => $expr
|
exit-code => $proc.exitcode, expr => $expr
|
||||||
).throw;
|
).throw;
|
||||||
}
|
}
|
||||||
# Remove the output file
|
|
||||||
'build/exec/iutils_out'.IO.unlink;
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue