fUnit 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,511 @@
1
+ %!PS-Adobe-3.0
2
+ %%BoundingBox: 24 24 588 768
3
+ %%Title: Enscript Output
4
+ %%For: Bil Kleb
5
+ %%Creator: GNU enscript 1.6.1
6
+ %%CreationDate: Wed Nov 7 08:24:23 2001
7
+ %%Orientation: Landscape
8
+ %%Pages: (atend)
9
+ %%DocumentMedia: Letter 612 792 0 () ()
10
+ %%DocumentNeededResources: (atend)
11
+ %%EndComments
12
+ %%BeginProlog
13
+ %%BeginResource: procset Enscript-Prolog 1.6 1
14
+ %
15
+ % Procedures.
16
+ %
17
+
18
+ /_S { % save current state
19
+ /_s save def
20
+ } def
21
+ /_R { % restore from saved state
22
+ _s restore
23
+ } def
24
+
25
+ /S { % showpage protecting gstate
26
+ gsave
27
+ showpage
28
+ grestore
29
+ } bind def
30
+
31
+ /MF { % fontname newfontname -> - make a new encoded font
32
+ /newfontname exch def
33
+ /fontname exch def
34
+
35
+ /fontdict fontname findfont def
36
+ /newfont fontdict maxlength dict def
37
+
38
+ fontdict {
39
+ exch
40
+ dup /FID eq {
41
+ % skip FID pair
42
+ pop pop
43
+ } {
44
+ % copy to the new font dictionary
45
+ exch newfont 3 1 roll put
46
+ } ifelse
47
+ } forall
48
+
49
+ newfont /FontName newfontname put
50
+
51
+ % insert only valid encoding vectors
52
+ encoding_vector length 256 eq {
53
+ newfont /Encoding encoding_vector put
54
+ } if
55
+
56
+ newfontname newfont definefont pop
57
+ } def
58
+
59
+ /SF { % fontname width height -> - set a new font
60
+ /height exch def
61
+ /width exch def
62
+
63
+ findfont
64
+ [width 0 0 height 0 0] makefont setfont
65
+ } def
66
+
67
+ /SUF { % fontname width height -> - set a new user font
68
+ /height exch def
69
+ /width exch def
70
+
71
+ /F-gs-user-font MF
72
+ /F-gs-user-font width height SF
73
+ } def
74
+
75
+ /M {moveto} bind def
76
+ /s {show} bind def
77
+
78
+ /Box { % x y w h -> - define box path
79
+ /d_h exch def /d_w exch def /d_y exch def /d_x exch def
80
+ d_x d_y moveto
81
+ d_w 0 rlineto
82
+ 0 d_h rlineto
83
+ d_w neg 0 rlineto
84
+ closepath
85
+ } def
86
+
87
+ /bgs { % x y height blskip gray str -> - show string with bg color
88
+ /str exch def
89
+ /gray exch def
90
+ /blskip exch def
91
+ /height exch def
92
+ /y exch def
93
+ /x exch def
94
+
95
+ gsave
96
+ x y blskip sub str stringwidth pop height Box
97
+ gray setgray
98
+ fill
99
+ grestore
100
+ x y M str s
101
+ } def
102
+
103
+ % Highlight bars.
104
+ /highlight_bars { % nlines lineheight output_y_margin gray -> -
105
+ gsave
106
+ setgray
107
+ /ymarg exch def
108
+ /lineheight exch def
109
+ /nlines exch def
110
+
111
+ % This 2 is just a magic number to sync highlight lines to text.
112
+ 0 d_header_y ymarg sub 2 sub translate
113
+
114
+ /cw d_output_w cols div def
115
+ /nrows d_output_h ymarg 2 mul sub lineheight div cvi def
116
+
117
+ % for each column
118
+ 0 1 cols 1 sub {
119
+ cw mul /xp exch def
120
+
121
+ % for each rows
122
+ 0 1 nrows 1 sub {
123
+ /rn exch def
124
+ rn lineheight mul neg /yp exch def
125
+ rn nlines idiv 2 mod 0 eq {
126
+ % Draw highlight bar. 4 is just a magic indentation.
127
+ xp 4 add yp cw 8 sub lineheight neg Box fill
128
+ } if
129
+ } for
130
+ } for
131
+
132
+ grestore
133
+ } def
134
+
135
+ % Line highlight bar.
136
+ /line_highlight { % x y width height gray -> -
137
+ gsave
138
+ /gray exch def
139
+ Box gray setgray fill
140
+ grestore
141
+ } def
142
+
143
+ % Column separator lines.
144
+ /column_lines {
145
+ gsave
146
+ .1 setlinewidth
147
+ 0 d_footer_h translate
148
+ /cw d_output_w cols div def
149
+ 1 1 cols 1 sub {
150
+ cw mul 0 moveto
151
+ 0 d_output_h rlineto stroke
152
+ } for
153
+ grestore
154
+ } def
155
+
156
+ % Column borders.
157
+ /column_borders {
158
+ gsave
159
+ .1 setlinewidth
160
+ 0 d_footer_h moveto
161
+ 0 d_output_h rlineto
162
+ d_output_w 0 rlineto
163
+ 0 d_output_h neg rlineto
164
+ closepath stroke
165
+ grestore
166
+ } def
167
+
168
+ % Do the actual underlay drawing
169
+ /draw_underlay {
170
+ ul_style 0 eq {
171
+ ul_str true charpath stroke
172
+ } {
173
+ ul_str show
174
+ } ifelse
175
+ } def
176
+
177
+ % Underlay
178
+ /underlay { % - -> -
179
+ gsave
180
+ 0 d_page_h translate
181
+ d_page_h neg d_page_w atan rotate
182
+
183
+ ul_gray setgray
184
+ ul_font setfont
185
+ /dw d_page_h dup mul d_page_w dup mul add sqrt def
186
+ ul_str stringwidth pop dw exch sub 2 div ul_h_ptsize -2 div moveto
187
+ draw_underlay
188
+ grestore
189
+ } def
190
+
191
+ /user_underlay { % - -> -
192
+ gsave
193
+ ul_x ul_y translate
194
+ ul_angle rotate
195
+ ul_gray setgray
196
+ ul_font setfont
197
+ 0 0 ul_h_ptsize 2 div sub moveto
198
+ draw_underlay
199
+ grestore
200
+ } def
201
+
202
+ % Page prefeed
203
+ /page_prefeed { % bool -> -
204
+ statusdict /prefeed known {
205
+ statusdict exch /prefeed exch put
206
+ } {
207
+ pop
208
+ } ifelse
209
+ } def
210
+
211
+ % Wrapped line markers
212
+ /wrapped_line_mark { % x y charwith charheight type -> -
213
+ /type exch def
214
+ /h exch def
215
+ /w exch def
216
+ /y exch def
217
+ /x exch def
218
+
219
+ type 2 eq {
220
+ % Black boxes (like TeX does)
221
+ gsave
222
+ 0 setlinewidth
223
+ x w 4 div add y M
224
+ 0 h rlineto w 2 div 0 rlineto 0 h neg rlineto
225
+ closepath fill
226
+ grestore
227
+ } {
228
+ type 3 eq {
229
+ % Small arrows
230
+ gsave
231
+ .2 setlinewidth
232
+ x w 2 div add y h 2 div add M
233
+ w 4 div 0 rlineto
234
+ x w 4 div add y lineto stroke
235
+
236
+ x w 4 div add w 8 div add y h 4 div add M
237
+ x w 4 div add y lineto
238
+ w 4 div h 8 div rlineto stroke
239
+ grestore
240
+ } {
241
+ % do nothing
242
+ } ifelse
243
+ } ifelse
244
+ } def
245
+
246
+ % EPSF import.
247
+
248
+ /BeginEPSF {
249
+ /b4_Inc_state save def % Save state for cleanup
250
+ /dict_count countdictstack def % Count objects on dict stack
251
+ /op_count count 1 sub def % Count objects on operand stack
252
+ userdict begin
253
+ /showpage { } def
254
+ 0 setgray 0 setlinecap
255
+ 1 setlinewidth 0 setlinejoin
256
+ 10 setmiterlimit [ ] 0 setdash newpath
257
+ /languagelevel where {
258
+ pop languagelevel
259
+ 1 ne {
260
+ false setstrokeadjust false setoverprint
261
+ } if
262
+ } if
263
+ } bind def
264
+
265
+ /EndEPSF {
266
+ count op_count sub { pos } repeat % Clean up stacks
267
+ countdictstack dict_count sub { end } repeat
268
+ b4_Inc_state restore
269
+ } bind def
270
+
271
+ % Check PostScript language level.
272
+ /languagelevel where {
273
+ pop /gs_languagelevel languagelevel def
274
+ } {
275
+ /gs_languagelevel 1 def
276
+ } ifelse
277
+ %%EndResource
278
+ %%BeginResource: procset Enscript-Encoding-88591 1.6 1
279
+ /encoding_vector [
280
+ /.notdef /.notdef /.notdef /.notdef
281
+ /.notdef /.notdef /.notdef /.notdef
282
+ /.notdef /.notdef /.notdef /.notdef
283
+ /.notdef /.notdef /.notdef /.notdef
284
+ /.notdef /.notdef /.notdef /.notdef
285
+ /.notdef /.notdef /.notdef /.notdef
286
+ /.notdef /.notdef /.notdef /.notdef
287
+ /.notdef /.notdef /.notdef /.notdef
288
+ /space /exclam /quotedbl /numbersign
289
+ /dollar /percent /ampersand /quoteright
290
+ /parenleft /parenright /asterisk /plus
291
+ /comma /hyphen /period /slash
292
+ /zero /one /two /three
293
+ /four /five /six /seven
294
+ /eight /nine /colon /semicolon
295
+ /less /equal /greater /question
296
+ /at /A /B /C
297
+ /D /E /F /G
298
+ /H /I /J /K
299
+ /L /M /N /O
300
+ /P /Q /R /S
301
+ /T /U /V /W
302
+ /X /Y /Z /bracketleft
303
+ /backslash /bracketright /asciicircum /underscore
304
+ /quoteleft /a /b /c
305
+ /d /e /f /g
306
+ /h /i /j /k
307
+ /l /m /n /o
308
+ /p /q /r /s
309
+ /t /u /v /w
310
+ /x /y /z /braceleft
311
+ /bar /braceright /tilde /.notdef
312
+ /.notdef /.notdef /.notdef /.notdef
313
+ /.notdef /.notdef /.notdef /.notdef
314
+ /.notdef /.notdef /.notdef /.notdef
315
+ /.notdef /.notdef /.notdef /.notdef
316
+ /.notdef /.notdef /.notdef /.notdef
317
+ /.notdef /.notdef /.notdef /.notdef
318
+ /.notdef /.notdef /.notdef /.notdef
319
+ /.notdef /.notdef /.notdef /.notdef
320
+ /space /exclamdown /cent /sterling
321
+ /currency /yen /brokenbar /section
322
+ /dieresis /copyright /ordfeminine /guillemotleft
323
+ /logicalnot /hyphen /registered /macron
324
+ /degree /plusminus /twosuperior /threesuperior
325
+ /acute /mu /paragraph /bullet
326
+ /cedilla /onesuperior /ordmasculine /guillemotright
327
+ /onequarter /onehalf /threequarters /questiondown
328
+ /Agrave /Aacute /Acircumflex /Atilde
329
+ /Adieresis /Aring /AE /Ccedilla
330
+ /Egrave /Eacute /Ecircumflex /Edieresis
331
+ /Igrave /Iacute /Icircumflex /Idieresis
332
+ /Eth /Ntilde /Ograve /Oacute
333
+ /Ocircumflex /Otilde /Odieresis /multiply
334
+ /Oslash /Ugrave /Uacute /Ucircumflex
335
+ /Udieresis /Yacute /Thorn /germandbls
336
+ /agrave /aacute /acircumflex /atilde
337
+ /adieresis /aring /ae /ccedilla
338
+ /egrave /eacute /ecircumflex /edieresis
339
+ /igrave /iacute /icircumflex /idieresis
340
+ /eth /ntilde /ograve /oacute
341
+ /ocircumflex /otilde /odieresis /divide
342
+ /oslash /ugrave /uacute /ucircumflex
343
+ /udieresis /yacute /thorn /ydieresis
344
+ ] def
345
+ %%EndResource
346
+ %%EndProlog
347
+ %%BeginSetup
348
+ %%IncludeResource: font Times-Roman
349
+ %%IncludeResource: font Courier-Bold
350
+ /HFpt_w 10 def
351
+ /HFpt_h 10 def
352
+ /Courier-Bold /HF-gs-font MF
353
+ /HF /HF-gs-font findfont [HFpt_w 0 0 HFpt_h 0 0] makefont def
354
+ /Times-Roman /F-gs-font MF
355
+ /F-gs-font 14 14 SF
356
+ /#copies 1 def
357
+ % Pagedevice definitions:
358
+ gs_languagelevel 1 gt {
359
+ <<
360
+ /PageSize [612 792]
361
+ >> setpagedevice
362
+ } if
363
+ %%BeginResource: procset Enscript-Header-enscript 1.6 1
364
+ %%IncludeResource: font Times-Bold
365
+
366
+ % Fonts.
367
+ /Times-Bold /HeaderFont-Bold MF
368
+ /HeaderDateF /HeaderFont-Bold findfont 12 scalefont def
369
+
370
+ /Times-Roman /HeaderFont-Times MF
371
+ /HeaderHDRF /HeaderFont-Times findfont 14 scalefont def
372
+
373
+ /HeaderPageNumF /Helvetica-Bold findfont 28.8 scalefont def
374
+
375
+ /do_header { % print enscript header
376
+ gsave
377
+ d_header_x d_header_y translate
378
+
379
+ % light bar
380
+ 0 0 d_header_w d_header_h 2 div Box
381
+ .95 setgray fill
382
+
383
+ % dark gray boxes
384
+ /dbw d_header_h 2 mul def % dark box width
385
+ /dbc .7 def % dark box color
386
+
387
+ % left dark box.
388
+ 0 0 dbw d_header_h Box
389
+ dbc setgray fill
390
+
391
+ 0 setgray
392
+ HeaderDateF setfont
393
+ moddatestr dup stringwidth pop dbw exch sub 2 div
394
+ d_header_h 2 div 2 add moveto show
395
+ modtimestr dup stringwidth pop dbw exch sub 2 div
396
+ d_header_h 5 div moveto show
397
+
398
+ % right dark box
399
+ d_header_w dbw sub 0 dbw d_header_h Box
400
+ dbc setgray fill
401
+
402
+ HeaderPageNumF setfont
403
+ 1 setgray
404
+ pagenumstr dup
405
+ stringwidth pop dbw exch sub 2 div d_header_w dbw sub add
406
+ d_header_h .2 mul moveto show
407
+
408
+ % filename
409
+ 0 setgray
410
+ HeaderHDRF setfont
411
+ d_header_w fname stringwidth pop sub 2 div d_header_h 8 div moveto
412
+ fname show
413
+
414
+ % user supplied header string.
415
+ user_header_p {
416
+ /h d_header_h 8 div 5 mul def
417
+
418
+ % Implement strict enscript compatibility.
419
+ user_header_center_str () eq user_header_right_str () eq and {
420
+ d_header_w user_header_left_str stringwidth pop sub 2 div
421
+ h moveto user_header_left_str show
422
+ } {
423
+ dbw 5 add h moveto user_header_left_str show
424
+
425
+ d_header_w user_header_center_str stringwidth pop sub 2 div
426
+ h moveto user_header_center_str show
427
+
428
+ d_header_w dbw sub 5 sub user_header_right_str stringwidth pop
429
+ sub h moveto user_header_right_str show
430
+ } ifelse
431
+ } if
432
+
433
+ grestore
434
+ } def
435
+ %%EndResource
436
+ /d_page_w 744 def
437
+ /d_page_h 564 def
438
+ /d_header_x 0 def
439
+ /d_header_y 528 def
440
+ /d_header_w 744 def
441
+ /d_header_h 36 def
442
+ /d_footer_x 0 def
443
+ /d_footer_y 0 def
444
+ /d_footer_w 744 def
445
+ /d_footer_h 0 def
446
+ /d_output_w 744 def
447
+ /d_output_h 528 def
448
+ /cols 1 def
449
+ %%EndSetup
450
+ %%Page: (1) 1
451
+ %%BeginPageSetup
452
+ _S
453
+ 90 rotate
454
+ 24 -588 translate
455
+ /pagenum 1 def
456
+ /fname (TestRunner.f90) def
457
+ /fdir () def
458
+ /ftail (TestRunner.f90) def
459
+ % User defined strings:
460
+ /pagenumstr (1) def
461
+ /moddatestr (11/07/01) def
462
+ /modtimestr (08:09:52) def
463
+ /user_header_p false def
464
+ %%EndPageSetup
465
+ do_header
466
+ 5 511 M
467
+ (! TestRunner.f90 - runs Fortran mobility test suites) s
468
+ 5 496 M
469
+ (!) s
470
+ 5 481 M
471
+ (! [Dynamically generated by FTKtest Ruby script Wed Nov 07 07:53:00 EST 2001.]) s
472
+ 5 451 M
473
+ (program TestRunner) s
474
+ 5 421 M
475
+ ( use GasModelTS) s
476
+ 5 406 M
477
+ ( use FluxFunctionsTS) s
478
+ 5 376 M
479
+ ( implicit none) s
480
+ 5 346 M
481
+ ( integer :: numTests, numAsserts, numAssertsTested, numFailures) s
482
+ 5 316 M
483
+ ( print *, "") s
484
+ 5 301 M
485
+ ( print *, "GasModel test suite:") s
486
+ 5 286 M
487
+ ( call TSGasModel\( numTests, numAsserts, numAssertsTested, numFailures \)) s
488
+ 5 271 M
489
+ ( print *, "Completed", numTests-numFailures, "of", numTests, &) s
490
+ 5 256 M
491
+ ( "tests comprising", numAssertsTested, "of", numAsserts, "possible asserts.") s
492
+ 5 226 M
493
+ ( print *, "") s
494
+ 5 211 M
495
+ ( print *, "FluxFunctions test suite:") s
496
+ 5 196 M
497
+ ( call TSFluxFunctions\( numTests, numAsserts, numAssertsTested, numFailures \)) s
498
+ 5 181 M
499
+ ( print *, "Completed", numTests-numFailures, "of", numTests, &) s
500
+ 5 166 M
501
+ ( "tests comprising", numAssertsTested, "of", numAsserts, "possible asserts.") s
502
+ 5 136 M
503
+ ( print *, "") s
504
+ 5 106 M
505
+ (end program TestRunner) s
506
+ _R
507
+ S
508
+ %%Trailer
509
+ %%Pages: 1
510
+ %%DocumentNeededResources: font Times-Roman Courier-Bold Times-Bold
511
+ %%EOF
data/docs/why/land2 ADDED
@@ -0,0 +1,2 @@
1
+ #!/bin/csh
2
+ enscript -r2cGfTimes-Roman14 --color -o $1.ps $1
@@ -0,0 +1,2 @@
1
+ #!/bin/csh
2
+ enscript -rGfTimes-Roman14 --color -o $1.ps $1
data/docs/why/portrait ADDED
@@ -0,0 +1,2 @@
1
+ #!/bin/csh
2
+ enscript -GfTimes-Roman14 --color -o $1.ps $1
data/lib/clean ADDED
@@ -0,0 +1 @@
1
+ rm -rf *TS.f90 *.o *.mod TestRunner*
@@ -0,0 +1,109 @@
1
+ # This scripts finds dependencies for f90 code
2
+
3
+ raise "Need Ruby version >= 1.8, current using #{VERSION}" unless String.instance_methods.include? "match"
4
+
5
+ class Depend
6
+
7
+ attr_reader :file_dependencies, :source_files
8
+
9
+ def initialize( searchPath = %w[ ../lib . ] )
10
+ @parsed = Array.new
11
+ @hash = build_hash_of_modules_in_files_within searchPath
12
+ @file_dependencies = Hash.new
13
+ @source_files = Array.new
14
+ end
15
+
16
+ def modules_used_in( file )
17
+ modules = IO.readlines( file ).map do |line|
18
+ $1.downcase if line.match( /^\s*use\s+(\w+)/i )
19
+ end.uniq.compact
20
+ end
21
+
22
+ def modules_defined_in( file )
23
+ modules = IO.readlines( file ).map do |line|
24
+ $1.downcase if line.match( /^\s*module\s+(\w+)/i )
25
+ end.uniq.compact
26
+ end
27
+
28
+ def build_dictionary_of_modules_in( files )
29
+ file_containing_module = Hash.new
30
+ files.each do |file|
31
+ modules_defined_in( file ).each{ |mod| file_containing_module[mod]=file }
32
+ end
33
+ file_containing_module
34
+ end
35
+
36
+ def fortran_files_within( search_path = %w[ ../lib . ] )
37
+ source = search_path.map{ |path| Dir[path+"/*.[fF]90"] }
38
+ source.flatten!.uniq!
39
+ source.delete_if{ |file| File.lstat(file).symlink? }
40
+ source.delete_if{ |file| file.match(/lmpi_module_template.F90/) }
41
+ end
42
+
43
+ def build_hash_of_modules_in_files_within( searchPath = %w[../lib .] )
44
+ build_dictionary_of_modules_in( fortran_files_within( searchPath ) )
45
+ end
46
+
47
+ def makefile_dependency_line( source )
48
+ realSource = source.sub(/PHYSICS_DUMMY/,'PHYSICS_MODULES')# What's this?
49
+ sourceNoPath = File.basename source
50
+ @source_files.push sourceNoPath.gsub(%r|^.*/|,'')
51
+ output = ''
52
+ if (File.expand_path(source) != File.expand_path(sourceNoPath))
53
+ output += sourceNoPath+ ": " + realSource + "\n"
54
+ output += "\tln -sf "+realSource+" .\n"
55
+ end
56
+ output += source.gsub(/\.(f|F)90$/, ".o").gsub(%r|^.*/|,"" ) +
57
+ ": " + source.gsub(%r|^.*/|,"" )
58
+ modules_used_in( source ).each do |use|
59
+ unless @hash[use]
60
+ unless ( use=~/f90_unix/ || use=~/nas_system/ )
61
+ $stderr.puts "Warning: unable to locate module #{use} used in #{source}." \
62
+ if $DEBUG
63
+ end
64
+ next
65
+ end
66
+ output = output + " \\\n " +
67
+ @hash[use].gsub(/\.(f|F)90$/, ".o").gsub(%r|^.*/|,"" )
68
+ end
69
+ output+"\n"
70
+ end
71
+
72
+ def dependencies( start )
73
+ modules = modules_used_in( start )
74
+ @parsed = @parsed || [start]
75
+ newSourceFiles = modules.collect{ |mod| @hash[mod] }.compact
76
+ makefile_dependency_line(start) +
77
+ newSourceFiles.collect do |file|
78
+ next if @parsed.include?(file)
79
+ @parsed.push file
80
+ dependencies file
81
+ end.to_s
82
+ end
83
+
84
+ def source_file_dependencies( head_f90 )
85
+ modules_head_uses = modules_used_in( head_f90 )
86
+ required_f90s = modules_head_uses.map{ |mod| @hash[mod] }.compact
87
+ @file_dependencies[head_f90] = required_f90s
88
+ required_f90s.each do |required_f90|
89
+ next if @parsed.include?(required_f90)
90
+ source_file_dependencies( required_f90 )
91
+ end
92
+ @parsed.push head_f90
93
+ end
94
+
95
+ def required_source_files( head_f90 )
96
+ @parsed.clear
97
+ source_file_dependencies( head_f90 )
98
+ sources = Array.new
99
+ while !@file_dependencies.empty? do
100
+ no_dependents_pair = @file_dependencies.detect{ |h,d| d == [] }
101
+ no_dependents = no_dependents_pair.first
102
+ sources.push no_dependents
103
+ @file_dependencies.delete(no_dependents){ |el| "#{el} not found" }
104
+ @file_dependencies.each_value{ |deps| deps.delete(no_dependents) }
105
+ end
106
+ sources
107
+ end
108
+
109
+ end
@@ -0,0 +1,72 @@
1
+ module Funit
2
+ module Assertions
3
+
4
+ $assertRegEx = /Is(RealEqual|False|True|EqualWithin|Equal)\(.*\)/i
5
+
6
+ def istrue(line)
7
+ line=~/\((.+)\)/
8
+ @type = 'IsTrue'
9
+ @condition = ".not.(#$1)"
10
+ @message = "\"#$1 is not true\""
11
+ syntaxError("invalid body for #@type",@suiteName) unless $1=~/\S+/
12
+ writeAssert
13
+ end
14
+
15
+ def isfalse(line)
16
+ line=~/\((.+)\)/
17
+ @type = 'IsFalse'
18
+ @condition = "#$1"
19
+ @message = "\"#$1 is not false\""
20
+ syntaxError("invalid body for #@type",@suiteName) unless $1=~/\S+/
21
+ writeAssert
22
+ end
23
+
24
+ def isrealequal(line)
25
+ line=~/\(([^,]+),(.+)\)/
26
+ @type = 'IsRealEqual'
27
+ @condition = ".not.(#$1+2*spacing(real(#$1)).ge.#$2 &\n .and.#$1-2*spacing(real(#$1)).le.#$2)"
28
+ @message = "\"#$2 (\",#$2,\") is not\",#$1,\"within\",2*spacing(real(#$1))"
29
+ syntaxError("invalid body for #@type",@suiteName) unless $&
30
+ writeAssert
31
+ end
32
+
33
+ def isequalwithin(line)
34
+ line=~/\(([^,]+),(.+),(.+)\)/
35
+ @type = 'IsEqualWithin'
36
+ @condition = ".not.(#$2+#$3.ge.#$1 &\n .and.#$2-#$3.le.#$1)"
37
+ @message = "\"#$1 (\",#$1,\") is not\",#$2,\"within\",#$3"
38
+ syntaxError("invalid body for #@type",@suiteName) unless $&
39
+ writeAssert
40
+ end
41
+
42
+ def isequal(line)
43
+ line=~/\((\w+\(.*\)|[^,]+),(.+)\)/
44
+ @type = 'IsEqual'
45
+ @condition = ".not.(#$1==#$2)"
46
+ @message = "\"#$1 (\",#$1,\") is not\", #$2"
47
+ syntaxError("invalid body for #@type",@suiteName) unless $&
48
+ writeAssert
49
+ end
50
+
51
+ def writeAssert
52
+ <<-OUTPUT
53
+
54
+ ! #@type assertion
55
+ numAsserts = numAsserts + 1
56
+ if (noAssertFailed) then
57
+ if (#@condition) then
58
+ print *, " *#@type failed* in test #@testName &
59
+ &[#{@suiteName}MT.ftk:#{@lineNumber.to_s}]"
60
+ print *, " ", #@message
61
+ print *, ""
62
+ noAssertFailed = .false.
63
+ numFailures = numFailures + 1
64
+ else
65
+ numAssertsTested = numAssertsTested + 1
66
+ endif
67
+ endif
68
+ OUTPUT
69
+ end
70
+
71
+ end # module Assertions
72
+ end # module Funit