summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-05-21 15:25:25 +0000
committersimonmar <unknown>2001-05-21 15:25:25 +0000
commite1cfeccd83cf4c36f54e2fa9ac9ce5a844150015 (patch)
tree76eab180d4ab35625ca3c2caeabeb1e7f04c2988 /ghc
parentfbbc847007594bb003c7303b4ebdd1b9e84087d0 (diff)
downloadhaskell-e1cfeccd83cf4c36f54e2fa9ac9ce5a844150015.tar.gz
[project @ 2001-05-21 15:25:24 by simonmar]
More test reorganisation - most of these tests work now.
Diffstat (limited to 'ghc')
-rw-r--r--ghc/tests/lib/CPUTime/Makefile9
-rw-r--r--ghc/tests/lib/Directory/Makefile9
-rw-r--r--ghc/tests/lib/Directory/directory001.hs1
-rw-r--r--ghc/tests/lib/Directory/getDirectoryContents001.hs8
-rw-r--r--ghc/tests/lib/Directory/getDirectoryContents001.stdout8
-rw-r--r--ghc/tests/lib/Directory/getPermissions001.hs4
-rw-r--r--ghc/tests/lib/IO/Makefile7
-rw-r--r--ghc/tests/lib/IOExts/Makefile13
-rw-r--r--ghc/tests/lib/IOExts/hTell001.hs (renamed from ghc/tests/lib/should_run/io001.hs)23
-rw-r--r--ghc/tests/lib/IOExts/hTell001.stdout (renamed from ghc/tests/lib/should_run/io001.stdout)10
-rw-r--r--ghc/tests/lib/IOExts/hTell002.hs (renamed from ghc/tests/lib/should_run/io002.hs)0
-rw-r--r--ghc/tests/lib/IOExts/hTell002.stdout (renamed from ghc/tests/lib/should_run/io002.stdout)0
-rw-r--r--ghc/tests/lib/IOExts/performGC001.hs (renamed from ghc/tests/lib/should_run/ioexts002.hs)2
-rw-r--r--ghc/tests/lib/IOExts/performGC001.stdout (renamed from ghc/tests/lib/should_run/ioexts002.stdout)0
-rw-r--r--ghc/tests/lib/IORef/Makefile13
-rw-r--r--ghc/tests/lib/IORef/ioref001.hs (renamed from ghc/tests/lib/should_run/ioexts001.hs)2
-rw-r--r--ghc/tests/lib/IORef/ioref001.stdout (renamed from ghc/tests/lib/should_run/ioexts001.stdout)0
-rw-r--r--ghc/tests/lib/Makefile5
-rw-r--r--ghc/tests/lib/System/Makefile32
-rw-r--r--ghc/tests/lib/System/getArgs001.stdout2
-rw-r--r--ghc/tests/lib/System/system001.hs2
-rw-r--r--ghc/tests/lib/System/system001.stdout2
-rw-r--r--ghc/tests/lib/Time/Makefile9
-rw-r--r--ghc/tests/lib/TimeExts/Makefile11
-rw-r--r--ghc/tests/lib/TimeExts/timeexts001.hs (renamed from ghc/tests/lib/Time/time001.hs)0
-rw-r--r--ghc/tests/lib/TimeExts/timeexts001.stdout (renamed from ghc/tests/lib/Time/time001.stdout)0
26 files changed, 103 insertions, 69 deletions
diff --git a/ghc/tests/lib/CPUTime/Makefile b/ghc/tests/lib/CPUTime/Makefile
new file mode 100644
index 0000000000..48465083de
--- /dev/null
+++ b/ghc/tests/lib/CPUTime/Makefile
@@ -0,0 +1,9 @@
+# -----------------------------------------------------------------------------
+# $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
diff --git a/ghc/tests/lib/Directory/Makefile b/ghc/tests/lib/Directory/Makefile
new file mode 100644
index 0000000000..48465083de
--- /dev/null
+++ b/ghc/tests/lib/Directory/Makefile
@@ -0,0 +1,9 @@
+# -----------------------------------------------------------------------------
+# $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
diff --git a/ghc/tests/lib/Directory/directory001.hs b/ghc/tests/lib/Directory/directory001.hs
index 0df9e00c90..c04a015633 100644
--- a/ghc/tests/lib/Directory/directory001.hs
+++ b/ghc/tests/lib/Directory/directory001.hs
@@ -1,7 +1,6 @@
import IO
import Directory
-import IOExts (trace)
main = do
createDirectory "foo"
diff --git a/ghc/tests/lib/Directory/getDirectoryContents001.hs b/ghc/tests/lib/Directory/getDirectoryContents001.hs
index 829a9f9df4..7c48a93cd1 100644
--- a/ghc/tests/lib/Directory/getDirectoryContents001.hs
+++ b/ghc/tests/lib/Directory/getDirectoryContents001.hs
@@ -1,7 +1,9 @@
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)
diff --git a/ghc/tests/lib/Directory/getDirectoryContents001.stdout b/ghc/tests/lib/Directory/getDirectoryContents001.stdout
index 55dab93156..0f93ceb9ff 100644
--- a/ghc/tests/lib/Directory/getDirectoryContents001.stdout
+++ b/ghc/tests/lib/Directory/getDirectoryContents001.stdout
@@ -1,5 +1,5 @@
-io009.bin
-io009.hs
-io009.o
-io009.stdout
+getDirectoryContents001.bin
+getDirectoryContents001.hs
+getDirectoryContents001.o
+getDirectoryContents001.stdout
diff --git a/ghc/tests/lib/Directory/getPermissions001.hs b/ghc/tests/lib/Directory/getPermissions001.hs
index 97faf05d58..a52da9d6b5 100644
--- a/ghc/tests/lib/Directory/getPermissions001.hs
+++ b/ghc/tests/lib/Directory/getPermissions001.hs
@@ -3,7 +3,7 @@ import Directory
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
diff --git a/ghc/tests/lib/IO/Makefile b/ghc/tests/lib/IO/Makefile
index 9d3e242b3a..e2ed9b7684 100644
--- a/ghc/tests/lib/IO/Makefile
+++ b/ghc/tests/lib/IO/Makefile
@@ -1,15 +1,10 @@
# -----------------------------------------------------------------------------
-# $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
diff --git a/ghc/tests/lib/IOExts/Makefile b/ghc/tests/lib/IOExts/Makefile
new file mode 100644
index 0000000000..8881b9241c
--- /dev/null
+++ b/ghc/tests/lib/IOExts/Makefile
@@ -0,0 +1,13 @@
+# -----------------------------------------------------------------------------
+# $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
diff --git a/ghc/tests/lib/should_run/io001.hs b/ghc/tests/lib/IOExts/hTell001.hs
index ec16fda5d1..b5a6033106 100644
--- a/ghc/tests/lib/should_run/io001.hs
+++ b/ghc/tests/lib/IOExts/hTell001.hs
@@ -4,39 +4,38 @@ module Main(main) where
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 $
@@ -45,7 +44,7 @@ main = do
putStrLn ""
hClose h
putStrLn ""
- h <- openFileEx "io001.hs" (BinaryMode ReadMode)
+ h <- openFileEx file (BinaryMode ReadMode)
recordDoAndRepos h $
recordDoAndRepos h $
recordDoAndRepos h $
@@ -54,7 +53,7 @@ main = do
putStrLn ""
hClose h
putStrLn "\nUsing hSeek/AbsoluteSeek: "
- h <- openFile "io001.hs" ReadMode
+ h <- openFile file ReadMode
recordDoAndRepos2 h $
recordDoAndRepos2 h $
recordDoAndRepos2 h $
@@ -65,7 +64,7 @@ main = do
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 $
diff --git a/ghc/tests/lib/should_run/io001.stdout b/ghc/tests/lib/IOExts/hTell001.stdout
index 1cb7f40dfa..f7f2f287af 100644
--- a/ghc/tests/lib/should_run/io001.stdout
+++ b/ghc/tests/lib/IOExts/hTell001.stdout
@@ -43,8 +43,8 @@ At position: 2, found: ' '
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'
diff --git a/ghc/tests/lib/should_run/io002.hs b/ghc/tests/lib/IOExts/hTell002.hs
index 0bb0cacefb..0bb0cacefb 100644
--- a/ghc/tests/lib/should_run/io002.hs
+++ b/ghc/tests/lib/IOExts/hTell002.hs
diff --git a/ghc/tests/lib/should_run/io002.stdout b/ghc/tests/lib/IOExts/hTell002.stdout
index da4db705ae..da4db705ae 100644
--- a/ghc/tests/lib/should_run/io002.stdout
+++ b/ghc/tests/lib/IOExts/hTell002.stdout
diff --git a/ghc/tests/lib/should_run/ioexts002.hs b/ghc/tests/lib/IOExts/performGC001.hs
index e9c8575ce6..e680eb8d8a 100644
--- a/ghc/tests/lib/should_run/ioexts002.hs
+++ b/ghc/tests/lib/IOExts/performGC001.hs
@@ -1,5 +1,3 @@
-module Main where
-
-- !!! test IOExts.performGC
import IOExts
diff --git a/ghc/tests/lib/should_run/ioexts002.stdout b/ghc/tests/lib/IOExts/performGC001.stdout
index e69de29bb2..e69de29bb2 100644
--- a/ghc/tests/lib/should_run/ioexts002.stdout
+++ b/ghc/tests/lib/IOExts/performGC001.stdout
diff --git a/ghc/tests/lib/IORef/Makefile b/ghc/tests/lib/IORef/Makefile
new file mode 100644
index 0000000000..7b26514f63
--- /dev/null
+++ b/ghc/tests/lib/IORef/Makefile
@@ -0,0 +1,13 @@
+# -----------------------------------------------------------------------------
+# $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
diff --git a/ghc/tests/lib/should_run/ioexts001.hs b/ghc/tests/lib/IORef/ioref001.hs
index 7b9d1b3f1a..50bd7475d8 100644
--- a/ghc/tests/lib/should_run/ioexts001.hs
+++ b/ghc/tests/lib/IORef/ioref001.hs
@@ -2,7 +2,7 @@
module Main where
-import IOExts
+import IORef
loop r 0 = return ()
loop r c = loop r (c-1) >> writeIORef r 42
diff --git a/ghc/tests/lib/should_run/ioexts001.stdout b/ghc/tests/lib/IORef/ioref001.stdout
index 19f86f493a..19f86f493a 100644
--- a/ghc/tests/lib/should_run/ioexts001.stdout
+++ b/ghc/tests/lib/IORef/ioref001.stdout
diff --git a/ghc/tests/lib/Makefile b/ghc/tests/lib/Makefile
index f273ff44ce..8c933d288b 100644
--- a/ghc/tests/lib/Makefile
+++ b/ghc/tests/lib/Makefile
@@ -1,10 +1,11 @@
#-----------------------------------------------------------------------------
-# $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
diff --git a/ghc/tests/lib/System/Makefile b/ghc/tests/lib/System/Makefile
index 9947e9902b..d360eed10c 100644
--- a/ghc/tests/lib/System/Makefile
+++ b/ghc/tests/lib/System/Makefile
@@ -1,35 +1,11 @@
+# -----------------------------------------------------------------------------
+# $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
diff --git a/ghc/tests/lib/System/getArgs001.stdout b/ghc/tests/lib/System/getArgs001.stdout
index 3d23060901..73441550fd 100644
--- a/ghc/tests/lib/System/getArgs001.stdout
+++ b/ghc/tests/lib/System/getArgs001.stdout
@@ -1 +1 @@
-io003.bin
+getArgs001.bin
diff --git a/ghc/tests/lib/System/system001.hs b/ghc/tests/lib/System/system001.hs
index ac12847e52..f6a8b0d274 100644
--- a/ghc/tests/lib/System/system001.hs
+++ b/ghc/tests/lib/System/system001.hs
@@ -7,7 +7,7 @@ main =
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")
diff --git a/ghc/tests/lib/System/system001.stdout b/ghc/tests/lib/System/system001.stdout
index ac12847e52..f6a8b0d274 100644
--- a/ghc/tests/lib/System/system001.stdout
+++ b/ghc/tests/lib/System/system001.stdout
@@ -7,7 +7,7 @@ main =
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")
diff --git a/ghc/tests/lib/Time/Makefile b/ghc/tests/lib/Time/Makefile
new file mode 100644
index 0000000000..fa2d723557
--- /dev/null
+++ b/ghc/tests/lib/Time/Makefile
@@ -0,0 +1,9 @@
+# -----------------------------------------------------------------------------
+# $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
diff --git a/ghc/tests/lib/TimeExts/Makefile b/ghc/tests/lib/TimeExts/Makefile
new file mode 100644
index 0000000000..66144ce4d4
--- /dev/null
+++ b/ghc/tests/lib/TimeExts/Makefile
@@ -0,0 +1,11 @@
+# -----------------------------------------------------------------------------
+# $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
diff --git a/ghc/tests/lib/Time/time001.hs b/ghc/tests/lib/TimeExts/timeexts001.hs
index 30c7280d37..30c7280d37 100644
--- a/ghc/tests/lib/Time/time001.hs
+++ b/ghc/tests/lib/TimeExts/timeexts001.hs
diff --git a/ghc/tests/lib/Time/time001.stdout b/ghc/tests/lib/TimeExts/timeexts001.stdout
index c2e987e94e..c2e987e94e 100644
--- a/ghc/tests/lib/Time/time001.stdout
+++ b/ghc/tests/lib/TimeExts/timeexts001.stdout