diff --git a/examples/testy/.gitignore b/examples/testy/.gitignore new file mode 100644 index 0000000..2784b39 --- /dev/null +++ b/examples/testy/.gitignore @@ -0,0 +1,2 @@ +build/ +*.*~ diff --git a/examples/testy/pack.toml b/examples/testy/pack.toml new file mode 100644 index 0000000..ae5f38f --- /dev/null +++ b/examples/testy/pack.toml @@ -0,0 +1,10 @@ +[custom.all.testy] +type = "local" +path = "." +ipkg = "testy.ipkg" +test = "test/test.ipkg" + +[custom.all.testy-test] +type = "local" +path = "test" +ipkg = "test.ipkg" \ No newline at end of file diff --git a/examples/testy/src/Testy.idr b/examples/testy/src/Testy.idr new file mode 100644 index 0000000..54de3c2 --- /dev/null +++ b/examples/testy/src/Testy.idr @@ -0,0 +1,11 @@ +module Testy + +import System +import Data.String + +-- @@test Hello World non-null +helloNonNull : IO () +helloNonNull = + if null "Hello World" + then exitFailure + else exitSuccess diff --git a/examples/testy/test/src/Main.idr b/examples/testy/test/src/Main.idr new file mode 100644 index 0000000..8d2910f --- /dev/null +++ b/examples/testy/test/src/Main.idr @@ -0,0 +1,19 @@ +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 diff --git a/examples/testy/test/src/TestModule/Booleans.idr b/examples/testy/test/src/TestModule/Booleans.idr new file mode 100644 index 0000000..9545eb7 --- /dev/null +++ b/examples/testy/test/src/TestModule/Booleans.idr @@ -0,0 +1,9 @@ +module TestModule.Booleans + +-- @@test Boolean Integration passes +passes : IO Bool +passes = pure True + +-- @@test Boolean Integration fails +fails : IO Bool +fails = pure False diff --git a/examples/testy/test/test.ipkg b/examples/testy/test/test.ipkg new file mode 100644 index 0000000..dadcbeb --- /dev/null +++ b/examples/testy/test/test.ipkg @@ -0,0 +1,48 @@ +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 = diff --git a/examples/testy/testy.ipkg b/examples/testy/testy.ipkg new file mode 100644 index 0000000..fa5f6a8 --- /dev/null +++ b/examples/testy/testy.ipkg @@ -0,0 +1,47 @@ +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 =