More test reorganisation - most of these tests work now.
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/05/21 15:25:24 simonmar Exp $
+
+TOP = ../..
+
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_run.mk
+
+include $(TOP)/mk/target.mk
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/05/21 15:25:24 simonmar Exp $
+
+TOP = ../..
+
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_run.mk
+
+include $(TOP)/mk/target.mk
import IO
import Directory
-import IOExts (trace)
main = do
createDirectory "foo"
import Directory (getDirectoryContents)
-import List (sort, isPrefixOf)
+import List (sort, isPrefixOf, isSuffixOf)
main = do
names <- getDirectoryContents "."
- let names' = filter (isPrefixOf "io009") names
- putStrLn (unlines (sort names'))
+ putStrLn (unlines (sort (filter ok names)))
+
+ok name = "getDirectoryContents" `isPrefixOf` name
+ && not ("bak" `isSuffixOf` name)
-io009.bin
-io009.hs
-io009.o
-io009.stdout
+getDirectoryContents001.bin
+getDirectoryContents001.hs
+getDirectoryContents001.o
+getDirectoryContents001.stdout
main = do
p <- getPermissions "."
print p
- p <- getPermissions "io034.hs"
+ p <- getPermissions "getPermissions001.hs"
print p
- p <- getPermissions "io034.bin"
+ p <- getPermissions "getPermissions001.bin"
print p
# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.1 2001/05/18 16:54:08 simonmar Exp $
+# $Id: Makefile,v 1.2 2001/05/21 15:25:24 simonmar Exp $
TOP = ../..
include $(TOP)/mk/boilerplate.mk
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-# io018 should run
-OMITTED_RUNTESTS = io005.run io018.run io033.run
-endif
-
include $(TOP)/mk/should_run.mk
SRC_HC_OPTS += -dcore-lint
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/05/21 15:25:25 simonmar Exp $
+
+TOP = ../..
+
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_run.mk
+
+SRC_HC_OPTS += -package lang
+
+echo001_RUNTEST_OPTS += -i echo001.hs
+
+include $(TOP)/mk/target.mk
import IO
import IOExts
-getPos :: HandlePosn -> HandlePosition
-getPos (HandlePosn _ x) = x
-
getPosnAndPrint h = do
- x <- hGetPosn h
+ x <- hTell h
v <- hGetChar h
- putStrLn ("At position: " ++ show (getPos x) ++ ", found: " ++ show v)
+ putStrLn ("At position: " ++ show x ++ ", found: " ++ show v)
return x
recordDoAndRepos h a = do
x <- getPosnAndPrint h
a
- hSetPosn x
+ hSeek h AbsoluteSeek x
getPosnAndPrint h
return ()
recordDoAndRepos2 h a = do
x <- getPosnAndPrint h
a
- hSeek h AbsoluteSeek (getPos x)
+ hSeek h AbsoluteSeek x
getPosnAndPrint h
return ()
recordDoAndRepos3 h a = do
x <- getPosnAndPrint h
a
- hSeek h SeekFromEnd (negate (getPos x + 1))
+ hSeek h SeekFromEnd (negate (x + 1))
getPosnAndPrint h
return ()
+file = "hTell001.hs"
+
main :: IO ()
main = do
- h <- openFile "io001.hs" ReadMode
+ h <- openFile file ReadMode
recordDoAndRepos h $
recordDoAndRepos h $
recordDoAndRepos h $
putStrLn ""
hClose h
putStrLn ""
- h <- openFileEx "io001.hs" (BinaryMode ReadMode)
+ h <- openFileEx file (BinaryMode ReadMode)
recordDoAndRepos h $
recordDoAndRepos h $
recordDoAndRepos h $
putStrLn ""
hClose h
putStrLn "\nUsing hSeek/AbsoluteSeek: "
- h <- openFile "io001.hs" ReadMode
+ h <- openFile file ReadMode
recordDoAndRepos2 h $
recordDoAndRepos2 h $
recordDoAndRepos2 h $
hClose h
putStrLn "\nUsing hSeek/SeekFromEnd: "
putStrLn "(Don't worry if you're seeing differing numbers here, it might be down to '\\n' vs '\\r\\n')"
- h <- openFile "io001.hs" ReadMode
+ h <- openFile file ReadMode
recordDoAndRepos3 h $
recordDoAndRepos3 h $
recordDoAndRepos3 h $
At position: 3, found: '!'
At position: 4, found: '!'
-At position: 1666, found: 'n'
-At position: 1667, found: ' '
-At position: 1668, found: '"'
-At position: 1669, found: '"'
-At position: 1670, found: '\n'
+At position: 1580, found: 'n'
+At position: 1581, found: ' '
+At position: 1582, found: '"'
+At position: 1583, found: '"'
+At position: 1584, found: '\n'
-module Main where
-
-- !!! test IOExts.performGC
import IOExts
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/05/21 15:25:25 simonmar Exp $
+
+TOP = ../..
+
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_run.mk
+
+SRC_HC_OPTS += -package lang
+
+ioref001_RUNTEST_OPTS += +RTS -K16m -RTS
+
+include $(TOP)/mk/target.mk
module Main where
-import IOExts
+import IORef
loop r 0 = return ()
loop r c = loop r (c-1) >> writeIORef r 42
#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.5 2001/05/01 11:46:56 simonmar Exp $
+# $Id: Makefile,v 1.6 2001/05/21 15:25:24 simonmar Exp $
TOP = ..
include $(TOP)/mk/boilerplate.mk
-SUBDIRS = should_run net
+SUBDIRS = should_run net \
+ CPUTime Directory IO IOExts System Time TimeExts
# posix009 hangs on Linux, disabled for now --SDM
# posix
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.2 2001/05/21 15:25:25 simonmar Exp $
+
TOP = ../..
include $(TOP)/mk/boilerplate.mk
-
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-# io018 should run
-OMITTED_RUNTESTS = io005.run io018.run io033.run
-endif
-
include $(TOP)/mk/should_run.mk
-SRC_HC_OPTS += -dcore-lint
-io010_HC_OPTS += -fglasgow-exts
-io011_HC_OPTS += -fglasgow-exts -package lang
-io018_HC_OPTS += -fglasgow-exts -package lang
-io022_HC_OPTS += -fglasgow-exts -package lang
-io032_HC_OPTS += -fglasgow-exts -package lang
-io035_HC_OPTS += -package lang
-
-io003_RUNTEST_OPTS += -o1 io003.stdout-mingw
-io004_RUNTEST_OPTS += -x 42
-io016_RUNTEST_OPTS += io016.hs io016.out
-io017_RUNTEST_OPTS += -i io017.stdin
-io018_RUNTEST_OPTS += -i io018.hs
-io021_RUNTEST_OPTS += -i io021.hs
-io022_RUNTEST_OPTS += -i io022.hs
-io028_RUNTEST_OPTS += -i io028.hs
-io034_RUNTEST_OPTS += -o1 io034.stdout-mingw
-io035_RUNTEST_OPTS += -o1 io035.stdout-mingw
-
-.PRECIOUS: %.o %.bin
-
-CLEAN_FILES += *.out *.inout
+exitWith001_RUNTEST_OPTS += -x 42
include $(TOP)/mk/target.mk
-io003.bin
+getArgs001.bin
case ec of
ExitSuccess -> putStr "What?!?\n" >> ioError (userError "dog succeeded")
ExitFailure _ ->
- system "cat io005.hs 2>/dev/null" >>= \ ec ->
+ system "cat system001.hs 2>/dev/null" >>= \ ec ->
case ec of
ExitSuccess -> exitWith ExitSuccess
ExitFailure _ -> putStr "What?!?\n" >> ioError (userError "cat failed")
case ec of
ExitSuccess -> putStr "What?!?\n" >> ioError (userError "dog succeeded")
ExitFailure _ ->
- system "cat io005.hs 2>/dev/null" >>= \ ec ->
+ system "cat system001.hs 2>/dev/null" >>= \ ec ->
case ec of
ExitSuccess -> exitWith ExitSuccess
ExitFailure _ -> putStr "What?!?\n" >> ioError (userError "cat failed")
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/05/21 15:25:25 simonmar Exp $
+
+TOP = ../..
+
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_run.mk
+
+include $(TOP)/mk/target.mk
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/05/21 15:25:25 simonmar Exp $
+
+TOP = ../..
+
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_run.mk
+
+SRC_HC_OPTS += -package lang
+
+include $(TOP)/mk/target.mk