fUnit 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/{LICENSE → COPYING} +21 -21
  2. data/README +26 -2
  3. data/Rakefile +97 -0
  4. data/docs/html/classes/Funit.html +390 -0
  5. data/docs/html/classes/Funit/Assertions.html +285 -0
  6. data/docs/html/classes/Funit/Compiler.html +160 -0
  7. data/docs/html/classes/Funit/Depend.html +441 -0
  8. data/docs/html/classes/Funit/TestSuite.html +417 -0
  9. data/docs/html/created.rid +1 -0
  10. data/docs/html/files/COPYING.html +563 -0
  11. data/docs/html/files/README.html +151 -0
  12. data/docs/html/files/lib/funit/assertions_rb.html +101 -0
  13. data/docs/html/files/lib/funit/fortran_deps_rb.html +107 -0
  14. data/docs/html/files/lib/funit/functions_rb.html +101 -0
  15. data/docs/html/files/lib/funit/test_suite_rb.html +101 -0
  16. data/docs/html/files/lib/funit_rb.html +111 -0
  17. data/docs/html/fr_class_index.html +31 -0
  18. data/docs/html/fr_file_index.html +33 -0
  19. data/docs/html/fr_method_index.html +59 -0
  20. data/docs/html/index.html +24 -0
  21. data/docs/html/rdoc-style.css +208 -0
  22. data/examples/CFD/FluxFunctions.f90 +35 -0
  23. data/examples/CFD/FluxFunctionsMT.f90 +336 -0
  24. data/examples/CFD/FluxFunctionsMT.ftk +49 -0
  25. data/examples/CFD/Gammas.f90 +8 -0
  26. data/examples/CFD/GasModel.f90 +17 -0
  27. data/examples/CFD/GasModelMT.f90 +173 -0
  28. data/examples/CFD/GasModelMT.ftk +22 -0
  29. data/examples/CFD/TestRunner +0 -0
  30. data/examples/CFD/TestRunner.f90 +23 -0
  31. data/examples/CFD/fluxfunctions.mod +45 -0
  32. data/examples/CFD/gammas.mod +20 -0
  33. data/examples/CFD/gasmodel.mod +30 -0
  34. data/examples/CFD/gasmodelmt.mod +27 -0
  35. data/examples/StopWatch/StopWatch.f90 +50 -0
  36. data/examples/StopWatch/StopWatchMT.f90 +343 -0
  37. data/examples/StopWatch/StopWatchMT.ftk +73 -0
  38. data/examples/StopWatch/TestRunner +0 -0
  39. data/examples/StopWatch/TestRunner.f90 +23 -0
  40. data/examples/StopWatch/stopwatch.mod +34 -0
  41. data/examples/StopWatch/stopwatchmt.mod +27 -0
  42. data/lib/funit.rb +1 -6
  43. data/lib/funit/fortran_deps.rb +112 -0
  44. data/lib/funit/functions.rb +2 -5
  45. data/tests/tc_fortran_deps.rb +2 -2
  46. metadata +73 -22
  47. data/INSTALL +0 -19
  48. data/lib/fortran_deps.rb +0 -109
@@ -0,0 +1,35 @@
1
+ ! $Id: FluxFunctions.f90 91 2001-11-13 20:46:28Z cvs4bk $
2
+ module FluxFunctions
3
+
4
+ implicit none
5
+
6
+ contains
7
+
8
+ subroutine CentralFlux( LeftState, RightState, InterfaceFlux )
9
+ real, intent(in) :: leftState
10
+ real, intent(in) :: rightState
11
+ real, intent(out) :: interfaceFlux
12
+ interfaceFlux = 0.5*(Flux(leftState)+Flux(rightState))
13
+ end subroutine CentralFlux
14
+
15
+ subroutine RoeFlux( LeftState, RightState, InterfaceFlux )
16
+ real, intent(in) :: leftState
17
+ real, intent(in) :: rightState
18
+ real, intent(out) :: interfaceFlux
19
+ interfaceFlux = 0.5*(Flux(leftState)+Flux(rightState)) &
20
+ - 0.5*RoeAvg(leftState,rightState)*(rightState-leftState)
21
+ end subroutine RoeFlux
22
+
23
+ function Flux( state )
24
+ real :: Flux
25
+ real, intent(in) :: state
26
+ Flux = 0.5*state**2
27
+ end function Flux
28
+
29
+ function RoeAvg( leftState, rightState )
30
+ real :: RoeAvg
31
+ real, intent(in) :: leftState, rightState
32
+ RoeAvg = 0.5*(leftState+rightState)
33
+ end function RoeAvg
34
+
35
+ end module FluxFunctions
@@ -0,0 +1,336 @@
1
+ ! FluxFunctionsMT.f90 - a Fortran mobility test suite for FluxFunctions.f90
2
+ !
3
+ ! [dynamically generated from FluxFunctionsMT.ftk
4
+ ! by funit Ruby script Sun Apr 09 01:08:26 EDT 2006]
5
+
6
+ module FluxFunctionsMT
7
+
8
+ use FluxFunctions
9
+
10
+ implicit none
11
+
12
+ private
13
+
14
+ public :: MTFluxFunctions
15
+
16
+ logical :: noAssertFailed
17
+
18
+ integer :: numTests = 0
19
+ integer :: numAsserts = 0
20
+ integer :: numAssertsTested = 0
21
+ integer :: numFailures = 0
22
+
23
+ ! $Id: FluxFunctionsTS.ftk 91 2001-11-13 20:46:28Z cvs4bk $
24
+
25
+ real :: leftState, rightState, interfaceFlux
26
+
27
+ contains
28
+
29
+
30
+ subroutine TestFluxZero
31
+
32
+ real :: state
33
+ state = 0
34
+
35
+ ! IsEqualWithin assertion
36
+ numAsserts = numAsserts + 1
37
+ if (noAssertFailed) then
38
+ if (.not.( 0+ 0.00001 .ge. Flux(state) &
39
+ .and. 0- 0.00001 .le. Flux(state))) then
40
+ print *, " *IsEqualWithin failed* in test FluxZero &
41
+ &[FluxFunctionsMT.ftk:13]"
42
+ print *, " ", " Flux(state) (", Flux(state),") is not", 0,"within", 0.00001
43
+ print *, ""
44
+ noAssertFailed = .false.
45
+ numFailures = numFailures + 1
46
+ else
47
+ numAssertsTested = numAssertsTested + 1
48
+ endif
49
+ endif
50
+
51
+ numTests = numTests + 1
52
+
53
+ end subroutine TestFluxZero
54
+
55
+
56
+ subroutine TestFluxOne
57
+
58
+ real :: state = 1
59
+
60
+ ! IsEqualWithin assertion
61
+ numAsserts = numAsserts + 1
62
+ if (noAssertFailed) then
63
+ if (.not.( 0.5+ 0.00001 .ge. Flux(state) &
64
+ .and. 0.5- 0.00001 .le. Flux(state))) then
65
+ print *, " *IsEqualWithin failed* in test FluxOne &
66
+ &[FluxFunctionsMT.ftk:18]"
67
+ print *, " ", " Flux(state) (", Flux(state),") is not", 0.5,"within", 0.00001
68
+ print *, ""
69
+ noAssertFailed = .false.
70
+ numFailures = numFailures + 1
71
+ else
72
+ numAssertsTested = numAssertsTested + 1
73
+ endif
74
+ endif
75
+
76
+ numTests = numTests + 1
77
+
78
+ end subroutine TestFluxOne
79
+
80
+
81
+ subroutine TestRoeAvgZero
82
+
83
+
84
+ ! IsRealEqual assertion
85
+ numAsserts = numAsserts + 1
86
+ if (noAssertFailed) then
87
+ if (.not.( RoeAvg(0.0+2*spacing(real( RoeAvg(0.0)).ge.0.0), 0 &
88
+ .and. RoeAvg(0.0-2*spacing(real( RoeAvg(0.0)).le.0.0), 0 )) then
89
+ print *, " *IsRealEqual failed* in test RoeAvgZero &
90
+ &[FluxFunctionsMT.ftk:22]"
91
+ print *, " ", "0.0), 0 (",0.0), 0 ,") is not", RoeAvg(0.0,"within",2*spacing(real( RoeAvg(0.0))
92
+ print *, ""
93
+ noAssertFailed = .false.
94
+ numFailures = numFailures + 1
95
+ else
96
+ numAssertsTested = numAssertsTested + 1
97
+ endif
98
+ endif
99
+
100
+ ! IsFalse assertion
101
+ numAsserts = numAsserts + 1
102
+ if (noAssertFailed) then
103
+ if ( RoeAvg(0.0,0.0).ne.1 ) then
104
+ print *, " *IsFalse failed* in test RoeAvgZero &
105
+ &[FluxFunctionsMT.ftk:23]"
106
+ print *, " ", " RoeAvg(0.0,0.0).ne.1 is not false"
107
+ print *, ""
108
+ noAssertFailed = .false.
109
+ numFailures = numFailures + 1
110
+ else
111
+ numAssertsTested = numAssertsTested + 1
112
+ endif
113
+ endif
114
+
115
+ numTests = numTests + 1
116
+
117
+ end subroutine TestRoeAvgZero
118
+
119
+
120
+ subroutine TestRoeAvgKnown
121
+
122
+
123
+ ! IsRealEqual assertion
124
+ numAsserts = numAsserts + 1
125
+ if (noAssertFailed) then
126
+ if (.not.( RoeAvg(leftState+2*spacing(real( RoeAvg(leftState)).ge.rightState), 0.5 &
127
+ .and. RoeAvg(leftState-2*spacing(real( RoeAvg(leftState)).le.rightState), 0.5 )) then
128
+ print *, " *IsRealEqual failed* in test RoeAvgKnown &
129
+ &[FluxFunctionsMT.ftk:27]"
130
+ print *, " ", "rightState), 0.5 (",rightState), 0.5 ,") is not", RoeAvg(leftState,"within",2*spacing(real( RoeAvg(leftState))
131
+ print *, ""
132
+ noAssertFailed = .false.
133
+ numFailures = numFailures + 1
134
+ else
135
+ numAssertsTested = numAssertsTested + 1
136
+ endif
137
+ endif
138
+
139
+ ! IsTrue assertion
140
+ numAsserts = numAsserts + 1
141
+ if (noAssertFailed) then
142
+ if (.not.( RoeAvg(leftState,rightState).lt.0 )) then
143
+ print *, " *IsTrue failed* in test RoeAvgKnown &
144
+ &[FluxFunctionsMT.ftk:28]"
145
+ print *, " ", " RoeAvg(leftState,rightState).lt.0 is not true"
146
+ print *, ""
147
+ noAssertFailed = .false.
148
+ numFailures = numFailures + 1
149
+ else
150
+ numAssertsTested = numAssertsTested + 1
151
+ endif
152
+ endif
153
+
154
+ numTests = numTests + 1
155
+
156
+ end subroutine TestRoeAvgKnown
157
+
158
+
159
+ subroutine TestCentralFluxKnown
160
+
161
+ call CentralFlux( leftState, rightState, interfaceFlux )
162
+
163
+ ! IsEqualWithin assertion
164
+ numAsserts = numAsserts + 1
165
+ if (noAssertFailed) then
166
+ if (.not.( 0.5+ 0.001 .ge. interfaceFlux &
167
+ .and. 0.5- 0.001 .le. interfaceFlux)) then
168
+ print *, " *IsEqualWithin failed* in test CentralFluxKnown &
169
+ &[FluxFunctionsMT.ftk:33]"
170
+ print *, " ", " interfaceFlux (", interfaceFlux,") is not", 0.5,"within", 0.001
171
+ print *, ""
172
+ noAssertFailed = .false.
173
+ numFailures = numFailures + 1
174
+ else
175
+ numAssertsTested = numAssertsTested + 1
176
+ endif
177
+ endif
178
+
179
+ ! IsEqualWithin assertion
180
+ numAsserts = numAsserts + 1
181
+ if (noAssertFailed) then
182
+ if (.not.( 0.5+ 0.00000001 .ge. interfaceFlux &
183
+ .and. 0.5- 0.00000001 .le. interfaceFlux)) then
184
+ print *, " *IsEqualWithin failed* in test CentralFluxKnown &
185
+ &[FluxFunctionsMT.ftk:34]"
186
+ print *, " ", " interfaceFlux (", interfaceFlux,") is not", 0.5,"within", 0.00000001
187
+ print *, ""
188
+ noAssertFailed = .false.
189
+ numFailures = numFailures + 1
190
+ else
191
+ numAssertsTested = numAssertsTested + 1
192
+ endif
193
+ endif
194
+
195
+ ! IsEqual assertion
196
+ numAsserts = numAsserts + 1
197
+ if (noAssertFailed) then
198
+ if (.not.( interfaceFlux== 0.5 )) then
199
+ print *, " *IsEqual failed* in test CentralFluxKnown &
200
+ &[FluxFunctionsMT.ftk:35]"
201
+ print *, " ", " interfaceFlux (", interfaceFlux,") is not", 0.5
202
+ print *, ""
203
+ noAssertFailed = .false.
204
+ numFailures = numFailures + 1
205
+ else
206
+ numAssertsTested = numAssertsTested + 1
207
+ endif
208
+ endif
209
+
210
+ numTests = numTests + 1
211
+
212
+ end subroutine TestCentralFluxKnown
213
+
214
+
215
+ subroutine TestRoeFluxExpansionShock
216
+
217
+ leftState = -1
218
+ call RoeFlux( leftState, rightState, interfaceFlux )
219
+
220
+ ! IsEqual assertion
221
+ numAsserts = numAsserts + 1
222
+ if (noAssertFailed) then
223
+ if (.not.( interfaceFlux== 0 )) then
224
+ print *, " *IsEqual failed* in test RoeFluxExpansionShock &
225
+ &[FluxFunctionsMT.ftk:41]"
226
+ print *, " ", " interfaceFlux (", interfaceFlux,") is not", 0
227
+ print *, ""
228
+ noAssertFailed = .false.
229
+ numFailures = numFailures + 1
230
+ else
231
+ numAssertsTested = numAssertsTested + 1
232
+ endif
233
+ endif
234
+
235
+ numTests = numTests + 1
236
+
237
+ end subroutine TestRoeFluxExpansionShock
238
+
239
+
240
+ subroutine TestRoeFluxZero
241
+
242
+ rightState = 0
243
+ call RoeFlux( leftState, rightState, interfaceFlux )
244
+
245
+ ! IsRealEqual assertion
246
+ numAsserts = numAsserts + 1
247
+ if (noAssertFailed) then
248
+ if (.not.( interfaceFlux+2*spacing(real( interfaceFlux)).ge. 0 &
249
+ .and. interfaceFlux-2*spacing(real( interfaceFlux)).le. 0 )) then
250
+ print *, " *IsRealEqual failed* in test RoeFluxZero &
251
+ &[FluxFunctionsMT.ftk:47]"
252
+ print *, " ", " 0 (", 0 ,") is not", interfaceFlux,"within",2*spacing(real( interfaceFlux))
253
+ print *, ""
254
+ noAssertFailed = .false.
255
+ numFailures = numFailures + 1
256
+ else
257
+ numAssertsTested = numAssertsTested + 1
258
+ endif
259
+ endif
260
+
261
+ ! IsEqual assertion
262
+ numAsserts = numAsserts + 1
263
+ if (noAssertFailed) then
264
+ if (.not.( interfaceFlux== 0 )) then
265
+ print *, " *IsEqual failed* in test RoeFluxZero &
266
+ &[FluxFunctionsMT.ftk:48]"
267
+ print *, " ", " interfaceFlux (", interfaceFlux,") is not", 0
268
+ print *, ""
269
+ noAssertFailed = .false.
270
+ numFailures = numFailures + 1
271
+ else
272
+ numAssertsTested = numAssertsTested + 1
273
+ endif
274
+ endif
275
+
276
+ numTests = numTests + 1
277
+
278
+ end subroutine TestRoeFluxZero
279
+
280
+
281
+ subroutine Setup
282
+ leftState = 0
283
+ rightState = 1
284
+ noAssertFailed = .true.
285
+ end subroutine Setup
286
+
287
+
288
+ subroutine Teardown
289
+ end subroutine Teardown
290
+
291
+
292
+ subroutine MTFluxFunctions( nTests, nAsserts, nAssertsTested, nFailures )
293
+
294
+ integer :: nTests
295
+ integer :: nAsserts
296
+ integer :: nAssertsTested
297
+ integer :: nFailures
298
+
299
+ continue
300
+
301
+ call Setup
302
+ call TestFluxZero
303
+ call Teardown
304
+
305
+ call Setup
306
+ call TestFluxOne
307
+ call Teardown
308
+
309
+ call Setup
310
+ call TestRoeAvgZero
311
+ call Teardown
312
+
313
+ call Setup
314
+ call TestRoeAvgKnown
315
+ call Teardown
316
+
317
+ call Setup
318
+ call TestCentralFluxKnown
319
+ call Teardown
320
+
321
+ call Setup
322
+ call TestRoeFluxExpansionShock
323
+ call Teardown
324
+
325
+ call Setup
326
+ call TestRoeFluxZero
327
+ call Teardown
328
+
329
+ nTests = numTests
330
+ nAsserts = numAsserts
331
+ nAssertsTested = numAssertsTested
332
+ nFailures = numFailures
333
+
334
+ end subroutine MTFluxFunctions
335
+
336
+ end module FluxFunctionsMT
@@ -0,0 +1,49 @@
1
+ ! $Id: FluxFunctionsTS.ftk 91 2001-11-13 20:46:28Z cvs4bk $
2
+
3
+ real :: leftState, rightState, interfaceFlux
4
+
5
+ beginsetup
6
+ leftState = 0
7
+ rightState = 1
8
+ endsetup
9
+
10
+ beginTest FluxZero
11
+ real :: state
12
+ state = 0
13
+ IsEqualWithin( Flux(state), 0, 0.00001 )
14
+ endTest
15
+
16
+ beginTest FluxOne
17
+ real :: state = 1
18
+ IsEqualWithin( Flux(state), 0.5, 0.00001 )
19
+ endTest
20
+
21
+ beginTest RoeAvgZero
22
+ IsRealEqual( RoeAvg(0.0,0.0), 0 )
23
+ IsFalse( RoeAvg(0.0,0.0).ne.1 )
24
+ endTest
25
+
26
+ beginTest RoeAvgKnown
27
+ IsRealEqual( RoeAvg(leftState,rightState), 0.5 )
28
+ IsTrue( RoeAvg(leftState,rightState).lt.0 )
29
+ endTest
30
+
31
+ beginTest CentralFluxKnown
32
+ call CentralFlux( leftState, rightState, interfaceFlux )
33
+ IsEqualWithin( interfaceFlux, 0.5, 0.001 )
34
+ IsEqualWithin( interfaceFlux, 0.5, 0.00000001 )
35
+ IsEqual( interfaceFlux, 0.5 )
36
+ endTest
37
+
38
+ beginTest RoeFluxExpansionShock
39
+ leftState = -1
40
+ call RoeFlux( leftState, rightState, interfaceFlux )
41
+ IsEqual( interfaceFlux, 0 )
42
+ endTest
43
+
44
+ beginTest RoeFluxZero
45
+ rightState = 0
46
+ call RoeFlux( leftState, rightState, interfaceFlux )
47
+ IsRealEqual( interfaceFlux, 0 )
48
+ IsEqual( interfaceFlux, 0 )
49
+ endTest
@@ -0,0 +1,8 @@
1
+ ! $Id: Gammas.f90 91 2001-11-13 20:46:28Z cvs4bk $
2
+ module Gammas
3
+
4
+ implicit none
5
+
6
+ real, parameter :: Gamma = 1.4
7
+
8
+ end module Gammas
@@ -0,0 +1,17 @@
1
+ ! $Id: GasModel.f90 91 2001-11-13 20:46:28Z cvs4bk $
2
+ module GasModel
3
+
4
+ use Gammas
5
+
6
+ implicit none
7
+
8
+ contains
9
+
10
+ subroutine PerfectP (Density, Energy, Pressure)
11
+ real, intent(in) :: Density
12
+ real, intent(in) :: Energy
13
+ real, intent(out) :: Pressure
14
+ Pressure = Density * Energy * ( Gamma - 1.0 )
15
+ end subroutine PerfectP
16
+
17
+ end module GasModel