funit 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/README.txt +5 -4
- data/bin/funit +5 -7
- data/lib/funit.rb +3 -3
- data/lib/funit/functions.rb +5 -10
- data/lib/funit/testsuite.rb +6 -6
- metadata +25 -7
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
=== 0.10.3 / 2009-10-05
|
2
|
+
|
3
|
+
* 1 minor enhancement
|
4
|
+
* Allow --source to accept multiple directories
|
5
|
+
* 1 bug fix
|
6
|
+
* Make funit's setup and teardown subroutine names unique to avoid
|
7
|
+
collision with same routine names in module under test.
|
8
|
+
|
1
9
|
=== 0.10.2 / 2008-03-30
|
2
10
|
|
3
11
|
* 2 bug fixes
|
data/README.txt
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
FUnit
|
1
|
+
= FUnit
|
2
2
|
|
3
3
|
* http://rubyforge.org/projects/nasarb
|
4
|
-
* http://nasarb.rubyforge.org
|
4
|
+
* http://nasarb.rubyforge.org/funit
|
5
|
+
* mailto:nasarb-developers@rubyforge.org
|
5
6
|
|
6
7
|
== DESCRIPTION:
|
7
8
|
|
@@ -112,10 +113,10 @@ rewrote the framework in Ruby[http://www.ruby-lang.org].
|
|
112
113
|
|
113
114
|
== TODO:
|
114
115
|
|
115
|
-
* To avoid Fortran's 32-character limit, don't add test name during translation
|
116
|
+
* To avoid Fortran's 32-character limit, don't add test name during translation
|
117
|
+
or allow another method for naming longer tests altogether.
|
116
118
|
* Add assertions that capture stops, warning messages, and other exits.
|
117
119
|
* For compilation, use internal rake task instead of an external makefile.
|
118
|
-
* Allow users to specify dependency search paths (currently hardwired).
|
119
120
|
* To increase portability, create stand-alone executables with Erik Veenstra's
|
120
121
|
RubyScript2Exe[http://www.erikveen.dds.nl/rubyscript2exe/].
|
121
122
|
* Make FUnit self-tests fail gracefully if Fortran compiler is not found.
|
data/bin/funit
CHANGED
@@ -10,7 +10,7 @@ require 'getoptlong'
|
|
10
10
|
|
11
11
|
include Funit
|
12
12
|
|
13
|
-
|
13
|
+
prog_source_dirs = ['.']
|
14
14
|
|
15
15
|
opts = GetoptLong.new(
|
16
16
|
['--help', '-h', GetoptLong::NO_ARGUMENT],
|
@@ -48,7 +48,9 @@ but for some such as Sun's f95 compiler you will need: -M
|
|
48
48
|
EOF
|
49
49
|
exit
|
50
50
|
end
|
51
|
-
|
51
|
+
prog_source_dirs << arg.split
|
52
|
+
prog_source_dirs.flatten!
|
53
|
+
prog_source_dirs.uniq!
|
52
54
|
end
|
53
55
|
rescue => err
|
54
56
|
puts err
|
@@ -56,11 +58,7 @@ but for some such as Sun's f95 compiler you will need: -M
|
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
59
|
-
|
60
|
-
Funit::run_tests
|
61
|
-
else
|
62
|
-
Funit::run_tests(prog_source_dir)
|
63
|
-
end
|
61
|
+
Funit::run_tests(prog_source_dirs)
|
64
62
|
|
65
63
|
#--
|
66
64
|
# Copyright 2006-2007 United States Government as represented by
|
data/lib/funit.rb
CHANGED
@@ -14,12 +14,12 @@ require 'fileutils'
|
|
14
14
|
|
15
15
|
module Funit
|
16
16
|
|
17
|
-
VERSION = '0.10.
|
17
|
+
VERSION = '0.10.3'
|
18
18
|
|
19
19
|
##
|
20
20
|
# run all tests
|
21
21
|
|
22
|
-
def run_tests(
|
22
|
+
def run_tests(prog_source_dirs=['.'])
|
23
23
|
Compiler.new# a test for compiler env set (FIXME: remove this later)
|
24
24
|
write_test_runner( test_files = parse_command_line )
|
25
25
|
test_suites = []
|
@@ -33,7 +33,7 @@ module Funit
|
|
33
33
|
test_suites.push(ts_name)
|
34
34
|
}
|
35
35
|
}
|
36
|
-
compile_tests(test_suites,
|
36
|
+
compile_tests(test_suites,prog_source_dirs)
|
37
37
|
exit 1 unless system "env PATH='.' TestRunner"
|
38
38
|
end
|
39
39
|
|
data/lib/funit/functions.rb
CHANGED
@@ -111,20 +111,15 @@ module Funit
|
|
111
111
|
$stderr.puts "\n *Warning: #{message} [#{test_suite}.fun:#$.]"
|
112
112
|
end
|
113
113
|
|
114
|
-
def compile_tests(test_suites,
|
114
|
+
def compile_tests(test_suites,prog_source_dirs=['.'])
|
115
115
|
puts "computing dependencies"
|
116
116
|
|
117
|
-
|
118
|
-
if
|
119
|
-
sourceflag =
|
120
|
-
else
|
121
|
-
# prog_source_dir = File.expand_path(prog_source_dir) # commented as it doesn't seem necessary
|
122
|
-
sourceflag = " "+ ENV['FSFLAG'] + prog_source_dir
|
117
|
+
sourceflag = ''
|
118
|
+
if ENV['FSFLAG'] then
|
119
|
+
sourceflag = prog_source_dirs.map{|pd| ENV['FSFLAG']+pd }.join(' ')
|
123
120
|
end
|
124
|
-
|
125
|
-
sp = ['.'] + (prog_source_dir.empty? ? [] : [prog_source_dir])
|
121
|
+
dependencies = Fortran::Dependencies.new(:search_paths=>prog_source_dirs)
|
126
122
|
|
127
|
-
dependencies = Fortran::Dependencies.new(:search_paths=> sp)
|
128
123
|
puts "locating associated source files and sorting for compilation"
|
129
124
|
dependencies.source_file_dependencies('TestRunner.f90')
|
130
125
|
file_dependencies = dependencies.file_dependencies
|
data/lib/funit/testsuite.rb
CHANGED
@@ -138,14 +138,14 @@ module #{@suite_name}_fun
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def close
|
141
|
-
puts "\n subroutine
|
141
|
+
puts "\n subroutine funit_setup"
|
142
142
|
puts @setup
|
143
143
|
puts " noAssertFailed = .true."
|
144
|
-
puts " end subroutine
|
144
|
+
puts " end subroutine funit_setup\n\n"
|
145
145
|
|
146
|
-
puts "\n subroutine
|
146
|
+
puts "\n subroutine funit_teardown"
|
147
147
|
puts @teardown
|
148
|
-
puts " end subroutine
|
148
|
+
puts " end subroutine funit_teardown\n\n"
|
149
149
|
|
150
150
|
puts <<-NEXTONE
|
151
151
|
|
@@ -160,9 +160,9 @@ module #{@suite_name}_fun
|
|
160
160
|
NEXTONE
|
161
161
|
|
162
162
|
@tests.each do |test_name|
|
163
|
-
puts "\n call
|
163
|
+
puts "\n call funit_setup"
|
164
164
|
puts " call #{test_name}"
|
165
|
-
puts " call
|
165
|
+
puts " call funit_teardown"
|
166
166
|
end
|
167
167
|
|
168
168
|
puts <<-LASTONE
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: funit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karen Bibb
|
@@ -13,11 +13,12 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date:
|
16
|
+
date: 2009-10-05 00:00:00 -04:00
|
17
17
|
default_executable:
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: fortran
|
21
|
+
type: :runtime
|
21
22
|
version_requirement:
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
@@ -27,14 +28,29 @@ dependencies:
|
|
27
28
|
version:
|
28
29
|
- !ruby/object:Gem::Dependency
|
29
30
|
name: hoe
|
31
|
+
type: :development
|
30
32
|
version_requirement:
|
31
33
|
version_requirements: !ruby/object:Gem::Requirement
|
32
34
|
requirements:
|
33
35
|
- - ">="
|
34
36
|
- !ruby/object:Gem::Version
|
35
|
-
version: 1.
|
37
|
+
version: 1.12.2
|
36
38
|
version:
|
37
|
-
description:
|
39
|
+
description: |-
|
40
|
+
FUnit is a unit testing framework for Fortran.
|
41
|
+
|
42
|
+
Unit tests are written as Fortran fragments that use a small
|
43
|
+
set of testing-specific keywords and functions. FUnit transforms
|
44
|
+
these fragments into valid Fortran code, compiles, links, and
|
45
|
+
runs them against the code under test.
|
46
|
+
|
47
|
+
FUnit is {opinionated software}[http://www.oreillynet.com/pub/a/network/2005/08/30/ruby-rails-david-heinemeier-hansson.html], which values convention over
|
48
|
+
configuration. Specifically, FUnit,
|
49
|
+
|
50
|
+
* requires a Fortran 95 compiler,
|
51
|
+
* only supports testing routines contained in modules,
|
52
|
+
* requires tests to be stored along side the code under test, and
|
53
|
+
* requires test files to be named appropriately.
|
38
54
|
email: nasarb-developers@rubyforge.org
|
39
55
|
executables:
|
40
56
|
- funit
|
@@ -75,7 +91,9 @@ files:
|
|
75
91
|
- utils/funit-generic-mode.el
|
76
92
|
- utils/funit-mode.el
|
77
93
|
has_rdoc: true
|
78
|
-
homepage:
|
94
|
+
homepage: http://rubyforge.org/projects/nasarb
|
95
|
+
licenses: []
|
96
|
+
|
79
97
|
post_install_message:
|
80
98
|
rdoc_options:
|
81
99
|
- --main
|
@@ -97,9 +115,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
115
|
requirements:
|
98
116
|
- A Fortran compiler.
|
99
117
|
rubyforge_project: nasarb
|
100
|
-
rubygems_version: 1.
|
118
|
+
rubygems_version: 1.3.3
|
101
119
|
signing_key:
|
102
|
-
specification_version:
|
120
|
+
specification_version: 3
|
103
121
|
summary: FUnit is a unit testing framework for Fortran
|
104
122
|
test_files:
|
105
123
|
- test/test_compiler.rb
|