fUnit 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tc_funit'
4
+ require 'tc_compile'
5
+ require 'tc_test_suite'
6
+ require 'tc_fortran_deps'
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: []