jimweirich-rake 0.8.1.5

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.
Files changed (94) hide show
  1. data/CHANGES +364 -0
  2. data/MIT-LICENSE +21 -0
  3. data/README +242 -0
  4. data/Rakefile +413 -0
  5. data/TODO +20 -0
  6. data/bin/rake +31 -0
  7. data/doc/example/Rakefile1 +38 -0
  8. data/doc/example/Rakefile2 +35 -0
  9. data/doc/example/a.c +6 -0
  10. data/doc/example/b.c +6 -0
  11. data/doc/example/main.c +11 -0
  12. data/doc/glossary.rdoc +51 -0
  13. data/doc/jamis.rb +591 -0
  14. data/doc/proto_rake.rdoc +127 -0
  15. data/doc/rake.1.gz +0 -0
  16. data/doc/rakefile.rdoc +411 -0
  17. data/doc/rational.rdoc +151 -0
  18. data/doc/release_notes/rake-0.4.14.rdoc +23 -0
  19. data/doc/release_notes/rake-0.4.15.rdoc +35 -0
  20. data/doc/release_notes/rake-0.5.0.rdoc +53 -0
  21. data/doc/release_notes/rake-0.5.3.rdoc +78 -0
  22. data/doc/release_notes/rake-0.5.4.rdoc +46 -0
  23. data/doc/release_notes/rake-0.6.0.rdoc +141 -0
  24. data/doc/release_notes/rake-0.7.0.rdoc +119 -0
  25. data/doc/release_notes/rake-0.7.1.rdoc +59 -0
  26. data/doc/release_notes/rake-0.7.2.rdoc +121 -0
  27. data/doc/release_notes/rake-0.7.3.rdoc +47 -0
  28. data/doc/release_notes/rake-0.8.0.rdoc +114 -0
  29. data/install.rb +88 -0
  30. data/lib/rake/classic_namespace.rb +8 -0
  31. data/lib/rake/clean.rb +33 -0
  32. data/lib/rake/contrib/compositepublisher.rb +24 -0
  33. data/lib/rake/contrib/ftptools.rb +153 -0
  34. data/lib/rake/contrib/publisher.rb +75 -0
  35. data/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  36. data/lib/rake/contrib/sshpublisher.rb +47 -0
  37. data/lib/rake/contrib/sys.rb +209 -0
  38. data/lib/rake/gempackagetask.rb +103 -0
  39. data/lib/rake/loaders/makefile.rb +40 -0
  40. data/lib/rake/packagetask.rb +184 -0
  41. data/lib/rake/rake_test_loader.rb +5 -0
  42. data/lib/rake/rdoctask.rb +147 -0
  43. data/lib/rake/ruby182_test_unit_fix.rb +23 -0
  44. data/lib/rake/runtest.rb +23 -0
  45. data/lib/rake/tasklib.rb +18 -0
  46. data/lib/rake/testtask.rb +161 -0
  47. data/lib/rake.rb +2312 -0
  48. data/test/capture_stdout.rb +26 -0
  49. data/test/contrib/testsys.rb +47 -0
  50. data/test/data/chains/Rakefile +15 -0
  51. data/test/data/default/Rakefile +19 -0
  52. data/test/data/dryrun/Rakefile +22 -0
  53. data/test/data/file_creation_task/Rakefile +30 -0
  54. data/test/data/imports/Rakefile +19 -0
  55. data/test/data/imports/deps.mf +1 -0
  56. data/test/data/multidesc/Rakefile +17 -0
  57. data/test/data/namespace/Rakefile +57 -0
  58. data/test/data/rakelib/test1.rb +3 -0
  59. data/test/data/rbext/rakefile.rb +3 -0
  60. data/test/data/sample.mf +9 -0
  61. data/test/data/statusreturn/Rakefile +8 -0
  62. data/test/data/unittest/Rakefile +1 -0
  63. data/test/filecreation.rb +32 -0
  64. data/test/functional.rb +15 -0
  65. data/test/rake_test_setup.rb +5 -0
  66. data/test/reqfile.rb +3 -0
  67. data/test/reqfile2.rb +3 -0
  68. data/test/session_functional.rb +267 -0
  69. data/test/shellcommand.rb +3 -0
  70. data/test/test_application.rb +504 -0
  71. data/test/test_clean.rb +14 -0
  72. data/test/test_definitions.rb +82 -0
  73. data/test/test_earlytime.rb +35 -0
  74. data/test/test_extension.rb +63 -0
  75. data/test/test_file_creation_task.rb +62 -0
  76. data/test/test_file_task.rb +139 -0
  77. data/test/test_filelist.rb +618 -0
  78. data/test/test_fileutils.rb +239 -0
  79. data/test/test_ftp.rb +59 -0
  80. data/test/test_invocation_chain.rb +75 -0
  81. data/test/test_makefile_loader.rb +23 -0
  82. data/test/test_multitask.rb +45 -0
  83. data/test/test_namespace.rb +36 -0
  84. data/test/test_package_task.rb +116 -0
  85. data/test/test_pathmap.rb +209 -0
  86. data/test/test_rake.rb +34 -0
  87. data/test/test_require.rb +33 -0
  88. data/test/test_rules.rb +347 -0
  89. data/test/test_task_arguments.rb +76 -0
  90. data/test/test_task_manager.rb +148 -0
  91. data/test/test_tasks.rb +372 -0
  92. data/test/test_test_task.rb +75 -0
  93. data/test/test_top_level_functions.rb +84 -0
  94. metadata +173 -0
@@ -0,0 +1,23 @@
1
+ module Test
2
+ module Unit
3
+ module Collector
4
+ class Dir
5
+ undef collect_file
6
+ def collect_file(name, suites, already_gathered)
7
+ # loadpath = $:.dup
8
+ dir = File.dirname(File.expand_path(name))
9
+ $:.unshift(dir) unless $:.first == dir
10
+ if(@req)
11
+ @req.require(name)
12
+ else
13
+ require(name)
14
+ end
15
+ find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
16
+ ensure
17
+ # $:.replace(loadpath)
18
+ $:.delete_at $:.rindex(dir)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'test/unit/assertions'
5
+
6
+ module Rake
7
+ include Test::Unit::Assertions
8
+
9
+ def run_tests(pattern='test/test*.rb', log_enabled=false)
10
+ Dir["#{pattern}"].each { |fn|
11
+ puts fn if log_enabled
12
+ begin
13
+ load fn
14
+ rescue Exception => ex
15
+ puts "Error in #{fn}: #{ex.message}"
16
+ puts ex.backtrace
17
+ assert false
18
+ end
19
+ }
20
+ end
21
+
22
+ extend self
23
+ end
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rake'
4
+
5
+ module Rake
6
+
7
+ # Base class for Task Libraries.
8
+ class TaskLib
9
+
10
+ include Cloneable
11
+
12
+ # Make a symbol by pasting two strings together.
13
+ def paste(a,b)
14
+ (a.to_s + b.to_s).intern
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,161 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Define a task library for running unit tests.
4
+
5
+ require 'rake'
6
+ require 'rake/tasklib'
7
+
8
+ module Rake
9
+
10
+ # Create a task that runs a set of tests.
11
+ #
12
+ # Example:
13
+ #
14
+ # Rake::TestTask.new do |t|
15
+ # t.libs << "test"
16
+ # t.test_files = FileList['test/test*.rb']
17
+ # t.verbose = true
18
+ # end
19
+ #
20
+ # If rake is invoked with a "TEST=filename" command line option,
21
+ # then the list of test files will be overridden to include only the
22
+ # filename specified on the command line. This provides an easy way
23
+ # to run just one test.
24
+ #
25
+ # If rake is invoked with a "TESTOPTS=options" command line option,
26
+ # then the given options are passed to the test process after a
27
+ # '--'. This allows Test::Unit options to be passed to the test
28
+ # suite.
29
+ #
30
+ # Examples:
31
+ #
32
+ # rake test # run tests normally
33
+ # rake test TEST=just_one_file.rb # run just one test file.
34
+ # rake test TESTOPTS="-v" # run in verbose mode
35
+ # rake test TESTOPTS="--runner=fox" # use the fox test runner
36
+ #
37
+ class TestTask < TaskLib
38
+
39
+ # Name of test task. (default is :test)
40
+ attr_accessor :name
41
+
42
+ # List of directories to added to $LOAD_PATH before running the
43
+ # tests. (default is 'lib')
44
+ attr_accessor :libs
45
+
46
+ # True if verbose test output desired. (default is false)
47
+ attr_accessor :verbose
48
+
49
+ # Test options passed to the test suite. An explicit
50
+ # TESTOPTS=opts on the command line will override this. (default
51
+ # is NONE)
52
+ attr_accessor :options
53
+
54
+ # Request that the tests be run with the warning flag set.
55
+ # E.g. warning=true implies "ruby -w" used to run the tests.
56
+ attr_accessor :warning
57
+
58
+ # Glob pattern to match test files. (default is 'test/test*.rb')
59
+ attr_accessor :pattern
60
+
61
+ # Style of test loader to use. Options are:
62
+ #
63
+ # * :rake -- Rake provided test loading script (default).
64
+ # * :testrb -- Ruby provided test loading script.
65
+ # * :direct -- Load tests using command line loader.
66
+ #
67
+ attr_accessor :loader
68
+
69
+ # Array of commandline options to pass to ruby when running test loader.
70
+ attr_accessor :ruby_opts
71
+
72
+ # Explicitly define the list of test files to be included in a
73
+ # test. +list+ is expected to be an array of file names (a
74
+ # FileList is acceptable). If both +pattern+ and +test_files+ are
75
+ # used, then the list of test files is the union of the two.
76
+ def test_files=(list)
77
+ @test_files = list
78
+ end
79
+
80
+ # Create a testing task.
81
+ def initialize(name=:test)
82
+ @name = name
83
+ @libs = ["lib"]
84
+ @pattern = nil
85
+ @options = nil
86
+ @test_files = nil
87
+ @verbose = false
88
+ @warning = false
89
+ @loader = :rake
90
+ @ruby_opts = []
91
+ yield self if block_given?
92
+ @pattern = 'test/test*.rb' if @pattern.nil? && @test_files.nil?
93
+ define
94
+ end
95
+
96
+ # Create the tasks defined by this task lib.
97
+ def define
98
+ lib_path = @libs.join(File::PATH_SEPARATOR)
99
+ desc "Run tests" + (@name==:test ? "" : " for #{@name}")
100
+ task @name do
101
+ run_code = ''
102
+ RakeFileUtils.verbose(@verbose) do
103
+ run_code =
104
+ case @loader
105
+ when :direct
106
+ "-e 'ARGV.each{|f| load f}'"
107
+ when :testrb
108
+ "-S testrb #{fix}"
109
+ when :rake
110
+ rake_loader
111
+ end
112
+ @ruby_opts.unshift( "-I#{lib_path}" )
113
+ @ruby_opts.unshift( "-w" ) if @warning
114
+ ruby @ruby_opts.join(" ") +
115
+ " \"#{run_code}\" " +
116
+ file_list.collect { |fn| "\"#{fn}\"" }.join(' ') +
117
+ " #{option_list}"
118
+ end
119
+ end
120
+ self
121
+ end
122
+
123
+ def option_list # :nodoc:
124
+ ENV['TESTOPTS'] || @options || ""
125
+ end
126
+
127
+ def file_list # :nodoc:
128
+ if ENV['TEST']
129
+ FileList[ ENV['TEST'] ]
130
+ else
131
+ result = []
132
+ result += @test_files.to_a if @test_files
133
+ result += FileList[ @pattern ].to_a if @pattern
134
+ FileList[result]
135
+ end
136
+ end
137
+
138
+ def fix # :nodoc:
139
+ case RUBY_VERSION
140
+ when '1.8.2'
141
+ find_file 'rake/ruby182_test_unit_fix'
142
+ else
143
+ nil
144
+ end || ''
145
+ end
146
+
147
+ def rake_loader # :nodoc:
148
+ find_file('rake/rake_test_loader') or
149
+ fail "unable to find rake test loader"
150
+ end
151
+
152
+ def find_file(fn) # :nodoc:
153
+ $LOAD_PATH.each do |path|
154
+ file_path = File.join(path, "#{fn}.rb")
155
+ return file_path if File.exist? file_path
156
+ end
157
+ nil
158
+ end
159
+
160
+ end
161
+ end