Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
5800 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
all.T 7.13 KiB
# -*- coding: utf-8 -*-

def expect_fail_if_windows(name, opts):
   f = when(opsys('mingw32'), expect_fail);
   return f(normal, opts);

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

test('IOError002',      normal, compile_and_run, [''])
test('finalization001', normal, compile_and_run, [''])
test('hClose001', [], compile_and_run, [''])
test('hClose002', [normalise_win32_io_errors, js_broken(22261)], compile_and_run, [''])
test('hFileSize001',    normal, compile_and_run, [''])
test('hFileSize002',
     [omit_ghci], # different output
     compile_and_run, [''])
test('hFlush001', [], compile_and_run, [''])

test('hGetBuffering001',
	[omit_ghci, # can't use stdin
   set_stdin('hGetBuffering001.hs')],
	compile_and_run, [''])

test('hGetContentsS001', normal, 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, [''])
test('hGetPosn001', [], compile_and_run, ['-cpp'])
test('hIsEOF001',   normal, compile_and_run, [''])
test('hIsEOF002', [], compile_and_run, ['-cpp'])

test('hReady001', js_broken(22374), 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_ghci
test('hReady002',
     [cmd_prefix('sleep 1 |'),
      omit_ghci,
      multi_cpu_race,
      js_broken(22374),
      when(arch('wasm32'), fragile(23275))],
     compile_and_run, [''])

test('hSeek001', normal, compile_and_run, [''])
test('hSeek002', normal, compile_and_run, ['-cpp'])
test('hSeek003', normal, compile_and_run, ['-cpp'])
test('hSeek004', [], compile_and_run, ['-cpp'])

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

test('hSetBuffering003',
    [ omit_ghci # ghci's initial buffering setting is different, and this test checks that
    , set_stdin('hSetBuffering003.hs')
    , js_broken(22261)
    ],
	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'])
test('isEOF001', [extra_run_opts('</dev/null'), when(arch('wasm32'), fragile(23275))], compile_and_run, [''])

test('misc001', [extra_run_opts('misc001.hs misc001.out')], compile_and_run,
     [''])