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

ian@well-typed.com's avatar
ian@well-typed.com committed
3
def expect_fail_if_windows(name, opts):
4
   f = when(opsys('mingw32'), expect_fail);
ian@well-typed.com's avatar
ian@well-typed.com committed
5
   return f(normal, opts);
6

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

test('IOError002',      normal, compile_and_run, [''])
test('finalization001', normal, compile_and_run, [''])
12 13
test('hClose001', [], compile_and_run, [''])
test('hClose002', [], compile_and_run, [''])
14 15
test('hClose003',       reqlib('unix'), compile_and_run, ['-package unix'])
test('hFileSize001',    normal, compile_and_run, [''])
16 17
test('hFileSize002', [omit_ways(['ghci'])], compile_and_run, [''])
test('hFlush001', [], compile_and_run, [''])
18 19

test('hGetBuffering001', 
20
	[omit_ways(['ghci']), set_stdin('hGetBuffering001.hs')], 
21 22 23 24 25 26
	compile_and_run, [''])

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, [''])
27
test('hGetPosn001', [], compile_and_run, ['-cpp'])
28
test('hIsEOF001',   normal, compile_and_run, [''])
29
test('hIsEOF002', [], compile_and_run, ['-cpp'])
30 31 32 33 34 35 36

test('hReady001', normal, compile_and_run, ['-cpp'])

# 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'])
37 38
test('hReady002', [cmd_prefix('sleep 1 |'), omit_ways(['ghci']),
                   multi_cpu_race],
39
     compile_and_run, [''])
40 41 42 43

test('hSeek001', normal, compile_and_run, [''])
test('hSeek002', normal, compile_and_run, ['-cpp'])
test('hSeek003', normal, compile_and_run, ['-cpp'])
44
test('hSeek004', [], compile_and_run, ['-cpp'])
45 46 47

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

48 49
test('hSetBuffering003',
    [omit_ways(['ghci']), set_stdin('hSetBuffering003.hs')], 
50 51 52 53 54 55 56
	compile_and_run, [''])

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

test('ioeGetErrorString001', normal, compile_and_run, ['-cpp'])
test('ioeGetFileName001',    normal, compile_and_run, ['-cpp'])
test('ioeGetHandle001',      normal, compile_and_run, ['-cpp'])
57
test('isEOF001', extra_run_opts('</dev/null'), compile_and_run, [''])
58

59 60
test('misc001', [extra_run_opts('misc001.hs misc001.out')], compile_and_run,
     [''])
61 62 63

test('openFile001',  normal, compile_and_run, [''])
test('openFile002',  exit_code(1), compile_and_run, [''])
64 65 66 67 68
test('openFile003', [], compile_and_run, [''])
test('openFile004', [], compile_and_run, [''])
test('openFile005', [], compile_and_run, [''])
test('openFile006', [], compile_and_run, [''])
test('openFile007', [], compile_and_run, [''])
69
test('openFile008', cmd_prefix('ulimit -n 2048; '), compile_and_run, [''])
70 71

test('putStr001',    normal, compile_and_run, [''])
72 73
test('readFile001', [], compile_and_run, [''])
test('readwrite001', [], compile_and_run, ['-cpp'])
74 75


76
test('readwrite002', [omit_ways(['ghci']), set_stdin('readwrite002.hs')],
77 78
     compile_and_run, ['-cpp'])

79
test('readwrite003', [], compile_and_run, [''])
80

81
test('hGetBuf001',
82
     [
83 84 85
      when(fast(), skip),
      expect_fail_if_windows],
     compile_and_run, ['-package unix'])
86

87 88
# As discussed in #16819, this test is racy in a threaded environment.
test('hDuplicateTo001', [omit_ways(concurrent_ways)], compile_and_run, [''])
89

90
test('countReaders001', [], compile_and_run, [''])
91

92
test('concio001', [normal, multi_cpu_race],
Ben Gamari's avatar
Ben Gamari committed
93
     makefile_test, ['test.concio001'])
94
test('concio001.thr', [extra_files(['concio001.hs']), multi_cpu_race],
Ben Gamari's avatar
Ben Gamari committed
95
     makefile_test, ['test.concio001.thr'])
96 97 98

test('concio002', reqlib('process'), compile_and_run, [''])

99
test('T2122', [], compile_and_run, [''])
Ben Gamari's avatar
Ben Gamari committed
100
test('T3307', [], makefile_test, ['T3307-test'])
101
test('T4855', normal, compile_and_run, [''])
102 103 104 105 106 107 108 109 110 111 112 113 114

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

encoding001Encodings = ["utf8", "utf8_bom", "utf16", "utf16le",
                        "utf16be", "utf32", "utf32le", "utf32be"]
encoding001CleanFiles = []
for e in encoding001Encodings:
    encoding001CleanFiles.append('encoding001.' + e)
for e1 in encoding001Encodings:
    for e2 in encoding001Encodings:
        encoding001CleanFiles.append('encoding001.' + e1 + '.' + e2)
115
test('encoding001', [], compile_and_run, [''])
116 117

test('encoding002', normal, compile_and_run, [''])
batterseapower's avatar
batterseapower committed
118
test('encoding003', normal, compile_and_run, [''])
119
test('encoding004', extra_files(['encoded-data/']), compile_and_run, [''])
120
test('encoding005', normal, compile_and_run, [''])
121

Ben Gamari's avatar
Ben Gamari committed
122
test('environment001', [], makefile_test, ['environment001-test'])
123

124
test('newline001', [], compile_and_run, [''])
125 126 127 128 129 130 131

test('openTempFile001', normal, compile_and_run, [''])

test('T4144', normal, compile_and_run, [''])

test('encodingerror001', normal, compile_and_run, [''])

132
test('T4808', [exit_code(1)], compile_and_run, [''])
133
test('T4895', normal, compile_and_run, [''])
batterseapower's avatar
batterseapower committed
134
test('T7853', normal, compile_and_run, [''])