Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
61c1f542
Commit
61c1f542
authored
Nov 20, 2007
by
Simon Marlow
Browse files
test repeated open/close of 1000 files
parent
827f8cea
Changes
2
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/lib/IO/all.T
View file @
61c1f542
...
...
@@ -69,6 +69,8 @@ clean(['openFile006.out'])
test
('
openFile007
',
compose
(
expect_fail_if_compiler_type
('
hugs
'),
expect_fail_if_windows
),
compile_and_run
,
[''])
clean
(['
openFile007.out
'])
test
('
openFile008
',
normal
,
compile_and_run
,
[''])
test
('
putStr001
',
normal
,
compile_and_run
,
[''])
test
('
readFile001
',
compose
(
expect_fail_if_compiler_type
('
hugs
'),
expect_fail_if_windows
),
compile_and_run
,
[''])
...
...
testsuite/tests/ghc-regress/lib/IO/openFile008.hs
0 → 100644
View file @
61c1f542
import
System.IO
import
System.Cmd
import
System.FilePath
import
Text.Printf
import
System.Directory
import
Control.Monad
testdir
=
"openFile008_testdir"
-- Test repeated opening/closing of 1000 files. This is useful for guaging
-- the performance of open/close and file locking.
main
=
do
system
(
"rm -rf "
++
testdir
)
createDirectory
testdir
let
filenames
=
[
testdir
</>
printf
"file%03d"
(
n
::
Int
)
|
n
<-
[
1
..
1000
]]
forM_
[
1
..
50
]
$
\
_
->
do
hs
<-
mapM
(
\
f
->
openFile
f
WriteMode
)
filenames
mapM_
hClose
hs
mapM_
removeFile
filenames
removeDirectory
testdir
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment