fUnit 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -4
- data/Rakefile +7 -2
- data/bin/funit +3 -0
- data/docs/html/classes/Funit.html +48 -48
- data/docs/html/classes/Funit/Assertions.html +56 -54
- data/docs/html/classes/Funit/Compiler.html +6 -6
- data/docs/html/classes/Funit/Depend.html +60 -60
- data/docs/html/classes/Funit/TestSuite.html +48 -48
- data/docs/html/classes/String.html +170 -0
- data/docs/html/created.rid +1 -1
- data/docs/html/files/README.html +2 -11
- data/docs/html/files/lib/funit/assertions_rb.html +8 -1
- data/docs/html/fr_class_index.html +1 -0
- data/docs/html/fr_method_index.html +34 -33
- data/lib/funit/assertions.rb +42 -13
- data/tests/tc_compile.rb +22 -22
- data/tests/tc_fortran_deps.rb +139 -132
- data/tests/tc_funit.rb +91 -92
- data/tests/tc_test_suite.rb +83 -83
- data/utils/funit-mode.el +115 -0
- metadata +4 -2
data/README
CHANGED
@@ -92,7 +92,7 @@ or submit a request through
|
|
92
92
|
FUnit is released under the NASA Open Source Agreement, which
|
93
93
|
requests registration. If you would like to register, send
|
94
94
|
an email to
|
95
|
-
{funit-registration@rubyforge.org}[mailto:funit-registration@rubyforge.org?subject=fUnit%20Registration]
|
95
|
+
{funit-registration@rubyforge.org}[mailto:funit-registration@rubyforge.org?subject=fUnit%20Registration&body=%20%20%20%20%20%20%20Name:%20%0AInstitution:%20%0A%20%20%20%20%20%20%20City:%20%0APostal%20Code:%20%0A%20%20%20%20Country:%20]
|
96
96
|
with your name, institution (if applicable), city, postal code, and country.
|
97
97
|
See COPYING[http://funit.rubyforge.org/files/COPYING.html] for details.
|
98
98
|
|
@@ -120,14 +120,11 @@ rewrote the framework in Ruby[http:www.ruby-lang.org].
|
|
120
120
|
|
121
121
|
* Make tests fail gracefully if Fortran compiler is not found.
|
122
122
|
* Complete migration from CamelCase to snake_case for methods and variables.
|
123
|
-
* Use 2-space indentation everywhere.
|
124
123
|
* Use 'test' keyword instead of 'beginTest' business.
|
125
124
|
* Don't add to test name during translation to avoid
|
126
125
|
Fortran's 32-character limit on names.
|
127
126
|
* Rename assertions to more consistent with other xUnits.
|
128
127
|
* Add assertions to capture stops and warning messages.
|
129
|
-
* Clean up documentation.
|
130
128
|
* To increase portability, create a single, stand-alone executable with
|
131
129
|
Erik Veenstra's RubyScript2Exe[http://www.erikveen.dds.nl/rubyscript2exe/].
|
132
130
|
* Use a makefile instead of a single, ordered command line for compilation.
|
133
|
-
* Add a clean option to remove all generated artifacts.
|
data/Rakefile
CHANGED
@@ -18,8 +18,9 @@ end
|
|
18
18
|
|
19
19
|
require 'rake/testtask'
|
20
20
|
require 'rake/rdoctask'
|
21
|
+
require 'rake/clean'
|
21
22
|
|
22
|
-
PKG_VERSION = '0.1.
|
23
|
+
PKG_VERSION = '0.1.1'
|
23
24
|
|
24
25
|
PKG_FILES = FileList[
|
25
26
|
'[A-Z]*',
|
@@ -27,9 +28,13 @@ PKG_FILES = FileList[
|
|
27
28
|
'docs/**/*',
|
28
29
|
'examples/**/*',
|
29
30
|
'lib/**/*',
|
30
|
-
'tests/**/*.rb'
|
31
|
+
'tests/**/*.rb',
|
32
|
+
'utils/**/*'
|
31
33
|
]
|
32
34
|
|
35
|
+
CLEAN.include( "**/*_fun.f90", "examples/**/TestRunner*",
|
36
|
+
"**/*.o", "**/*.mod", "**/*.MOD")
|
37
|
+
|
33
38
|
desc 'Default task'
|
34
39
|
task :default => [:test]
|
35
40
|
|
data/bin/funit
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# Main fUnit routine -*- ruby -*-
|
2
|
+
#--
|
1
3
|
# Copyright 2006 United States Government as represented by
|
2
4
|
# NASA Langley Research Center. No copyright is claimed in
|
3
5
|
# the United States under Title 17, U.S. Code. All Other Rights
|
@@ -5,6 +7,7 @@
|
|
5
7
|
#
|
6
8
|
# This file is governed by the NASA Open Source Agreement.
|
7
9
|
# See COPYING for details.
|
10
|
+
#++
|
8
11
|
|
9
12
|
begin
|
10
13
|
require 'funit'
|
@@ -102,14 +102,14 @@ Compile and run the requested tests
|
|
102
102
|
<h3 class="section-bar">Methods</h3>
|
103
103
|
|
104
104
|
<div class="name-list">
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
105
|
+
<a href="#M000009">compileTests</a>
|
106
|
+
<a href="#M000004">funit_exists?</a>
|
107
|
+
<a href="#M000005">parseCommandLine</a>
|
108
|
+
<a href="#M000003">requestedModules</a>
|
109
|
+
<a href="#M000002">run_tests</a>
|
110
|
+
<a href="#M000007">syntaxError</a>
|
111
|
+
<a href="#M000008">warning</a>
|
112
|
+
<a href="#M000006">writeTestRunner</a>
|
113
113
|
</div>
|
114
114
|
</div>
|
115
115
|
|
@@ -147,19 +147,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
147
147
|
<div id="methods">
|
148
148
|
<h3 class="section-bar">Public Instance methods</h3>
|
149
149
|
|
150
|
-
<div id="method-
|
151
|
-
<a name="
|
150
|
+
<div id="method-M000009" class="method-detail">
|
151
|
+
<a name="M000009"></a>
|
152
152
|
|
153
153
|
<div class="method-heading">
|
154
|
-
<a href="#
|
154
|
+
<a href="#M000009" class="method-signature">
|
155
155
|
<span class="method-name">compileTests</span><span class="method-args">(testSuites)</span>
|
156
156
|
</a>
|
157
157
|
</div>
|
158
158
|
|
159
159
|
<div class="method-description">
|
160
160
|
<p><a class="source-toggle" href="#"
|
161
|
-
onclick="toggleCode('
|
162
|
-
<div class="method-source-code" id="
|
161
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
162
|
+
<div class="method-source-code" id="M000009-source">
|
163
163
|
<pre>
|
164
164
|
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 121</span>
|
165
165
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compileTests</span> <span class="ruby-identifier">testSuites</span>
|
@@ -177,19 +177,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
177
177
|
</div>
|
178
178
|
</div>
|
179
179
|
|
180
|
-
<div id="method-
|
181
|
-
<a name="
|
180
|
+
<div id="method-M000004" class="method-detail">
|
181
|
+
<a name="M000004"></a>
|
182
182
|
|
183
183
|
<div class="method-heading">
|
184
|
-
<a href="#
|
184
|
+
<a href="#M000004" class="method-signature">
|
185
185
|
<span class="method-name">funit_exists?</span><span class="method-args">(moduleName)</span>
|
186
186
|
</a>
|
187
187
|
</div>
|
188
188
|
|
189
189
|
<div class="method-description">
|
190
190
|
<p><a class="source-toggle" href="#"
|
191
|
-
onclick="toggleCode('
|
192
|
-
<div class="method-source-code" id="
|
191
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
192
|
+
<div class="method-source-code" id="M000004-source">
|
193
193
|
<pre>
|
194
194
|
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 40</span>
|
195
195
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">funit_exists?</span>(<span class="ruby-identifier">moduleName</span>)
|
@@ -200,19 +200,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
200
200
|
</div>
|
201
201
|
</div>
|
202
202
|
|
203
|
-
<div id="method-
|
204
|
-
<a name="
|
203
|
+
<div id="method-M000005" class="method-detail">
|
204
|
+
<a name="M000005"></a>
|
205
205
|
|
206
206
|
<div class="method-heading">
|
207
|
-
<a href="#
|
207
|
+
<a href="#M000005" class="method-signature">
|
208
208
|
<span class="method-name">parseCommandLine</span><span class="method-args">()</span>
|
209
209
|
</a>
|
210
210
|
</div>
|
211
211
|
|
212
212
|
<div class="method-description">
|
213
213
|
<p><a class="source-toggle" href="#"
|
214
|
-
onclick="toggleCode('
|
215
|
-
<div class="method-source-code" id="
|
214
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
215
|
+
<div class="method-source-code" id="M000005-source">
|
216
216
|
<pre>
|
217
217
|
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 44</span>
|
218
218
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parseCommandLine</span>
|
@@ -236,19 +236,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
236
236
|
</div>
|
237
237
|
</div>
|
238
238
|
|
239
|
-
<div id="method-
|
240
|
-
<a name="
|
239
|
+
<div id="method-M000003" class="method-detail">
|
240
|
+
<a name="M000003"></a>
|
241
241
|
|
242
242
|
<div class="method-heading">
|
243
|
-
<a href="#
|
243
|
+
<a href="#M000003" class="method-signature">
|
244
244
|
<span class="method-name">requestedModules</span><span class="method-args">(moduleNames)</span>
|
245
245
|
</a>
|
246
246
|
</div>
|
247
247
|
|
248
248
|
<div class="method-description">
|
249
249
|
<p><a class="source-toggle" href="#"
|
250
|
-
onclick="toggleCode('
|
251
|
-
<div class="method-source-code" id="
|
250
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
251
|
+
<div class="method-source-code" id="M000003-source">
|
252
252
|
<pre>
|
253
253
|
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 33</span>
|
254
254
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requestedModules</span>(<span class="ruby-identifier">moduleNames</span>)
|
@@ -262,19 +262,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
262
262
|
</div>
|
263
263
|
</div>
|
264
264
|
|
265
|
-
<div id="method-
|
266
|
-
<a name="
|
265
|
+
<div id="method-M000002" class="method-detail">
|
266
|
+
<a name="M000002"></a>
|
267
267
|
|
268
268
|
<div class="method-heading">
|
269
|
-
<a href="#
|
269
|
+
<a href="#M000002" class="method-signature">
|
270
270
|
<span class="method-name">run_tests</span><span class="method-args">()</span>
|
271
271
|
</a>
|
272
272
|
</div>
|
273
273
|
|
274
274
|
<div class="method-description">
|
275
275
|
<p><a class="source-toggle" href="#"
|
276
|
-
onclick="toggleCode('
|
277
|
-
<div class="method-source-code" id="
|
276
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
277
|
+
<div class="method-source-code" id="M000002-source">
|
278
278
|
<pre>
|
279
279
|
<span class="ruby-comment cmt"># File lib/funit.rb, line 18</span>
|
280
280
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_tests</span>
|
@@ -293,19 +293,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
293
293
|
</div>
|
294
294
|
</div>
|
295
295
|
|
296
|
-
<div id="method-
|
297
|
-
<a name="
|
296
|
+
<div id="method-M000007" class="method-detail">
|
297
|
+
<a name="M000007"></a>
|
298
298
|
|
299
299
|
<div class="method-heading">
|
300
|
-
<a href="#
|
300
|
+
<a href="#M000007" class="method-signature">
|
301
301
|
<span class="method-name">syntaxError</span><span class="method-args">( message, testSuite )</span>
|
302
302
|
</a>
|
303
303
|
</div>
|
304
304
|
|
305
305
|
<div class="method-description">
|
306
306
|
<p><a class="source-toggle" href="#"
|
307
|
-
onclick="toggleCode('
|
308
|
-
<div class="method-source-code" id="
|
307
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
308
|
+
<div class="method-source-code" id="M000007-source">
|
309
309
|
<pre>
|
310
310
|
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 113</span>
|
311
311
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">syntaxError</span>( <span class="ruby-identifier">message</span>, <span class="ruby-identifier">testSuite</span> )
|
@@ -316,19 +316,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
316
316
|
</div>
|
317
317
|
</div>
|
318
318
|
|
319
|
-
<div id="method-
|
320
|
-
<a name="
|
319
|
+
<div id="method-M000008" class="method-detail">
|
320
|
+
<a name="M000008"></a>
|
321
321
|
|
322
322
|
<div class="method-heading">
|
323
|
-
<a href="#
|
323
|
+
<a href="#M000008" class="method-signature">
|
324
324
|
<span class="method-name">warning</span><span class="method-args">( message, testSuite )</span>
|
325
325
|
</a>
|
326
326
|
</div>
|
327
327
|
|
328
328
|
<div class="method-description">
|
329
329
|
<p><a class="source-toggle" href="#"
|
330
|
-
onclick="toggleCode('
|
331
|
-
<div class="method-source-code" id="
|
330
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
331
|
+
<div class="method-source-code" id="M000008-source">
|
332
332
|
<pre>
|
333
333
|
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 117</span>
|
334
334
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">warning</span>( <span class="ruby-identifier">message</span>, <span class="ruby-identifier">testSuite</span> )
|
@@ -339,19 +339,19 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
339
339
|
</div>
|
340
340
|
</div>
|
341
341
|
|
342
|
-
<div id="method-
|
343
|
-
<a name="
|
342
|
+
<div id="method-M000006" class="method-detail">
|
343
|
+
<a name="M000006"></a>
|
344
344
|
|
345
345
|
<div class="method-heading">
|
346
|
-
<a href="#
|
346
|
+
<a href="#M000006" class="method-signature">
|
347
347
|
<span class="method-name">writeTestRunner</span><span class="method-args">(testSuites)</span>
|
348
348
|
</a>
|
349
349
|
</div>
|
350
350
|
|
351
351
|
<div class="method-description">
|
352
352
|
<p><a class="source-toggle" href="#"
|
353
|
-
onclick="toggleCode('
|
354
|
-
<div class="method-source-code" id="
|
353
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
354
|
+
<div class="method-source-code" id="M000006-source">
|
355
355
|
<pre>
|
356
356
|
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 68</span>
|
357
357
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">writeTestRunner</span> <span class="ruby-identifier">testSuites</span>
|
@@ -80,12 +80,12 @@
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
81
81
|
|
82
82
|
<div class="name-list">
|
83
|
-
<a href="#
|
84
|
-
<a href="#
|
85
|
-
<a href="#
|
86
|
-
<a href="#
|
87
|
-
<a href="#
|
88
|
-
<a href="#
|
83
|
+
<a href="#M000014">isequal</a>
|
84
|
+
<a href="#M000013">isequalwithin</a>
|
85
|
+
<a href="#M000011">isfalse</a>
|
86
|
+
<a href="#M000012">isrealequal</a>
|
87
|
+
<a href="#M000010">istrue</a>
|
88
|
+
<a href="#M000015">writeAssert</a>
|
89
89
|
</div>
|
90
90
|
</div>
|
91
91
|
|
@@ -107,23 +107,23 @@
|
|
107
107
|
<div id="methods">
|
108
108
|
<h3 class="section-bar">Public Instance methods</h3>
|
109
109
|
|
110
|
-
<div id="method-
|
111
|
-
<a name="
|
110
|
+
<div id="method-M000014" class="method-detail">
|
111
|
+
<a name="M000014"></a>
|
112
112
|
|
113
113
|
<div class="method-heading">
|
114
|
-
<a href="#
|
114
|
+
<a href="#M000014" class="method-signature">
|
115
115
|
<span class="method-name">isequal</span><span class="method-args">(line)</span>
|
116
116
|
</a>
|
117
117
|
</div>
|
118
118
|
|
119
119
|
<div class="method-description">
|
120
120
|
<p><a class="source-toggle" href="#"
|
121
|
-
onclick="toggleCode('
|
122
|
-
<div class="method-source-code" id="
|
121
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
122
|
+
<div class="method-source-code" id="M000014-source">
|
123
123
|
<pre>
|
124
|
-
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line
|
124
|
+
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line 82</span>
|
125
125
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">isequal</span>(<span class="ruby-identifier">line</span>)
|
126
|
-
<span class="ruby-identifier">line</span
|
126
|
+
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/\((\w+\(.*\)|[^,]+),(.+)\)/</span>)
|
127
127
|
<span class="ruby-ivar">@type</span> = <span class="ruby-value str">'IsEqual'</span>
|
128
128
|
<span class="ruby-ivar">@condition</span> = <span class="ruby-value str">".not.(#$1==#$2)"</span>
|
129
129
|
<span class="ruby-ivar">@message</span> = <span class="ruby-value str">"\"#$1 (\",#$1,\") is not\", #$2"</span>
|
@@ -135,26 +135,27 @@
|
|
135
135
|
</div>
|
136
136
|
</div>
|
137
137
|
|
138
|
-
<div id="method-
|
139
|
-
<a name="
|
138
|
+
<div id="method-M000013" class="method-detail">
|
139
|
+
<a name="M000013"></a>
|
140
140
|
|
141
141
|
<div class="method-heading">
|
142
|
-
<a href="#
|
142
|
+
<a href="#M000013" class="method-signature">
|
143
143
|
<span class="method-name">isequalwithin</span><span class="method-args">(line)</span>
|
144
144
|
</a>
|
145
145
|
</div>
|
146
146
|
|
147
147
|
<div class="method-description">
|
148
148
|
<p><a class="source-toggle" href="#"
|
149
|
-
onclick="toggleCode('
|
150
|
-
<div class="method-source-code" id="
|
149
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
150
|
+
<div class="method-source-code" id="M000013-source">
|
151
151
|
<pre>
|
152
|
-
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line
|
152
|
+
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line 72</span>
|
153
153
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">isequalwithin</span>(<span class="ruby-identifier">line</span>)
|
154
|
-
<span class="ruby-identifier">line</span
|
154
|
+
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/\((.*)\)/</span>)
|
155
|
+
<span class="ruby-identifier">expected</span>, <span class="ruby-identifier">actual</span>, <span class="ruby-identifier">tolerance</span> = <span class="ruby-operator">*</span>(<span class="ruby-identifier">$1</span>.<span class="ruby-identifier">get_args</span>)
|
155
156
|
<span class="ruby-ivar">@type</span> = <span class="ruby-value str">'IsEqualWithin'</span>
|
156
|
-
<span class="ruby-ivar">@condition</span> = <span class="ruby-
|
157
|
-
<span class="ruby-ivar">@message</span> = <span class="ruby-
|
157
|
+
<span class="ruby-ivar">@condition</span> = <span class="ruby-node">".not.(#{actual}+#{tolerance}.ge.#{expected} &\n .and.#{actual}-#{tolerance}.le.#{expected})"</span>
|
158
|
+
<span class="ruby-ivar">@message</span> = <span class="ruby-node">"\"#{expected} (\",#{expected},\") is not\",#{actual},\"within\",#{tolerance}"</span>
|
158
159
|
<span class="ruby-identifier">syntaxError</span>(<span class="ruby-value str">"invalid body for #@type"</span>,<span class="ruby-ivar">@suiteName</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$&</span>
|
159
160
|
<span class="ruby-identifier">writeAssert</span>
|
160
161
|
<span class="ruby-keyword kw">end</span>
|
@@ -163,54 +164,55 @@
|
|
163
164
|
</div>
|
164
165
|
</div>
|
165
166
|
|
166
|
-
<div id="method-
|
167
|
-
<a name="
|
167
|
+
<div id="method-M000011" class="method-detail">
|
168
|
+
<a name="M000011"></a>
|
168
169
|
|
169
170
|
<div class="method-heading">
|
170
|
-
<a href="#
|
171
|
+
<a href="#M000011" class="method-signature">
|
171
172
|
<span class="method-name">isfalse</span><span class="method-args">(line)</span>
|
172
173
|
</a>
|
173
174
|
</div>
|
174
175
|
|
175
176
|
<div class="method-description">
|
176
177
|
<p><a class="source-toggle" href="#"
|
177
|
-
onclick="toggleCode('
|
178
|
-
<div class="method-source-code" id="
|
178
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
179
|
+
<div class="method-source-code" id="M000011-source">
|
179
180
|
<pre>
|
180
|
-
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line
|
181
|
+
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line 53</span>
|
181
182
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">isfalse</span>(<span class="ruby-identifier">line</span>)
|
182
|
-
<span class="ruby-identifier">line</span
|
183
|
+
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/\((.+)\)/</span>)
|
183
184
|
<span class="ruby-ivar">@type</span> = <span class="ruby-value str">'IsFalse'</span>
|
184
185
|
<span class="ruby-ivar">@condition</span> = <span class="ruby-value str">"#$1"</span>
|
185
186
|
<span class="ruby-ivar">@message</span> = <span class="ruby-value str">"\"#$1 is not false\""</span>
|
186
187
|
<span class="ruby-identifier">syntaxError</span>(<span class="ruby-value str">"invalid body for #@type"</span>,<span class="ruby-ivar">@suiteName</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$1</span><span class="ruby-operator">=~</span><span class="ruby-regexp re">/\S+/</span>
|
187
|
-
|
188
|
+
<span class="ruby-identifier">writeAssert</span>
|
188
189
|
<span class="ruby-keyword kw">end</span>
|
189
190
|
</pre>
|
190
191
|
</div>
|
191
192
|
</div>
|
192
193
|
</div>
|
193
194
|
|
194
|
-
<div id="method-
|
195
|
-
<a name="
|
195
|
+
<div id="method-M000012" class="method-detail">
|
196
|
+
<a name="M000012"></a>
|
196
197
|
|
197
198
|
<div class="method-heading">
|
198
|
-
<a href="#
|
199
|
+
<a href="#M000012" class="method-signature">
|
199
200
|
<span class="method-name">isrealequal</span><span class="method-args">(line)</span>
|
200
201
|
</a>
|
201
202
|
</div>
|
202
203
|
|
203
204
|
<div class="method-description">
|
204
205
|
<p><a class="source-toggle" href="#"
|
205
|
-
onclick="toggleCode('
|
206
|
-
<div class="method-source-code" id="
|
206
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
207
|
+
<div class="method-source-code" id="M000012-source">
|
207
208
|
<pre>
|
208
|
-
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line
|
209
|
+
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line 62</span>
|
209
210
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">isrealequal</span>(<span class="ruby-identifier">line</span>)
|
210
|
-
<span class="ruby-identifier">line</span
|
211
|
+
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/\((.*)\)/</span>)
|
212
|
+
<span class="ruby-identifier">expected</span>, <span class="ruby-identifier">actual</span> = <span class="ruby-operator">*</span>(<span class="ruby-identifier">$1</span>.<span class="ruby-identifier">get_args</span>)
|
211
213
|
<span class="ruby-ivar">@type</span> = <span class="ruby-value str">'IsRealEqual'</span>
|
212
|
-
<span class="ruby-ivar">@condition</span> = <span class="ruby-
|
213
|
-
<span class="ruby-ivar">@message</span> = <span class="ruby-
|
214
|
+
<span class="ruby-ivar">@condition</span> = <span class="ruby-node">".not.(#{expected}+2*spacing(real(#{expected})).ge.#{actual} &\n .and.#{expected}-2*spacing(real(#{expected})).le.#{actual})"</span>
|
215
|
+
<span class="ruby-ivar">@message</span> = <span class="ruby-node">"\"#{actual} (\",#{actual},\") is not\",#{expected},\"within\",2*spacing(real(#{expected}))"</span>
|
214
216
|
<span class="ruby-identifier">syntaxError</span>(<span class="ruby-value str">"invalid body for #@type"</span>,<span class="ruby-ivar">@suiteName</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$&</span>
|
215
217
|
<span class="ruby-identifier">writeAssert</span>
|
216
218
|
<span class="ruby-keyword kw">end</span>
|
@@ -219,51 +221,51 @@
|
|
219
221
|
</div>
|
220
222
|
</div>
|
221
223
|
|
222
|
-
<div id="method-
|
223
|
-
<a name="
|
224
|
+
<div id="method-M000010" class="method-detail">
|
225
|
+
<a name="M000010"></a>
|
224
226
|
|
225
227
|
<div class="method-heading">
|
226
|
-
<a href="#
|
228
|
+
<a href="#M000010" class="method-signature">
|
227
229
|
<span class="method-name">istrue</span><span class="method-args">(line)</span>
|
228
230
|
</a>
|
229
231
|
</div>
|
230
232
|
|
231
233
|
<div class="method-description">
|
232
234
|
<p><a class="source-toggle" href="#"
|
233
|
-
onclick="toggleCode('
|
234
|
-
<div class="method-source-code" id="
|
235
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
236
|
+
<div class="method-source-code" id="M000010-source">
|
235
237
|
<pre>
|
236
|
-
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line
|
238
|
+
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line 44</span>
|
237
239
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">istrue</span>(<span class="ruby-identifier">line</span>)
|
238
|
-
<span class="ruby-identifier">line</span
|
240
|
+
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/\((.+)\)/</span>)
|
239
241
|
<span class="ruby-ivar">@type</span> = <span class="ruby-value str">'IsTrue'</span>
|
240
242
|
<span class="ruby-ivar">@condition</span> = <span class="ruby-value str">".not.(#$1)"</span>
|
241
243
|
<span class="ruby-ivar">@message</span> = <span class="ruby-value str">"\"#$1 is not true\""</span>
|
242
244
|
<span class="ruby-identifier">syntaxError</span>(<span class="ruby-value str">"invalid body for #@type"</span>,<span class="ruby-ivar">@suiteName</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$1</span><span class="ruby-operator">=~</span><span class="ruby-regexp re">/\S+/</span>
|
243
|
-
|
245
|
+
<span class="ruby-identifier">writeAssert</span>
|
244
246
|
<span class="ruby-keyword kw">end</span>
|
245
247
|
</pre>
|
246
248
|
</div>
|
247
249
|
</div>
|
248
250
|
</div>
|
249
251
|
|
250
|
-
<div id="method-
|
251
|
-
<a name="
|
252
|
+
<div id="method-M000015" class="method-detail">
|
253
|
+
<a name="M000015"></a>
|
252
254
|
|
253
255
|
<div class="method-heading">
|
254
|
-
<a href="#
|
256
|
+
<a href="#M000015" class="method-signature">
|
255
257
|
<span class="method-name">writeAssert</span><span class="method-args">()</span>
|
256
258
|
</a>
|
257
259
|
</div>
|
258
260
|
|
259
261
|
<div class="method-description">
|
260
262
|
<p><a class="source-toggle" href="#"
|
261
|
-
onclick="toggleCode('
|
262
|
-
<div class="method-source-code" id="
|
263
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
264
|
+
<div class="method-source-code" id="M000015-source">
|
263
265
|
<pre>
|
264
|
-
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line
|
266
|
+
<span class="ruby-comment cmt"># File lib/funit/assertions.rb, line 91</span>
|
265
267
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">writeAssert</span>
|
266
|
-
<span class="ruby-value str">"
|
268
|
+
<span class="ruby-value str">"! \#@type assertion\nnumAsserts = numAsserts + 1\nif (noAssertFailed) then\nif (\#@condition) then\nprint *, \" *\#@type failed* in test \#@testName &\n&[\#{@suiteName}.fun:\#{@lineNumber.to_s}]\"\nprint *, \" \", \#@message\nprint *, \"\"\nnoAssertFailed = .false.\nnumFailures = numFailures + 1\nelse\nnumAssertsTested = numAssertsTested + 1\nendif\nendif\n"</span>
|
267
269
|
<span class="ruby-keyword kw">end</span>
|
268
270
|
</pre>
|
269
271
|
</div>
|