all.T 7.01 KB
Newer Older
1
# -*- coding: utf-8 -*-
2

3
def expect_fail_if_windows(opts):
4
   f = if_platform('i386-unknown-mingw32', expect_fail);
5
   return f(opts);
6

7
8
9
test('IOError001', compose(omit_ways(['ghci']), set_stdin('IOError001.hs')),
	compile_and_run, [''])

10
11
test('IOError002',      normal, compile_and_run, [''])
test('finalization001', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
12
13
test('hClose001',       extra_clean(['hClose001.tmp']), compile_and_run, [''])
test('hClose002',       extra_clean(['hClose002.tmp']), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
14
test('hClose003',       reqlib('unix'), compile_and_run, ['-package unix'])
15
test('hFileSize001',    normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
16
17
18
19
20
21
22
test('hFileSize002',
     [omit_ways(['ghci']),
      extra_clean(['hFileSize002.out'])],
     compile_and_run, [''])
test('hFlush001',
     extra_clean(['hFlush001.out']),
     compile_and_run, [''])
23
24
25
26
27

test('hGetBuffering001', 
	compose(omit_ways(['ghci']), set_stdin('hGetBuffering001.hs')), 
	compile_and_run, [''])

28
29
30
31
test('hGetChar001', normal, compile_and_run, [''])
test('hGetLine001', set_stdin('hGetLine001.hs'), compile_and_run, ['-cpp'])
test('hGetLine002', normal, compile_and_run, [''])
test('hGetLine003', normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
32
33
34
test('hGetPosn001',
     extra_clean(['hGetPosn001.out']),
     compile_and_run, ['-cpp'])
35
test('hIsEOF001',   normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
36
test('hIsEOF002', extra_clean(['hIsEOF002.out']), compile_and_run, ['-cpp'])
37

38
test('hReady001', normal, compile_and_run, ['-cpp'])
Simon Marlow's avatar
Simon Marlow committed
39
40
41
42
43
44
45
46

# hReady002 tests that hReady returns False for a pipe that has no
# data to read.  It relies on piping input from 'sleep 1', which doesn't
# work for the 'ghci' way because in that case we already pipe input from
# a script, so hence omit_ways(['ghci'])
test('hReady002', [ no_stdin, cmd_prefix('sleep 1 |'),
                    omit_ways(['ghci']) ],
                   compile_and_run, [''])
47

ross's avatar
ross committed
48
test('hSeek001', normal, compile_and_run, [''])
49
50
test('hSeek002', normal, compile_and_run, ['-cpp'])
test('hSeek003', normal, compile_and_run, ['-cpp'])
Ian Lynagh's avatar
Ian Lynagh committed
51
test('hSeek004', extra_clean(['hSeek004.out']), compile_and_run, ['-cpp'])
52
53
54

test('hSetBuffering002', set_stdin('hSetBuffering002.hs'), compile_and_run, [''])

55
56
57
test('hSetBuffering003', compose(omit_ways(['ghci']), 
				 set_stdin('hSetBuffering003.hs')), 
	compile_and_run, [''])
58

Simon Marlow's avatar
Simon Marlow committed
59
60
test('hSetBuffering004', set_stdin('hSetBuffering004.hs'), compile_and_run, [''])

61
62
63
64
65
test('ioeGetErrorString001', normal, compile_and_run, ['-cpp'])
test('ioeGetFileName001',    normal, compile_and_run, ['-cpp'])
test('ioeGetHandle001',      normal, compile_and_run, ['-cpp'])
test('isEOF001',     normal, compile_and_run, [''])

Ian Lynagh's avatar
Ian Lynagh committed
66
67
68
test('misc001',
     [extra_run_opts('misc001.hs misc001.out'),
      extra_clean(['misc001.out'])],
69
70
71
72
73
	compile_and_run, [''])

test('openFile001',  normal, compile_and_run, [''])
test('openFile002',  exit_code(1), compile_and_run, [''])
test('openFile003',  normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
74
75
76
77
78
79
80
81
82
83
test('openFile004',  extra_clean(['openFile004.out']), compile_and_run, [''])
test('openFile005',
     [if_compiler_type('hugs', expect_fail),
      extra_clean(['openFile005.out1', 'openFile005.out2'])],
     compile_and_run, [''])
test('openFile006', extra_clean(['openFile006.out']), compile_and_run, [''])
test('openFile007',
     [if_compiler_type('hugs', expect_fail),
      extra_clean(['openFile007.out'])],
     compile_and_run, [''])
84
test('openFile008', cmd_prefix('ulimit -n 1024; '), compile_and_run, [''])
85

86
test('putStr001',    normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
87
88
89
90
91
92
93
94
test('readFile001',
     [if_compiler_type('hugs', expect_fail),
      extra_clean(['readFile001.out'])],
     compile_and_run, [''])
test('readwrite001',
     extra_clean(['readwrite001.inout']),
     compile_and_run,
     ['-cpp'])
95

96
97

test('readwrite002',
Ian Lynagh's avatar
Ian Lynagh committed
98
99
     [omit_ways(['ghci']), 
      set_stdin('readwrite002.hs'),
100
      extra_clean(['readwrite002.inout'])],
101
     compile_and_run, ['-cpp'])
102

103
104
test('readwrite003', extra_clean(['readwrite003.txt']), compile_and_run, [''])

ross's avatar
ross committed
105
test('hGetBuf001', compose(only_compiler_types(['ghc']),
106
107
		   compose(skip_if_fast,
		     expect_fail_if_windows)), compile_and_run, ['-package unix'])
108

Ian Lynagh's avatar
Ian Lynagh committed
109
test('hDuplicateTo001', extra_clean(['tmp']), compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
110

Ian Lynagh's avatar
Ian Lynagh committed
111
test('countReaders001',
112
      extra_clean(['countReaders001.txt']),
Simon Marlow's avatar
Simon Marlow committed
113
      compile_and_run, [''])
114

115
116
117
118
test('concio001', skip, run_command, ['$MAKE -s --no-print-directory test.concio001'])
test('concio001.thr', skip, run_command, ['$MAKE -s --no-print-directory test.concio001.thr'])

test('concio002', reqlib('process'), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
119
120

test('2122', extra_clean(['2122-test']), compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
121
test('3307',
batterseapower's avatar
batterseapower committed
122
     [extra_clean(['chinese-file-小说', 'chinese-name'])],
Ian Lynagh's avatar
Ian Lynagh committed
123
124
     run_command,
     ['$MAKE -s --no-print-directory 3307-test'])
125
test('4855', normal, compile_and_run, [''])
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158

test('hSetEncoding001',extra_run_opts('hSetEncoding001.in'), compile_and_run, [''])
test('decodingerror001',normal, compile_and_run, [''])

test('encoding001',
     extra_clean([
           'encoding001.utf16', 'encoding001.utf16.utf16be',
           'encoding001.utf16.utf16le', 'encoding001.utf16.utf32',
           'encoding001.utf16.utf32be', 'encoding001.utf16.utf32le',
           'encoding001.utf16.utf8', 'encoding001.utf16be',
           'encoding001.utf16be.utf16', 'encoding001.utf16be.utf16le',
           'encoding001.utf16be.utf32', 'encoding001.utf16be.utf32be',
           'encoding001.utf16be.utf32le', 'encoding001.utf16be.utf8',
           'encoding001.utf16le', 'encoding001.utf16le.utf16',
           'encoding001.utf16le.utf16be', 'encoding001.utf16le.utf32',
           'encoding001.utf16le.utf32be', 'encoding001.utf16le.utf32le',
           'encoding001.utf16le.utf8', 'encoding001.utf32',
           'encoding001.utf32.utf16', 'encoding001.utf32.utf16be',
           'encoding001.utf32.utf16le', 'encoding001.utf32.utf32be',
           'encoding001.utf32.utf32le', 'encoding001.utf32.utf8',
           'encoding001.utf32be', 'encoding001.utf32be.utf16',
           'encoding001.utf32be.utf16be', 'encoding001.utf32be.utf16le',
           'encoding001.utf32be.utf32', 'encoding001.utf32be.utf32le',
           'encoding001.utf32be.utf8', 'encoding001.utf32le',
           'encoding001.utf32le.utf16', 'encoding001.utf32le.utf16be',
           'encoding001.utf32le.utf16le', 'encoding001.utf32le.utf32',
           'encoding001.utf32le.utf32be', 'encoding001.utf32le.utf8',
           'encoding001.utf8', 'encoding001.utf8.utf16',
           'encoding001.utf8.utf16be', 'encoding001.utf8.utf16le',
           'encoding001.utf8.utf32', 'encoding001.utf8.utf32be',
           'encoding001.utf8.utf32le']), 
     compile_and_run, [''])

159
160
161
162
test('encoding002', normal, compile_and_run, [''])

test('environment001', extra_clean(['environment001']), run_command, ['$MAKE -s --no-print-directory environment001-test'])

163
test('newline001', extra_clean(['newline001.out']), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
164
165

test('openTempFile001', normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
166
167
test('T4113', normal, compile_and_run, [''])

Simon Marlow's avatar
Simon Marlow committed
168
test('T4144', normal, compile_and_run, [''])
169
170

test('encodingerror001', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
171
172

test('4808', exit_code(1), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
173
test('4895', normal, compile_and_run, [''])