fUnit 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -0
- data/Rakefile +1 -1
- data/docs/html/classes/Funit/TestSuite.html +0 -1
- data/docs/html/classes/Funit.html +3 -4
- data/docs/html/created.rid +1 -1
- data/docs/html/files/README.html +4 -1
- data/docs/html/files/lib/funit/functions_rb.html +1 -1
- data/docs/html/files/lib/funit/test_suite_rb.html +1 -1
- data/examples/CFD/FluxFunctions.fun +13 -13
- data/examples/CFD/GasModel.fun +7 -7
- data/examples/StopWatch/StopWatch.fun +4 -4
- data/lib/funit/functions.rb +0 -1
- data/lib/funit/test_suite.rb +0 -1
- data/tests/tc_test_suite.rb +3 -3
- metadata +1 -1
data/README
CHANGED
@@ -128,3 +128,4 @@ rewrote the framework in Ruby[http:www.ruby-lang.org].
|
|
128
128
|
* To increase portability, create a single, stand-alone executable with
|
129
129
|
Erik Veenstra's RubyScript2Exe[http://www.erikveen.dds.nl/rubyscript2exe/].
|
130
130
|
* Use a makefile instead of a single, ordered command line for compilation.
|
131
|
+
* Add some command line options and usage.
|
data/Rakefile
CHANGED
@@ -286,7 +286,6 @@
|
|
286
286
|
|
287
287
|
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nnTests = numTests\nnAsserts = numAsserts\nnAssertsTested = numAssertsTested\nnFailures = numFailures\n\nend subroutine test_\#{@suiteName}\n\nend module \#{@suiteName}_fun\n"</span>
|
288
288
|
<span class="ruby-keyword kw">super</span>
|
289
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">chmod</span>(<span class="ruby-value">0444</span>,<span class="ruby-ivar">@suiteName</span><span class="ruby-operator">+</span><span class="ruby-value str">"_fun.f90"</span>)
|
290
289
|
<span class="ruby-keyword kw">end</span>
|
291
290
|
</pre>
|
292
291
|
</div>
|
@@ -161,7 +161,7 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
161
161
|
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
162
162
|
<div class="method-source-code" id="M000009-source">
|
163
163
|
<pre>
|
164
|
-
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line
|
164
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 120</span>
|
165
165
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compileTests</span> <span class="ruby-identifier">testSuites</span>
|
166
166
|
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"computing dependencies"</span>
|
167
167
|
<span class="ruby-identifier">dependencies</span> = <span class="ruby-constant">Depend</span>.<span class="ruby-identifier">new</span>([<span class="ruby-value str">'.'</span>, <span class="ruby-value str">'../LibF90'</span>, <span class="ruby-value str">'../PHYSICS_DEPS'</span>])
|
@@ -307,7 +307,7 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
307
307
|
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
308
308
|
<div class="method-source-code" id="M000007-source">
|
309
309
|
<pre>
|
310
|
-
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line
|
310
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 112</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> )
|
312
312
|
<span class="ruby-identifier">raise</span> <span class="ruby-node">"\n *Error: #{message} [#{testSuite}.fun:#$.]\n\n"</span>
|
313
313
|
<span class="ruby-keyword kw">end</span>
|
@@ -330,7 +330,7 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
330
330
|
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
331
331
|
<div class="method-source-code" id="M000008-source">
|
332
332
|
<pre>
|
333
|
-
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line
|
333
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 116</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> )
|
335
335
|
<span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"\n *Warning: #{message} [#{testSuite}.fun:#$.]"</span>
|
336
336
|
<span class="ruby-keyword kw">end</span>
|
@@ -372,7 +372,6 @@ Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
|
372
372
|
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\n print *, \"\""</span>
|
373
373
|
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nend program TestRunner"</span>
|
374
374
|
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">close</span>
|
375
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">chmod</span>(<span class="ruby-value">0444</span>,<span class="ruby-value str">"TestRunner.f90"</span>)
|
376
375
|
<span class="ruby-keyword kw">end</span>
|
377
376
|
</pre>
|
378
377
|
</div>
|
data/docs/html/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Tue Apr 18
|
1
|
+
Tue Apr 18 09:40:12 EDT 2006
|
data/docs/html/files/README.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Tue Apr 18 09:40:02 EDT 2006</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -234,6 +234,9 @@ href="http://www.erikveen.dds.nl/rubyscript2exe/">RubyScript2Exe</a>.
|
|
234
234
|
</li>
|
235
235
|
<li>Use a makefile instead of a single, ordered command line for compilation.
|
236
236
|
|
237
|
+
</li>
|
238
|
+
<li>Add some command line options and usage.
|
239
|
+
|
237
240
|
</li>
|
238
241
|
</ul>
|
239
242
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
! $Id: FluxFunctions.fun
|
1
|
+
! $Id: FluxFunctions.fun 166 2006-04-18 13:34:25Z kleb $
|
2
2
|
|
3
3
|
real :: leftState, rightState, interfaceFlux
|
4
4
|
|
@@ -10,40 +10,40 @@ endsetup
|
|
10
10
|
beginTest FluxZero
|
11
11
|
real :: state
|
12
12
|
state = 0
|
13
|
-
IsEqualWithin( Flux(state), 0
|
13
|
+
IsEqualWithin( 0, Flux(state), 0.00001 )
|
14
14
|
endTest
|
15
15
|
|
16
16
|
beginTest FluxOne
|
17
17
|
real :: state = 1
|
18
|
-
IsEqualWithin( Flux(state), 0.
|
18
|
+
IsEqualWithin( 0.5, Flux(state), 0.00001 )
|
19
19
|
endTest
|
20
20
|
|
21
21
|
beginTest RoeAvgZero
|
22
|
-
IsRealEqual( RoeAvg(0.0,0.0)
|
23
|
-
IsFalse( RoeAvg(0.0,0.0)
|
22
|
+
IsRealEqual( 0, RoeAvg(0.0,0.0) )
|
23
|
+
IsFalse( RoeAvg(0.0,0.0)==1 )
|
24
24
|
endTest
|
25
25
|
|
26
26
|
beginTest RoeAvgKnown
|
27
|
-
IsRealEqual( RoeAvg(leftState,rightState)
|
28
|
-
IsTrue( RoeAvg(leftState,rightState)
|
27
|
+
IsRealEqual( 0.5, RoeAvg(leftState,rightState) )
|
28
|
+
IsTrue( RoeAvg(leftState,rightState) > 0 )
|
29
29
|
endTest
|
30
30
|
|
31
31
|
beginTest CentralFluxKnown
|
32
32
|
call CentralFlux( leftState, rightState, interfaceFlux )
|
33
|
-
IsEqualWithin(
|
34
|
-
IsEqualWithin(
|
35
|
-
IsEqual(
|
33
|
+
IsEqualWithin( 0.25, interfaceFlux, 0.001 )
|
34
|
+
IsEqualWithin( 0.25, interfaceFlux, 0.00000001 )
|
35
|
+
IsEqual( 0.25, interfaceFlux )
|
36
36
|
endTest
|
37
37
|
|
38
38
|
beginTest RoeFluxExpansionShock
|
39
39
|
leftState = -1
|
40
40
|
call RoeFlux( leftState, rightState, interfaceFlux )
|
41
|
-
IsEqual(
|
41
|
+
IsEqual( 0.5, interfaceFlux )
|
42
42
|
endTest
|
43
43
|
|
44
44
|
beginTest RoeFluxZero
|
45
45
|
rightState = 0
|
46
46
|
call RoeFlux( leftState, rightState, interfaceFlux )
|
47
|
-
IsRealEqual(
|
48
|
-
IsEqual(
|
47
|
+
IsRealEqual( 0, interfaceFlux )
|
48
|
+
IsEqual( 0, interfaceFlux )
|
49
49
|
endTest
|
data/examples/CFD/GasModel.fun
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
! $Id: GasModel.fun
|
1
|
+
! $Id: GasModel.fun 166 2006-04-18 13:34:25Z kleb $
|
2
2
|
|
3
|
-
|
3
|
+
real :: Pressure, Density, Energy
|
4
4
|
|
5
5
|
beginTest PerfectPZeroed
|
6
6
|
real, parameter :: zero = 0
|
7
7
|
call PerfectP (zero, zero, Pressure)
|
8
|
-
isRealEqual (
|
9
|
-
IsEqualwithin (
|
8
|
+
isRealEqual ( 0, Pressure )
|
9
|
+
IsEqualwithin ( 0, Pressure, 0.0000000001 )
|
10
10
|
endTest
|
11
11
|
|
12
12
|
begintest Warbler
|
@@ -16,7 +16,7 @@ beginTest PerfectPKnown
|
|
16
16
|
real :: Density = 1
|
17
17
|
Energy = 1
|
18
18
|
call PerfectP( Density, Energy, Pressure )
|
19
|
-
IsRealEqual(
|
20
|
-
IsTrue (
|
21
|
-
IsFalse( Pressure
|
19
|
+
IsRealEqual( 0.4, Pressure )
|
20
|
+
IsTrue ( Pressure > 0 )
|
21
|
+
IsFalse( Pressure < 0 )
|
22
22
|
endTest
|
@@ -18,14 +18,14 @@ beginTest OneMSecDifference
|
|
18
18
|
dateAndTime1 = (/ 2000, 1, 1, 0, 0, 0, 0, 0 /)
|
19
19
|
dateAndTime2 = (/ 2000, 1, 1, 0, 0, 0, 0, 1 /)
|
20
20
|
seconds = SecBetween(dateAndTime1, dateAndTime2)
|
21
|
-
IsRealEqual(
|
21
|
+
IsRealEqual( 0.001, seconds)
|
22
22
|
endTest
|
23
23
|
|
24
24
|
beginTest MinuteRollover
|
25
25
|
dateAndTime1 = (/ 2000, 1, 1, 0, 0, 0,59, 0 /)
|
26
26
|
dateAndTime2 = (/ 2000, 1, 1, 0, 0, 1, 0, 0 /)
|
27
27
|
seconds = SecBetween(dateAndTime1, dateAndTime2)
|
28
|
-
IsRealEqual(
|
28
|
+
IsRealEqual( 1.0, seconds )
|
29
29
|
endTest
|
30
30
|
|
31
31
|
! test secSinceLast
|
@@ -39,7 +39,7 @@ endTest
|
|
39
39
|
|
40
40
|
beginTest InitiallyReturnsZero
|
41
41
|
seconds = secSinceLast()
|
42
|
-
IsRealEqual(
|
42
|
+
IsRealEqual( 0.0, seconds )
|
43
43
|
call timeDelay(seconds)
|
44
44
|
seconds = secSinceLast()
|
45
45
|
IsTrue( seconds /= 0.0 )
|
@@ -69,5 +69,5 @@ beginTest ComputesSecondsSpecial
|
|
69
69
|
seconds = secSinceLast()
|
70
70
|
dateAndTime2 = last
|
71
71
|
expectedSeconds = secBetween(dateAndTime1,dateAndTime2)
|
72
|
-
IsRealEqual(
|
72
|
+
IsRealEqual( expectedSeconds, seconds )
|
73
73
|
endTest
|
data/lib/funit/functions.rb
CHANGED
data/lib/funit/test_suite.rb
CHANGED
data/tests/tc_test_suite.rb
CHANGED
@@ -68,7 +68,7 @@ class TestTestSuite < Test::Unit::TestCase
|
|
68
68
|
beginTest assertTrue
|
69
69
|
integer :: a(2,2)
|
70
70
|
a = 1
|
71
|
-
IsEqual(a(1,1)
|
71
|
+
IsEqual(1,a(1,1))
|
72
72
|
endTest
|
73
73
|
MATRIX
|
74
74
|
Funit::TestSuite.new 'dummyf90test'
|
@@ -80,7 +80,7 @@ class TestTestSuite < Test::Unit::TestCase
|
|
80
80
|
beginTest assert_equals
|
81
81
|
real :: real_var
|
82
82
|
real_var = 1.0
|
83
|
-
IsRealEqual(
|
83
|
+
IsRealEqual(1.0,real_var)
|
84
84
|
endTest
|
85
85
|
REALEQUALS
|
86
86
|
Funit::TestSuite.new 'dummyf90test'
|
@@ -90,7 +90,7 @@ class TestTestSuite < Test::Unit::TestCase
|
|
90
90
|
def test_real_equals_assert_works_with_function
|
91
91
|
create_funit_file <<-REQUALSFUNC
|
92
92
|
beginTest assert_equals_for_function
|
93
|
-
IsRealEqual(
|
93
|
+
IsRealEqual(0.0,balance(0.0,0.0))
|
94
94
|
endTest
|
95
95
|
function balance( left, right)
|
96
96
|
real :: balance
|