fUnit 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL +19 -0
- data/LICENSE +262 -0
- data/README +3 -0
- data/bin/funit +8 -0
- data/docs/HISTORY +20 -0
- data/docs/spiel/slides.tex +153 -0
- data/docs/why/F90testRun +43 -0
- data/docs/why/F90testRun.ps +548 -0
- data/docs/why/FluxFunctions.f90 +36 -0
- data/docs/why/FluxFunctions.f90.ps +526 -0
- data/docs/why/FluxFunctionsTS.f90 +324 -0
- data/docs/why/FluxFunctionsTS.f90.ps +1048 -0
- data/docs/why/FluxFunctionsTS.ftk +49 -0
- data/docs/why/FluxFunctionsTS.ftk.ps +554 -0
- data/docs/why/GasModel.f90 +19 -0
- data/docs/why/GasModel.f90.ps +496 -0
- data/docs/why/GasModelTS+SRC +44 -0
- data/docs/why/GasModelTS+SRC.ps +532 -0
- data/docs/why/GasModelTS.f90 +168 -0
- data/docs/why/GasModelTS.f90.ps +760 -0
- data/docs/why/GasModelTS.ftk +22 -0
- data/docs/why/GasModelTS.ftk.ps +507 -0
- data/docs/why/TestRunner.f90 +28 -0
- data/docs/why/TestRunner.f90.ps +511 -0
- data/docs/why/land2 +2 -0
- data/docs/why/landscape +2 -0
- data/docs/why/portrait +2 -0
- data/lib/clean +1 -0
- data/lib/fortran_deps.rb +109 -0
- data/lib/funit/assertions.rb +72 -0
- data/lib/funit/functions.rb +124 -0
- data/lib/funit/test_suite.rb +180 -0
- data/lib/funit.rb +25 -0
- data/lib/mklinks +5 -0
- data/tests/tc_compile.rb +30 -0
- data/tests/tc_fortran_deps.rb +167 -0
- data/tests/tc_funit.rb +104 -0
- data/tests/tc_test_suite.rb +82 -0
- data/tests/ts_funit.rb +6 -0
- metadata +85 -0
@@ -0,0 +1,82 @@
|
|
1
|
+
$:.unshift File.join( File.dirname(__FILE__), '..', 'lib' )
|
2
|
+
require 'test/unit'
|
3
|
+
require 'funit/test_suite'
|
4
|
+
|
5
|
+
class TestTestSuite < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
File.rm_f(*Dir["dummyf90test*"])
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_nonexistent_FTK_file_is_not_created
|
12
|
+
Funit::TestSuite.new 'dummyf90test'
|
13
|
+
assert !File.exists?("dummyf90testMT.ftk")
|
14
|
+
assert !File.exists?("dummyf90testMT.f90")
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_FTK_file ftkContents
|
18
|
+
File.open('dummyf90test.f90','w') do |f|
|
19
|
+
f.puts "module dummyf90test\nend module dummyf90test"
|
20
|
+
end
|
21
|
+
File.open('dummyf90testMT.ftk','w') do |f|
|
22
|
+
f.puts ftkContents
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
@@compileCommand = "#{Funit::Compiler.new.name} -c dummyf90test.f90 dummyf90testMT.f90"
|
27
|
+
|
28
|
+
def test_bare_minimum_FTK_file_compiles
|
29
|
+
create_FTK_file ""
|
30
|
+
Funit::TestSuite.new 'dummyf90test'
|
31
|
+
assert system(@@compileCommand)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_module_variables_allowed
|
35
|
+
create_FTK_file "integer :: a"
|
36
|
+
Funit::TestSuite.new 'dummyf90test'
|
37
|
+
assert system(@@compileCommand)
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_blank_setup_compiles
|
41
|
+
create_FTK_file "beginSetup\nendSetup"
|
42
|
+
Funit::TestSuite.new 'dummyf90test'
|
43
|
+
assert system(@@compileCommand)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_blank_test_gives_warning
|
47
|
+
create_FTK_file "beginTest bob\nendTest"
|
48
|
+
Funit::TestSuite.new 'dummyf90test'
|
49
|
+
assert system(@@compileCommand)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_single_assert_test_compiles
|
53
|
+
create_FTK_file "beginTest assertTrue\nIsTrue(.true.)\nendTest"
|
54
|
+
Funit::TestSuite.new 'dummyf90test'
|
55
|
+
assert system(@@compileCommand)
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_matrix_assert_compiles
|
59
|
+
create_FTK_file <<-MATFTK
|
60
|
+
beginTest assertTrue
|
61
|
+
integer :: a(2,2)
|
62
|
+
a = 1
|
63
|
+
IsEqual(a(1,1),1)
|
64
|
+
endTest
|
65
|
+
MATFTK
|
66
|
+
Funit::TestSuite.new 'dummyf90test'
|
67
|
+
puts `cat dummyf90testMT.ftk`
|
68
|
+
puts `cat dummyf90testMT.f90`
|
69
|
+
assert system(@@compileCommand)
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_ignore_commented_test
|
73
|
+
create_FTK_file "XbeginTest bob\nendTest"
|
74
|
+
Funit::TestSuite.new 'dummyf90test'
|
75
|
+
assert_no_match( /Testbob/i, IO.readlines('dummyf90testMT.f90').join )
|
76
|
+
end
|
77
|
+
|
78
|
+
def teardown
|
79
|
+
File.rm_f(*Dir["dummyf90test*"])
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
data/tests/ts_funit.rb
ADDED
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.8.11
|
3
|
+
specification_version: 1
|
4
|
+
name: fUnit
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2006-04-05 00:00:00 -04:00
|
8
|
+
summary: A Fortran Unit Testing Framework
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: funit-support@rubyforge.org
|
12
|
+
homepage: http://funit.rubyforge.org/
|
13
|
+
rubyforge_project: funit
|
14
|
+
description:
|
15
|
+
autorequire: funit
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
-
|
22
|
+
- ">"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.0.0
|
25
|
+
version:
|
26
|
+
platform: ruby
|
27
|
+
signing_key:
|
28
|
+
cert_chain:
|
29
|
+
authors:
|
30
|
+
- fUnit Team
|
31
|
+
files:
|
32
|
+
- bin/funit
|
33
|
+
- tests/tc_compile.rb
|
34
|
+
- tests/tc_fortran_deps.rb
|
35
|
+
- tests/tc_funit.rb
|
36
|
+
- tests/tc_test_suite.rb
|
37
|
+
- tests/ts_funit.rb
|
38
|
+
- lib/clean
|
39
|
+
- lib/fortran_deps.rb
|
40
|
+
- lib/funit
|
41
|
+
- lib/funit.rb
|
42
|
+
- lib/mklinks
|
43
|
+
- lib/funit/assertions.rb
|
44
|
+
- lib/funit/functions.rb
|
45
|
+
- lib/funit/test_suite.rb
|
46
|
+
- docs/HISTORY
|
47
|
+
- docs/spiel
|
48
|
+
- docs/why
|
49
|
+
- docs/spiel/slides.tex
|
50
|
+
- docs/why/F90testRun
|
51
|
+
- docs/why/F90testRun.ps
|
52
|
+
- docs/why/FluxFunctions.f90
|
53
|
+
- docs/why/FluxFunctions.f90.ps
|
54
|
+
- docs/why/FluxFunctionsTS.f90
|
55
|
+
- docs/why/FluxFunctionsTS.f90.ps
|
56
|
+
- docs/why/FluxFunctionsTS.ftk
|
57
|
+
- docs/why/FluxFunctionsTS.ftk.ps
|
58
|
+
- docs/why/GasModel.f90
|
59
|
+
- docs/why/GasModel.f90.ps
|
60
|
+
- docs/why/GasModelTS+SRC
|
61
|
+
- docs/why/GasModelTS+SRC.ps
|
62
|
+
- docs/why/GasModelTS.f90
|
63
|
+
- docs/why/GasModelTS.f90.ps
|
64
|
+
- docs/why/GasModelTS.ftk
|
65
|
+
- docs/why/GasModelTS.ftk.ps
|
66
|
+
- docs/why/land2
|
67
|
+
- docs/why/landscape
|
68
|
+
- docs/why/portrait
|
69
|
+
- docs/why/TestRunner.f90
|
70
|
+
- docs/why/TestRunner.f90.ps
|
71
|
+
- README
|
72
|
+
- LICENSE
|
73
|
+
- INSTALL
|
74
|
+
test_files:
|
75
|
+
- tests/ts_funit.rb
|
76
|
+
rdoc_options: []
|
77
|
+
extra_rdoc_files:
|
78
|
+
- README
|
79
|
+
- LICENSE
|
80
|
+
- INSTALL
|
81
|
+
executables:
|
82
|
+
- funit
|
83
|
+
extensions: []
|
84
|
+
requirements: []
|
85
|
+
dependencies: []
|