[project @ 2001-05-21 15:25:24 by simonmar]
authorsimonmar <unknown>
Mon, 21 May 2001 15:25:25 +0000 (15:25 +0000)
committersimonmar <unknown>
Mon, 21 May 2001 15:25:25 +0000 (15:25 +0000)
More test reorganisation - most of these tests work now.

26 files changed:
ghc/tests/lib/CPUTime/Makefile [new file with mode: 0644]
ghc/tests/lib/Directory/Makefile [new file with mode: 0644]
ghc/tests/lib/Directory/directory001.hs
ghc/tests/lib/Directory/getDirectoryContents001.hs
ghc/tests/lib/Directory/getDirectoryContents001.stdout
ghc/tests/lib/Directory/getPermissions001.hs
ghc/tests/lib/IO/Makefile
ghc/tests/lib/IOExts/Makefile [new file with mode: 0644]
ghc/tests/lib/IOExts/hTell001.hs [moved from ghc/tests/lib/should_run/io001.hs with 75% similarity]
ghc/tests/lib/IOExts/hTell001.stdout [moved from ghc/tests/lib/should_run/io001.stdout with 87% similarity]
ghc/tests/lib/IOExts/hTell002.hs [moved from ghc/tests/lib/should_run/io002.hs with 100% similarity]
ghc/tests/lib/IOExts/hTell002.stdout [moved from ghc/tests/lib/should_run/io002.stdout with 100% similarity]
ghc/tests/lib/IOExts/performGC001.hs [moved from ghc/tests/lib/should_run/ioexts002.hs with 76% similarity]
ghc/tests/lib/IOExts/performGC001.stdout [moved from ghc/tests/lib/should_run/ioexts002.stdout with 100% similarity]
ghc/tests/lib/IORef/Makefile [new file with mode: 0644]
ghc/tests/lib/IORef/ioref001.hs [moved from ghc/tests/lib/should_run/ioexts001.hs with 92% similarity]
ghc/tests/lib/IORef/ioref001.stdout [moved from ghc/tests/lib/should_run/ioexts001.stdout with 100% similarity]
ghc/tests/lib/Makefile
ghc/tests/lib/System/Makefile
ghc/tests/lib/System/getArgs001.stdout
ghc/tests/lib/System/system001.hs
ghc/tests/lib/System/system001.stdout
ghc/tests/lib/Time/Makefile [new file with mode: 0644]
ghc/tests/lib/TimeExts/Makefile [new file with mode: 0644]
ghc/tests/lib/TimeExts/timeexts001.hs [moved from ghc/tests/lib/Time/time001.hs with 100% similarity]
ghc/tests/lib/TimeExts/timeexts001.stdout [moved from ghc/tests/lib/Time/time001.stdout with 100% similarity]

diff --git a/ghc/tests/lib/CPUTime/Makefile b/ghc/tests/lib/CPUTime/Makefile
new file mode 100644 (file)
index 0000000..4846508
--- /dev/null
@@ -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 (file)
index 0000000..4846508
--- /dev/null
@@ -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
index 0df9e00..c04a015 100644 (file)
@@ -1,7 +1,6 @@
 import IO
 
 import Directory
-import IOExts (trace)
 
 main = do
     createDirectory "foo"
index 829a9f9..7c48a93 100644 (file)
@@ -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)
index 55dab93..0f93ceb 100644 (file)
@@ -1,5 +1,5 @@
-io009.bin
-io009.hs
-io009.o
-io009.stdout
+getDirectoryContents001.bin
+getDirectoryContents001.hs
+getDirectoryContents001.o
+getDirectoryContents001.stdout
 
index 97faf05..a52da9d 100644 (file)
@@ -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
index 9d3e242..e2ed9b7 100644 (file)
@@ -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 (file)
index 0000000..8881b92
--- /dev/null
@@ -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
similarity index 75%
rename from ghc/tests/lib/should_run/io001.hs
rename to ghc/tests/lib/IOExts/hTell001.hs
index ec16fda..b5a6033 100644 (file)
@@ -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 $
similarity index 87%
rename from ghc/tests/lib/should_run/io001.stdout
rename to ghc/tests/lib/IOExts/hTell001.stdout
index 1cb7f40..f7f2f28 100644 (file)
@@ -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'
similarity index 76%
rename from ghc/tests/lib/should_run/ioexts002.hs
rename to ghc/tests/lib/IOExts/performGC001.hs
index e9c8575..e680eb8 100644 (file)
@@ -1,5 +1,3 @@
-module Main where
-
 -- !!! test IOExts.performGC
 
 import IOExts
diff --git a/ghc/tests/lib/IORef/Makefile b/ghc/tests/lib/IORef/Makefile
new file mode 100644 (file)
index 0000000..7b26514
--- /dev/null
@@ -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
similarity index 92%
rename from ghc/tests/lib/should_run/ioexts001.hs
rename to ghc/tests/lib/IORef/ioref001.hs
index 7b9d1b3..50bd747 100644 (file)
@@ -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
index f273ff4..8c933d2 100644 (file)
@@ -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
index 9947e99..d360eed 100644 (file)
@@ -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
index ac12847..f6a8b0d 100644 (file)
@@ -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")
index ac12847..f6a8b0d 100644 (file)
@@ -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 (file)
index 0000000..fa2d723
--- /dev/null
@@ -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 (file)
index 0000000..66144ce
--- /dev/null
@@ -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