all.T 8.35 KB
Newer Older
1 2
# -----------------------------------------------------------------------------
# These tests we do even for 'make fast'
3

4 5 6 7
test('conc003', normal, compile_and_run, [''])
test('conc006', normal, compile_and_run, [''])
test('conc027', normal, compile_and_run, [''])
test('conc051', normal, compile_and_run, [''])
8 9

if ('threaded1' in config.run_ways):
10
   only_threaded_ways = only_ways(['ghci','threaded1','threaded2'])
11
else:
12
   only_threaded_ways = skip
13

14
test('conc069', only_threaded_ways, compile_and_run, [''])
15
test('conc069a', only_threaded_ways, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
16 17
# this test gives slightly different results for non-threaded ways, so omit
# those for now.
18
test('conc070', only_threaded_ways, compile_and_run, [''])
19

20 21
test('conc071', omit_ways(['threaded2']), compile_and_run, [''])
test('conc072', only_ways(['threaded2']), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
22
test('conc073', normal, compile_and_run, [''])
23

24 25
test('1980', normal, compile_and_run, [''])
test('2910', normal, compile_and_run, [''])
26
test('2910a', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
27
test('3279', normal, compile_and_run, [''])
28

Simon Marlow's avatar
Simon Marlow committed
29 30 31
# This test takes a long time with the default context switch interval
test('3429', extra_run_opts('+RTS -i0.001 -RTS'), compile_and_run, [''])

Simon Marlow's avatar
Simon Marlow committed
32 33 34 35 36
# without -O, goes into an infinite loop
# GHCi cannot deterct the infinite loop, because the thread is always reachable
# (see also conc033 and others).  We should really fix this.
test('4030', omit_ways('ghci'), compile_and_run, ['-O'])

37
# each of these runs for about a second
Ian Lynagh's avatar
Ian Lynagh committed
38 39
test('throwto001', [reqlib('random'), extra_run_opts('1000 2000')],
                   compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
40
test('throwto002', [reqlib('random')], compile_and_run, [''])
41 42
test('throwto003', normal, compile_and_run, [''])

43 44 45 46 47 48
test('mask001', normal, compile_and_run, [''])
# ghci does not generate the BlockedIndefinitely exceptions, so omit:
test('mask002', omit_ways(['ghci']), compile_and_run, [''])

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

Simon Marlow's avatar
Simon Marlow committed
49 50
test('numsparks001', only_ways(['threaded1']), compile_and_run, [''])

51 52
test('4262', [ skip, # skip for now, it doesn't give reliable results
               only_ways(['threaded1']),
Ian Lynagh's avatar
Ian Lynagh committed
53 54
               unless_os('linux',skip),
               if_compiler_lt('ghc', '7.1', expect_fail) ],
Simon Marlow's avatar
Simon Marlow committed
55 56
             compile_and_run, [''])

57
test('4813', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
58
test('4811', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
59

60 61
test('allowinterrupt001', normal, compile_and_run, [''])

Simon Marlow's avatar
Simon Marlow committed
62 63 64
# try hard to provoke the error by running the test 100 times
test('5558',
     [ only_ways(['threaded2']),
Simon Marlow's avatar
Simon Marlow committed
65
       cmd_wrapper(lambda c: 'for i in `seq 1 100`; do ' + c + ' || break; done') ],
Simon Marlow's avatar
Simon Marlow committed
66 67
     compile_and_run, [''])

68 69 70 71 72 73 74 75 76
# -----------------------------------------------------------------------------
# These tests we only do for a full run

def f( opts ):
  if config.fast:
  	opts.skip = 1

setTestOpts(f)

77 78
test('conc001', normal, compile_and_run, [''])
test('conc002', normal, compile_and_run, [''])
79 80 81 82

# Omit GHCi way - it blows up to 0.5G.  Something to do with the threaded RTS?
test('conc004', omit_ways(['ghci']), compile_and_run, [''])

ross's avatar
ross committed
83 84 85 86 87 88 89
test('conc007', compose(only_compiler_types(['ghc']),
			extra_run_opts('+RTS -H128M -RTS')),
		compile_and_run, [''])
test('conc008', only_compiler_types(['ghc']), compile_and_run, [''])
test('conc009', compose(only_compiler_types(['ghc']), exit_code(1)),
		compile_and_run, [''])
test('conc010', only_compiler_types(['ghc']), compile_and_run, [''])
90 91 92

# conc012(ghci) needs a smaller stack, or it takes forever
test('conc012', normal, compile_and_run, ['+RTS -K8m -RTS'])
93

94
test('conc013', only_compiler_types(['ghc']), compile_and_run, [''])
95

ross's avatar
ross committed
96 97
test('conc014', only_compiler_types(['ghc']), compile_and_run, [''])
test('conc015', only_compiler_types(['ghc']), compile_and_run, [''])
98
test('conc015a', only_compiler_types(['ghc']), compile_and_run, [''])
99
test('conc016', [ omit_ways(['threaded2']), # see comment in conc016.hs
100
                  only_compiler_types(['ghc']) ], compile_and_run, [''])
ross's avatar
ross committed
101
test('conc017', only_compiler_types(['ghc']), compile_and_run, [''])
102
test('conc017a', only_compiler_types(['ghc']), compile_and_run, [''])
ross's avatar
ross committed
103 104
test('conc018', only_compiler_types(['ghc']), compile_and_run, [''])
test('conc019', compose(only_compiler_types(['ghc']),
105
			extra_run_opts('+RTS -K16m -RTS')),
ross's avatar
ross committed
106 107
		compile_and_run, [''])
test('conc020', only_compiler_types(['ghc']), compile_and_run, [''])
108 109
test('conc021', compose(omit_ways(['ghci']), exit_code(1)),
	compile_and_run, [''])
ross's avatar
ross committed
110
test('conc022', only_compiler_types(['ghc']), compile_and_run, [''])
111 112 113 114 115 116 117 118 119 120 121 122 123

# On Windows, the non-threaded RTS creates a real OS thread for each 
# threadDelay.  conc023 creates 5000 concurrent threadDelays, and the
# resulting creation of OS threads seems to cause the system to run
# out of memory sometimes (I'm not sure exactly how/why this happens,
# but the threaded RTS fixes it).  See #1197.
if config.platform == 'i386-unknown-mingw32':
   conc023_ways = only_ways(['threaded1','threaded2'])
else:
   conc023_ways = normal

test('conc023', composes([skip_if_fast,
                          only_compiler_types(['ghc']),
Simon Marlow's avatar
Simon Marlow committed
124
                          reqlib('random'),
125 126
                          conc023_ways]), compile_and_run, [''])

ross's avatar
ross committed
127
test('conc024', only_compiler_types(['ghc']), compile_and_run, [''])
128
test('conc025', normal, compile_and_run, [''])
ross's avatar
ross committed
129
test('conc026', only_compiler_types(['ghc']), compile_and_run, [''])
130 131
test('conc028', normal, compile_and_run, [''])
test('conc029', normal, compile_and_run, [''])
ross's avatar
ross committed
132
test('conc030', compose(only_compiler_types(['ghc']),
133
			extra_run_opts('+RTS -K4M -RTS')),
ross's avatar
ross committed
134
		compile_and_run, [''])
135

Ian Lynagh's avatar
Ian Lynagh committed
136
test('conc031', normal, compile_and_run, [''])
137

ross's avatar
ross committed
138
test('conc032', only_compiler_types(['ghc']), compile_and_run, [''])
139 140

# Omit for GHCi, because it just sits there waiting for you to press ^C
141
test('conc033', omit_ways(['ghci']), compile_and_run, [''])
142 143

# Omit for GHCi, because it just sits there waiting for you to press ^C
ross's avatar
ross committed
144
test('conc034', compose(only_compiler_types(['ghc']),
145
			compose(omit_ways(['ghci']), 
ross's avatar
ross committed
146
			extra_run_opts('+RTS -C0 -RTS'))),
147
		compile_and_run, [''])
148

ross's avatar
ross committed
149
test('conc035', only_compiler_types(['ghc']), compile_and_run, [''])
150

Simon Marlow's avatar
Simon Marlow committed
151 152 153
# Omit for GHCi: firstly GHCi doesn't have unsafe FFI calls, and secondly
# the main thread cannot receive the deadlock exception because it can be
# woken up by ^C.
Simon Marlow's avatar
Simon Marlow committed
154 155
# Omit for threaded2: this test is really bogus and fails to do anything
# sensible for more than one CPU.
156
test('conc036', compose(skip_if_fast,
Simon Marlow's avatar
Simon Marlow committed
157
		  compose(omit_ways(['ghci','threaded2']),
Simon Marlow's avatar
Simon Marlow committed
158
		    only_compiler_types(['ghc']))), compile_and_run, [''])
159 160 161 162
# Interrupting foreign calls only makes sense if we are threaded
test('foreignInterruptible', composes([skip_if_fast,
			               only_threaded_ways,
				       only_compiler_types(['ghc'])]), compile_and_run, [''])
163

164 165
test('conc037', only_ways(['threaded1','threaded2']), compile_and_run, [''])
test('conc038', only_ways(['threaded1','threaded2']), compile_and_run, [''])
166

167
# Omit for GHCi, uses foreign export
168
# Omit for the threaded ways, because in this case the main thread is allowed to 
Simon Marlow's avatar
Simon Marlow committed
169
# complete, which causes the child thread to be interrupted.
Ian Lynagh's avatar
Ian Lynagh committed
170
test('conc039', omit_ways(['ghci','threaded1','threaded2','profthreaded']), compile_and_run, [''])
171 172

# Omit for GHCi, uses foreign export
ross's avatar
ross committed
173 174
test('conc040', compose(only_compiler_types(['ghc']),
			compose(exit_code(1),
175
			omit_ways(['ghci']))),
ross's avatar
ross committed
176
		compile_and_run, [''])
177

178
# STM-related tests.
179 180 181 182 183
test('conc041', only_compiler_types(['ghc']), compile_and_run, [''])
test('conc042', only_compiler_types(['ghc']), compile_and_run, [''])
test('conc043', only_compiler_types(['ghc']), compile_and_run, [''])
test('conc044', only_compiler_types(['ghc']), compile_and_run, [''])
test('conc045', only_compiler_types(['ghc']), compile_and_run, [''])
184

185
test('conc058', only_compiler_types(['ghc']), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
186

Ian Lynagh's avatar
Ian Lynagh committed
187 188 189
test('conc059',
     [only_compiler_types(['ghc']),
      only_ways(['threaded1','threaded2']),
Simon Marlow's avatar
Simon Marlow committed
190
      compile_cmd_prefix('$MAKE conc059_setup && '),
Ian Lynagh's avatar
Ian Lynagh committed
191 192
      extra_clean(['conc059_c.o'])],
     compile_and_run,
Simon Marlow's avatar
Simon Marlow committed
193
     ['conc059_c.c -no-hs-main'])
Simon Marlow's avatar
Simon Marlow committed
194

195 196
# This test sometimes just exits successfully
# when run the threaded2 way. The problem hasn't been diagnosed yet
197
test('conc064',
198
     exit_code(1),
199
     compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
200 201 202

test('conc065', ignore_output, compile_and_run, [''])
test('conc066', ignore_output, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
203
test('conc067', ignore_output, compile_and_run, [''])
204 205 206 207

# omit threaded2, the behaviour of this test is non-deterministic with more
# than one CPU.
test('conc068', [ omit_ways('threaded2'), exit_code(1) ], compile_and_run, [''])