From: simonmar Date: Mon, 21 May 2001 15:25:25 +0000 (+0000) Subject: [project @ 2001-05-21 15:25:24 by simonmar] X-Git-Tag: Approximately_9120_patches~1910 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e1cfeccd83cf4c36f54e2fa9ac9ce5a844150015;p=ghc-hetmet.git [project @ 2001-05-21 15:25:24 by simonmar] More test reorganisation - most of these tests work now. --- diff --git a/ghc/tests/lib/CPUTime/Makefile b/ghc/tests/lib/CPUTime/Makefile new file mode 100644 index 0000000..4846508 --- /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 0000000..4846508 --- /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 0df9e00..c04a015 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 829a9f9..7c48a93 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 55dab93..0f93ceb 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 97faf05..a52da9d 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 9d3e242..e2ed9b7 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 0000000..8881b92 --- /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 similarity index 75% rename from ghc/tests/lib/should_run/io001.hs rename to ghc/tests/lib/IOExts/hTell001.hs index ec16fda..b5a6033 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 similarity index 87% rename from ghc/tests/lib/should_run/io001.stdout rename to ghc/tests/lib/IOExts/hTell001.stdout index 1cb7f40..f7f2f28 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 similarity index 100% rename from ghc/tests/lib/should_run/io002.hs rename to ghc/tests/lib/IOExts/hTell002.hs diff --git a/ghc/tests/lib/should_run/io002.stdout b/ghc/tests/lib/IOExts/hTell002.stdout similarity index 100% rename from ghc/tests/lib/should_run/io002.stdout rename to ghc/tests/lib/IOExts/hTell002.stdout diff --git a/ghc/tests/lib/should_run/ioexts002.hs b/ghc/tests/lib/IOExts/performGC001.hs similarity index 76% rename from ghc/tests/lib/should_run/ioexts002.hs rename to ghc/tests/lib/IOExts/performGC001.hs index e9c8575..e680eb8 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 similarity index 100% rename from ghc/tests/lib/should_run/ioexts002.stdout rename to 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 0000000..7b26514 --- /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 similarity index 92% rename from ghc/tests/lib/should_run/ioexts001.hs rename to ghc/tests/lib/IORef/ioref001.hs index 7b9d1b3..50bd747 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 similarity index 100% rename from ghc/tests/lib/should_run/ioexts001.stdout rename to ghc/tests/lib/IORef/ioref001.stdout diff --git a/ghc/tests/lib/Makefile b/ghc/tests/lib/Makefile index f273ff4..8c933d2 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 9947e99..d360eed 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 3d23060..7344155 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 ac12847..f6a8b0d 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 ac12847..f6a8b0d 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 0000000..fa2d723 --- /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 0000000..66144ce --- /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 similarity index 100% rename from ghc/tests/lib/Time/time001.hs rename to ghc/tests/lib/TimeExts/timeexts001.hs diff --git a/ghc/tests/lib/Time/time001.stdout b/ghc/tests/lib/TimeExts/timeexts001.stdout similarity index 100% rename from ghc/tests/lib/Time/time001.stdout rename to ghc/tests/lib/TimeExts/timeexts001.stdout