fUnit 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE → COPYING} +21 -21
- data/README +26 -2
- data/Rakefile +97 -0
- data/docs/html/classes/Funit.html +390 -0
- data/docs/html/classes/Funit/Assertions.html +285 -0
- data/docs/html/classes/Funit/Compiler.html +160 -0
- data/docs/html/classes/Funit/Depend.html +441 -0
- data/docs/html/classes/Funit/TestSuite.html +417 -0
- data/docs/html/created.rid +1 -0
- data/docs/html/files/COPYING.html +563 -0
- data/docs/html/files/README.html +151 -0
- data/docs/html/files/lib/funit/assertions_rb.html +101 -0
- data/docs/html/files/lib/funit/fortran_deps_rb.html +107 -0
- data/docs/html/files/lib/funit/functions_rb.html +101 -0
- data/docs/html/files/lib/funit/test_suite_rb.html +101 -0
- data/docs/html/files/lib/funit_rb.html +111 -0
- data/docs/html/fr_class_index.html +31 -0
- data/docs/html/fr_file_index.html +33 -0
- data/docs/html/fr_method_index.html +59 -0
- data/docs/html/index.html +24 -0
- data/docs/html/rdoc-style.css +208 -0
- data/examples/CFD/FluxFunctions.f90 +35 -0
- data/examples/CFD/FluxFunctionsMT.f90 +336 -0
- data/examples/CFD/FluxFunctionsMT.ftk +49 -0
- data/examples/CFD/Gammas.f90 +8 -0
- data/examples/CFD/GasModel.f90 +17 -0
- data/examples/CFD/GasModelMT.f90 +173 -0
- data/examples/CFD/GasModelMT.ftk +22 -0
- data/examples/CFD/TestRunner +0 -0
- data/examples/CFD/TestRunner.f90 +23 -0
- data/examples/CFD/fluxfunctions.mod +45 -0
- data/examples/CFD/gammas.mod +20 -0
- data/examples/CFD/gasmodel.mod +30 -0
- data/examples/CFD/gasmodelmt.mod +27 -0
- data/examples/StopWatch/StopWatch.f90 +50 -0
- data/examples/StopWatch/StopWatchMT.f90 +343 -0
- data/examples/StopWatch/StopWatchMT.ftk +73 -0
- data/examples/StopWatch/TestRunner +0 -0
- data/examples/StopWatch/TestRunner.f90 +23 -0
- data/examples/StopWatch/stopwatch.mod +34 -0
- data/examples/StopWatch/stopwatchmt.mod +27 -0
- data/lib/funit.rb +1 -6
- data/lib/funit/fortran_deps.rb +112 -0
- data/lib/funit/functions.rb +2 -5
- data/tests/tc_fortran_deps.rb +2 -2
- metadata +73 -22
- data/INSTALL +0 -19
- data/lib/fortran_deps.rb +0 -109
data/{LICENSE → COPYING}
RENAMED
@@ -21,51 +21,51 @@ Government Agency Point of Contact: funit-support@rubyforge.org
|
|
21
21
|
1. DEFINITIONS
|
22
22
|
|
23
23
|
A. "Contributor" means Government Agency, as the developer of the
|
24
|
-
|
24
|
+
Original Software, and any entity that makes a Modification.
|
25
25
|
|
26
26
|
B. "Covered Patents" mean patent claims licensable by a Contributor
|
27
|
-
|
28
|
-
|
27
|
+
that are necessarily infringed by the use or sale of its Modification
|
28
|
+
alone or when combined with the Subject Software.
|
29
29
|
|
30
30
|
C. "Display" means the showing of a copy of the Subject Software,
|
31
|
-
|
31
|
+
either directly or by means of an image, or any other device.
|
32
32
|
|
33
33
|
D. "Distribution" means conveyance or transfer of the Subject
|
34
|
-
|
34
|
+
Software, regardless of means, to another.
|
35
35
|
|
36
36
|
E. "Larger Work" means computer software that combines Subject
|
37
|
-
|
38
|
-
|
37
|
+
Software, or portions thereof, with software separate from the Subject
|
38
|
+
Software that is not governed by the terms of this Agreement.
|
39
39
|
|
40
40
|
F. "Modification" means any alteration of, including addition to or
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
deletion from, the substance or structure of either the Original
|
42
|
+
Software or Subject Software, and includes derivative works, as that
|
43
|
+
term is defined in the Copyright Statute, 17 USC 101. However, the
|
44
|
+
act of including Subject Software as part of a Larger Work does not in
|
45
|
+
and of itself constitute a Modification.
|
46
46
|
|
47
47
|
G. "Original Software" means the computer software first released
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
under this Agreement by Government Agency with Government Agency
|
49
|
+
designation NASA and entitled fUnit, including source code,
|
50
|
+
object code and accompanying documentation, if any.
|
51
51
|
|
52
52
|
H. "Recipient" means anyone who acquires the Subject Software under
|
53
|
-
|
53
|
+
this Agreement, including all Contributors.
|
54
54
|
|
55
55
|
I. "Redistribution" means Distribution of the Subject Software after a
|
56
|
-
|
56
|
+
Modification has been made.
|
57
57
|
|
58
58
|
J. "Reproduction" means the making of a counterpart, image or copy of
|
59
|
-
|
59
|
+
the Subject Software.
|
60
60
|
|
61
61
|
K. "Sale" means the exchange of the Subject Software for money or
|
62
|
-
|
62
|
+
equivalent value.
|
63
63
|
|
64
64
|
L. "Subject Software" means the Original Software, Modifications, or
|
65
|
-
|
65
|
+
any respective parts thereof.
|
66
66
|
|
67
67
|
M. "Use" means the application or employment of the Subject Software
|
68
|
-
|
68
|
+
for any purpose.
|
69
69
|
|
70
70
|
2. GRANT OF RIGHTS
|
71
71
|
|
data/README
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
-
|
1
|
+
= FUnit: a Fortran Unit Testing Framework
|
2
2
|
|
3
|
-
|
3
|
+
FUnit is a unit testing framework for Fortran modules.
|
4
|
+
Unit tests are written in Fortran fragments that use a small
|
5
|
+
set of testing-specific extensions. FUnit transforms these
|
6
|
+
fragments into valid Fortran code and compiles,
|
7
|
+
links, and runs them against the module under test.
|
8
|
+
|
9
|
+
== Prerequisites
|
10
|
+
|
11
|
+
1. A Fortran 90/95/2003 compiler (set via F9X environment variable)
|
12
|
+
2. {The Ruby language}[http://www.ruby-lang.org/]
|
13
|
+
3. {RubyGems package manager}[http://rubyforge.org/projects/rubygems/]
|
14
|
+
|
15
|
+
== Installation
|
16
|
+
|
17
|
+
gem install funit
|
18
|
+
|
19
|
+
== To Do
|
20
|
+
|
21
|
+
* Make tests so that they fail gracefully if Fortran compiler not found.
|
22
|
+
* Work out RubyGEM packaging kinks.
|
23
|
+
* Change from CamelCase to snake_case.
|
24
|
+
* Use 'test' keyword instead of 'beginTest' business.
|
25
|
+
* Clean up documentation.
|
26
|
+
* To increase portability, create a single, stand-alone executable with
|
27
|
+
Erik Veenstra's RubyScript2Exe[http://www.erikveen.dds.nl/rubyscript2exe/].
|
data/Rakefile
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
# Rakefile for fUnit -*- ruby -*-
|
2
|
+
#
|
3
|
+
# Copyright 2006 United States Government as represented by NASA Langley
|
4
|
+
# Research Center, Hampton, Virginia.
|
5
|
+
#
|
6
|
+
# This file is governed by the OSI-approved, NASA Open Source Agreement.
|
7
|
+
# See COPYING for details.
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'rubygems'
|
11
|
+
require 'rake/gempackagetask'
|
12
|
+
require 'code_statistics'
|
13
|
+
rescue Exception
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'rake/testtask'
|
18
|
+
require 'rake/rdoctask'
|
19
|
+
|
20
|
+
PKG_VERSION = '0.0.2'
|
21
|
+
|
22
|
+
PKG_FILES = FileList[
|
23
|
+
'[A-Z]*',
|
24
|
+
'bin/**/*',
|
25
|
+
'docs/**/*',
|
26
|
+
'examples/**/*',
|
27
|
+
'lib/**/*',
|
28
|
+
'tests/**/*.rb'
|
29
|
+
]
|
30
|
+
|
31
|
+
desc 'Default task'
|
32
|
+
task :default => [:test]
|
33
|
+
|
34
|
+
rd = Rake::RDocTask.new do |rdoc|
|
35
|
+
rdoc.main = 'README'
|
36
|
+
rdoc.rdoc_dir = 'docs/html'
|
37
|
+
rdoc.title = 'fUnit: Fortran Unit Testing'
|
38
|
+
rdoc.options << '--inline-source' << '--main' << 'README'
|
39
|
+
rdoc.rdoc_files.include( 'README', 'COPYING' )
|
40
|
+
rdoc.rdoc_files.include( 'lib/**/*.rb' )
|
41
|
+
end
|
42
|
+
|
43
|
+
desc 'Upload current documentation to Rubyforge'
|
44
|
+
task :upload_docs => [:rdoc] do
|
45
|
+
sh 'scp -r docs/html/* rubyforge.org:/var/www/gforge-projects/funit/'
|
46
|
+
end
|
47
|
+
|
48
|
+
Rake::TestTask.new do |t|
|
49
|
+
t.test_files = [ 'tests/ts_funit.rb' ]
|
50
|
+
t.warning = true
|
51
|
+
t.verbose = true
|
52
|
+
t.libs << 'tests'
|
53
|
+
end
|
54
|
+
|
55
|
+
if ! defined?(Gem)
|
56
|
+
$stderr.puts 'Package Target requires RubyGEMs'
|
57
|
+
else
|
58
|
+
spec = Gem::Specification.new do |s|
|
59
|
+
s.name = 'fUnit'
|
60
|
+
s.version = PKG_VERSION
|
61
|
+
s.files = PKG_FILES.to_a
|
62
|
+
s.author = 'fUnit Team'
|
63
|
+
s.email = 'funit-support@rubyforge.org'
|
64
|
+
s.homepage = 'http://funit.rubyforge.org/'
|
65
|
+
s.platform = Gem::Platform::RUBY
|
66
|
+
s.summary = 'A Fortran Unit Testing Framework'
|
67
|
+
s.description = <<-EOF
|
68
|
+
FUnit is a unit testing framework for Fortran modules.
|
69
|
+
Unit tests are written in Fortran fragments that use a small
|
70
|
+
set of testing-specific extensions. FUnit transforms these
|
71
|
+
fragments into valid Fortran code and compiles, links, and
|
72
|
+
runs them against the module under test.
|
73
|
+
EOF
|
74
|
+
s.rubyforge_project = 'funit'
|
75
|
+
s.require_path = 'lib'
|
76
|
+
s.autorequire = 'funit'
|
77
|
+
s.bindir = 'bin'
|
78
|
+
s.executable = 'funit'
|
79
|
+
s.test_suite_file = 'tests/ts_funit.rb'
|
80
|
+
s.has_rdoc = true
|
81
|
+
s.rdoc_options = rd.options
|
82
|
+
s.extra_rdoc_files = rd.rdoc_files.reject{|f| f.match(/\.rb$/)}.to_a
|
83
|
+
end
|
84
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
85
|
+
pkg.need_tar = true
|
86
|
+
pkg.need_zip = true
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
desc 'Show code statistics'
|
91
|
+
task :stats do
|
92
|
+
if ! defined?(CodeStatistics)
|
93
|
+
$stderr.puts 'Stats target requires Rails'
|
94
|
+
else
|
95
|
+
CodeStatistics.new( %w[Source lib], %w[Units tests] ).to_s
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,390 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Funit</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Funit</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/funit_rb.html">
|
59
|
+
lib/funit.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/lib/funit/assertions_rb.html">
|
63
|
+
lib/funit/assertions.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
<a href="../files/lib/funit/fortran_deps_rb.html">
|
67
|
+
lib/funit/fortran_deps.rb
|
68
|
+
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/lib/funit/functions_rb.html">
|
71
|
+
lib/funit/functions.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
<a href="../files/lib/funit/test_suite_rb.html">
|
75
|
+
lib/funit/test_suite.rb
|
76
|
+
</a>
|
77
|
+
<br />
|
78
|
+
</td>
|
79
|
+
</tr>
|
80
|
+
|
81
|
+
</table>
|
82
|
+
</div>
|
83
|
+
<!-- banner header -->
|
84
|
+
|
85
|
+
<div id="bodyContent">
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<div id="contextContent">
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div id="method-list">
|
96
|
+
<h3 class="section-bar">Methods</h3>
|
97
|
+
|
98
|
+
<div class="name-list">
|
99
|
+
<a href="#M000008">compileTests</a>
|
100
|
+
<a href="#M000003">ftkExists?</a>
|
101
|
+
<a href="#M000004">parseCommandLine</a>
|
102
|
+
<a href="#M000002">requestedModules</a>
|
103
|
+
<a href="#M000001">runAllFtks</a>
|
104
|
+
<a href="#M000006">syntaxError</a>
|
105
|
+
<a href="#M000007">warning</a>
|
106
|
+
<a href="#M000005">writeTestRunner</a>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<!-- if includes -->
|
114
|
+
<div id="includes">
|
115
|
+
<h3 class="section-bar">Included Modules</h3>
|
116
|
+
|
117
|
+
<div id="includes-list">
|
118
|
+
<span class="include-name"><a href="Funit/Assertions.html">Funit::Assertions</a></span>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<div id="section">
|
123
|
+
|
124
|
+
<div id="class-list">
|
125
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
126
|
+
|
127
|
+
Module <a href="Funit/Assertions.html" class="link">Funit::Assertions</a><br />
|
128
|
+
Class <a href="Funit/Compiler.html" class="link">Funit::Compiler</a><br />
|
129
|
+
Class <a href="Funit/Depend.html" class="link">Funit::Depend</a><br />
|
130
|
+
Class <a href="Funit/TestSuite.html" class="link">Funit::TestSuite</a><br />
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<!-- if method_list -->
|
141
|
+
<div id="methods">
|
142
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
143
|
+
|
144
|
+
<div id="method-M000008" class="method-detail">
|
145
|
+
<a name="M000008"></a>
|
146
|
+
|
147
|
+
<div class="method-heading">
|
148
|
+
<a href="#M000008" class="method-signature">
|
149
|
+
<span class="method-name">compileTests</span><span class="method-args">(testSuites)</span>
|
150
|
+
</a>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<div class="method-description">
|
154
|
+
<p><a class="source-toggle" href="#"
|
155
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
156
|
+
<div class="method-source-code" id="M000008-source">
|
157
|
+
<pre>
|
158
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 111</span>
|
159
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compileTests</span> <span class="ruby-identifier">testSuites</span>
|
160
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"computing dependencies"</span>
|
161
|
+
<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>])
|
162
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"locating associated source files and sorting for compilation"</span>
|
163
|
+
<span class="ruby-identifier">requiredSources</span> = <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">required_source_files</span>(<span class="ruby-value str">'TestRunner.f90'</span>)
|
164
|
+
|
165
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">compile</span> = <span class="ruby-node">"#{ENV['F9X']} #{ENV['F9X_LDFLAGS']} -o TestRunner \\\n #{requiredSources.join(" \\\n ")}"</span>
|
166
|
+
|
167
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Compile failed."</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">system</span>(<span class="ruby-identifier">compile</span>)
|
168
|
+
<span class="ruby-keyword kw">end</span>
|
169
|
+
</pre>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<div id="method-M000003" class="method-detail">
|
175
|
+
<a name="M000003"></a>
|
176
|
+
|
177
|
+
<div class="method-heading">
|
178
|
+
<a href="#M000003" class="method-signature">
|
179
|
+
<span class="method-name">ftkExists?</span><span class="method-args">(moduleName)</span>
|
180
|
+
</a>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="method-description">
|
184
|
+
<p><a class="source-toggle" href="#"
|
185
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
186
|
+
<div class="method-source-code" id="M000003-source">
|
187
|
+
<pre>
|
188
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 30</span>
|
189
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ftkExists?</span>(<span class="ruby-identifier">moduleName</span>)
|
190
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-identifier">moduleName</span><span class="ruby-operator">+</span><span class="ruby-value str">"MT.ftk"</span>
|
191
|
+
<span class="ruby-keyword kw">end</span>
|
192
|
+
</pre>
|
193
|
+
</div>
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div id="method-M000004" class="method-detail">
|
198
|
+
<a name="M000004"></a>
|
199
|
+
|
200
|
+
<div class="method-heading">
|
201
|
+
<a href="#M000004" class="method-signature">
|
202
|
+
<span class="method-name">parseCommandLine</span><span class="method-args">()</span>
|
203
|
+
</a>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-description">
|
207
|
+
<p><a class="source-toggle" href="#"
|
208
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
209
|
+
<div class="method-source-code" id="M000004-source">
|
210
|
+
<pre>
|
211
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 34</span>
|
212
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parseCommandLine</span>
|
213
|
+
|
214
|
+
<span class="ruby-identifier">moduleNames</span> = <span class="ruby-identifier">requestedModules</span>(<span class="ruby-constant">ARGV</span>)
|
215
|
+
|
216
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">moduleNames</span>.<span class="ruby-identifier">empty?</span>
|
217
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">" *Error: no test suites found in this directory"</span>
|
218
|
+
<span class="ruby-keyword kw">end</span>
|
219
|
+
|
220
|
+
<span class="ruby-identifier">moduleNames</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
|
221
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ftkExists?</span>(<span class="ruby-identifier">mod</span>)
|
222
|
+
<span class="ruby-identifier">errorMessage</span> = <span class="ruby-value str">"Error: could not find test suite \#{mod}MT.ftk\nTest suites available in this directory:\n\#{requestedModules([]).join(' ')}\n\nUsage: \#{File.basename $0} [test names (w/o MT.ftk suffix)]\n"</span>
|
223
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">errorMessage</span>
|
224
|
+
<span class="ruby-keyword kw">end</span>
|
225
|
+
<span class="ruby-keyword kw">end</span>
|
226
|
+
|
227
|
+
<span class="ruby-keyword kw">end</span>
|
228
|
+
</pre>
|
229
|
+
</div>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div id="method-M000002" class="method-detail">
|
234
|
+
<a name="M000002"></a>
|
235
|
+
|
236
|
+
<div class="method-heading">
|
237
|
+
<a href="#M000002" class="method-signature">
|
238
|
+
<span class="method-name">requestedModules</span><span class="method-args">(moduleNames)</span>
|
239
|
+
</a>
|
240
|
+
</div>
|
241
|
+
|
242
|
+
<div class="method-description">
|
243
|
+
<p><a class="source-toggle" href="#"
|
244
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
245
|
+
<div class="method-source-code" id="M000002-source">
|
246
|
+
<pre>
|
247
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 23</span>
|
248
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requestedModules</span>(<span class="ruby-identifier">moduleNames</span>)
|
249
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">moduleNames</span>.<span class="ruby-identifier">empty?</span>)
|
250
|
+
<span class="ruby-identifier">moduleNames</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-value str">"*MT.ftk"</span>].<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">chomp!</span> <span class="ruby-value str">"MT.ftk"</span> }
|
251
|
+
<span class="ruby-keyword kw">end</span>
|
252
|
+
<span class="ruby-identifier">moduleNames</span>
|
253
|
+
<span class="ruby-keyword kw">end</span>
|
254
|
+
</pre>
|
255
|
+
</div>
|
256
|
+
</div>
|
257
|
+
</div>
|
258
|
+
|
259
|
+
<div id="method-M000001" class="method-detail">
|
260
|
+
<a name="M000001"></a>
|
261
|
+
|
262
|
+
<div class="method-heading">
|
263
|
+
<a href="#M000001" class="method-signature">
|
264
|
+
<span class="method-name">runAllFtks</span><span class="method-args">()</span>
|
265
|
+
</a>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div class="method-description">
|
269
|
+
<p><a class="source-toggle" href="#"
|
270
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
271
|
+
<div class="method-source-code" id="M000001-source">
|
272
|
+
<pre>
|
273
|
+
<span class="ruby-comment cmt"># File lib/funit.rb, line 7</span>
|
274
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">runAllFtks</span>
|
275
|
+
<span class="ruby-constant">Compiler</span>.<span class="ruby-identifier">new</span> <span class="ruby-comment cmt"># a test for compiler env set (remove this later)</span>
|
276
|
+
<span class="ruby-identifier">writeTestRunner</span>(<span class="ruby-identifier">testSuites</span> = <span class="ruby-identifier">parseCommandLine</span>)
|
277
|
+
|
278
|
+
<span class="ruby-comment cmt"># convert each *MT.ftk file into a pure Fortran9x file:</span>
|
279
|
+
<span class="ruby-identifier">testSuites</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">testSuite</span><span class="ruby-operator">|</span>
|
280
|
+
<span class="ruby-identifier">testSuiteF90</span> = <span class="ruby-constant">TestSuite</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">testSuite</span>)
|
281
|
+
<span class="ruby-keyword kw">end</span>
|
282
|
+
|
283
|
+
<span class="ruby-identifier">compileTests</span> <span class="ruby-identifier">testSuites</span>
|
284
|
+
|
285
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Failed to execute TestRunner"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">system</span>(<span class="ruby-value str">"./TestRunner"</span>)
|
286
|
+
<span class="ruby-keyword kw">end</span>
|
287
|
+
</pre>
|
288
|
+
</div>
|
289
|
+
</div>
|
290
|
+
</div>
|
291
|
+
|
292
|
+
<div id="method-M000006" class="method-detail">
|
293
|
+
<a name="M000006"></a>
|
294
|
+
|
295
|
+
<div class="method-heading">
|
296
|
+
<a href="#M000006" class="method-signature">
|
297
|
+
<span class="method-name">syntaxError</span><span class="method-args">( message, testSuite )</span>
|
298
|
+
</a>
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div class="method-description">
|
302
|
+
<p><a class="source-toggle" href="#"
|
303
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
304
|
+
<div class="method-source-code" id="M000006-source">
|
305
|
+
<pre>
|
306
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 103</span>
|
307
|
+
<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> )
|
308
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"\n *Error: #{message} [#{testSuite}MT.ftk:#$.]\n\n"</span>
|
309
|
+
<span class="ruby-keyword kw">end</span>
|
310
|
+
</pre>
|
311
|
+
</div>
|
312
|
+
</div>
|
313
|
+
</div>
|
314
|
+
|
315
|
+
<div id="method-M000007" class="method-detail">
|
316
|
+
<a name="M000007"></a>
|
317
|
+
|
318
|
+
<div class="method-heading">
|
319
|
+
<a href="#M000007" class="method-signature">
|
320
|
+
<span class="method-name">warning</span><span class="method-args">( message, testSuite )</span>
|
321
|
+
</a>
|
322
|
+
</div>
|
323
|
+
|
324
|
+
<div class="method-description">
|
325
|
+
<p><a class="source-toggle" href="#"
|
326
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
327
|
+
<div class="method-source-code" id="M000007-source">
|
328
|
+
<pre>
|
329
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 107</span>
|
330
|
+
<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> )
|
331
|
+
<span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"\n *Warning: #{message} [#{testSuite}MT.ftk:#$.]"</span>
|
332
|
+
<span class="ruby-keyword kw">end</span>
|
333
|
+
</pre>
|
334
|
+
</div>
|
335
|
+
</div>
|
336
|
+
</div>
|
337
|
+
|
338
|
+
<div id="method-M000005" class="method-detail">
|
339
|
+
<a name="M000005"></a>
|
340
|
+
|
341
|
+
<div class="method-heading">
|
342
|
+
<a href="#M000005" class="method-signature">
|
343
|
+
<span class="method-name">writeTestRunner</span><span class="method-args">(testSuites)</span>
|
344
|
+
</a>
|
345
|
+
</div>
|
346
|
+
|
347
|
+
<div class="method-description">
|
348
|
+
<p><a class="source-toggle" href="#"
|
349
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
350
|
+
<div class="method-source-code" id="M000005-source">
|
351
|
+
<pre>
|
352
|
+
<span class="ruby-comment cmt"># File lib/funit/functions.rb, line 58</span>
|
353
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">writeTestRunner</span> <span class="ruby-identifier">testSuites</span>
|
354
|
+
|
355
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"TestRunner.f90"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">"TestRunner.f90"</span>)
|
356
|
+
<span class="ruby-identifier">testRunner</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span> <span class="ruby-value str">"TestRunner.f90"</span>, <span class="ruby-value str">"w"</span>
|
357
|
+
|
358
|
+
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"! TestRunner.f90 - runs Fortran mobility test suites\n!\n! [Dynamically generated by \#{File.basename $0} Ruby script \#{Time.now}.]\n\nprogram TestRunner\n\n"</span>
|
359
|
+
|
360
|
+
<span class="ruby-identifier">testSuites</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">testSuite</span><span class="ruby-operator">|</span> <span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">" use #{testSuite}MT"</span> }
|
361
|
+
|
362
|
+
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nimplicit none\n\ninteger :: numTests, numAsserts, numAssertsTested, numFailures\n"</span>
|
363
|
+
|
364
|
+
<span class="ruby-identifier">testSuites</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">testSuite</span><span class="ruby-operator">|</span>
|
365
|
+
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nprint *, \"\"\nprint *, \"\#{testSuite} test suite:\"\ncall MT\#{testSuite}( numTests, &\nnumAsserts, numAssertsTested, numFailures )\nprint *, \"Passed\", numAssertsTested, \"of\", numAsserts, &\n\"possible asserts comprising\", &\nnumTests-numFailures, \"of\", numTests, \"tests.\"\n"</span>
|
366
|
+
<span class="ruby-keyword kw">end</span>
|
367
|
+
|
368
|
+
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\n print *, \"\""</span>
|
369
|
+
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nend program TestRunner"</span>
|
370
|
+
<span class="ruby-identifier">testRunner</span>.<span class="ruby-identifier">close</span>
|
371
|
+
<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>)
|
372
|
+
<span class="ruby-keyword kw">end</span>
|
373
|
+
</pre>
|
374
|
+
</div>
|
375
|
+
</div>
|
376
|
+
</div>
|
377
|
+
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
</div>
|
383
|
+
|
384
|
+
|
385
|
+
<div id="validator-badges">
|
386
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
</body>
|
390
|
+
</html>
|