Update examples
This commit is contained in:
4
testsuite/pdynload/null/Makefile
Normal file
4
testsuite/pdynload/null/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
TEST= pdynload/null
|
||||
TOP=../../..
|
||||
include ../../build.mk
|
5
testsuite/pdynload/null/Plugin.hs
Normal file
5
testsuite/pdynload/null/Plugin.hs
Normal file
@ -0,0 +1,5 @@
|
||||
module Plugin where
|
||||
|
||||
import API
|
||||
|
||||
resource = D 1
|
5
testsuite/pdynload/null/api/API.hs
Normal file
5
testsuite/pdynload/null/api/API.hs
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
module API where
|
||||
|
||||
data Num t => Interface t = D t
|
||||
|
19
testsuite/pdynload/null/prog/Main.hs
Normal file
19
testsuite/pdynload/null/prog/Main.hs
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
import System.Plugins
|
||||
-- import System.Plugins.Utils
|
||||
import API
|
||||
|
||||
src = "../Plugin.hs"
|
||||
wrap = "../Wrapper.hs"
|
||||
apipath = "../api"
|
||||
|
||||
main = do status <- make src ["-i"++apipath]
|
||||
case status of
|
||||
MakeSuccess _ _ -> f
|
||||
MakeFailure e-> mapM_ putStrLn e
|
||||
|
||||
where f = do v <- load "../Plugin.o" ["../api"] [] "resource"
|
||||
-- (i,_) <- exec "ghc" ["--numeric-version"]
|
||||
-- mapM_ putStrLn i
|
||||
putStrLn "done."
|
||||
|
1
testsuite/pdynload/null/prog/expected
Normal file
1
testsuite/pdynload/null/prog/expected
Normal file
@ -0,0 +1 @@
|
||||
done.
|
Reference in New Issue
Block a user