rake 10.4.2 → 13.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +5 -5
  2. data/CONTRIBUTING.rdoc +16 -7
  3. data/Gemfile +10 -0
  4. data/History.rdoc +2022 -287
  5. data/README.rdoc +40 -25
  6. data/Rakefile +25 -65
  7. data/bin/bundle +105 -0
  8. data/bin/console +7 -0
  9. data/bin/rake +20 -24
  10. data/bin/rdoc +29 -0
  11. data/bin/rubocop +29 -0
  12. data/bin/setup +6 -0
  13. data/doc/glossary.rdoc +10 -11
  14. data/doc/jamis.rb +1 -0
  15. data/doc/rake.1 +139 -124
  16. data/doc/rakefile.rdoc +2 -33
  17. data/exe/rake +27 -0
  18. data/lib/rake.rb +35 -43
  19. data/lib/rake/application.rb +125 -91
  20. data/lib/rake/backtrace.rb +3 -2
  21. data/lib/rake/clean.rb +8 -6
  22. data/lib/rake/cloneable.rb +1 -0
  23. data/lib/rake/cpu_counter.rb +10 -28
  24. data/lib/rake/default_loader.rb +1 -0
  25. data/lib/rake/dsl_definition.rb +6 -12
  26. data/lib/rake/early_time.rb +1 -0
  27. data/lib/rake/ext/core.rb +1 -0
  28. data/lib/rake/ext/string.rb +24 -21
  29. data/lib/rake/file_creation_task.rb +4 -3
  30. data/lib/rake/file_list.rb +35 -28
  31. data/lib/rake/file_task.rb +12 -4
  32. data/lib/rake/file_utils.rb +38 -32
  33. data/lib/rake/file_utils_ext.rb +8 -18
  34. data/lib/rake/invocation_chain.rb +1 -0
  35. data/lib/rake/invocation_exception_mixin.rb +1 -0
  36. data/lib/rake/late_time.rb +2 -1
  37. data/lib/rake/linked_list.rb +24 -15
  38. data/lib/rake/loaders/makefile.rb +23 -9
  39. data/lib/rake/multi_task.rb +2 -1
  40. data/lib/rake/name_space.rb +1 -1
  41. data/lib/rake/packagetask.rb +40 -17
  42. data/lib/rake/phony.rb +2 -1
  43. data/lib/rake/private_reader.rb +1 -0
  44. data/lib/rake/promise.rb +13 -12
  45. data/lib/rake/pseudo_status.rb +1 -0
  46. data/lib/rake/rake_module.rb +30 -1
  47. data/lib/rake/rake_test_loader.rb +18 -13
  48. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  49. data/lib/rake/scope.rb +3 -2
  50. data/lib/rake/task.rb +82 -31
  51. data/lib/rake/task_argument_error.rb +1 -0
  52. data/lib/rake/task_arguments.rb +15 -4
  53. data/lib/rake/task_manager.rb +54 -33
  54. data/lib/rake/tasklib.rb +2 -14
  55. data/lib/rake/testtask.rb +40 -63
  56. data/lib/rake/thread_history_display.rb +4 -3
  57. data/lib/rake/thread_pool.rb +16 -17
  58. data/lib/rake/trace_output.rb +2 -1
  59. data/lib/rake/version.rb +4 -1
  60. data/lib/rake/win32.rb +10 -15
  61. data/rake.gemspec +43 -0
  62. metadata +33 -270
  63. data/.autotest +0 -7
  64. data/.gemtest +0 -0
  65. data/.rubocop.yml +0 -27
  66. data/.togglerc +0 -7
  67. data/Manifest.txt +0 -166
  68. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  69. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  70. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  71. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  72. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  73. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  74. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  75. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  76. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  77. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  78. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  79. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  80. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  81. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  82. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  83. data/doc/release_notes/rake-0.8.6.rdoc +0 -37
  84. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  85. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  86. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  87. data/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
  88. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  89. data/doc/release_notes/rake-0.9.3.rdoc +0 -102
  90. data/doc/release_notes/rake-0.9.4.rdoc +0 -60
  91. data/doc/release_notes/rake-0.9.5.rdoc +0 -55
  92. data/doc/release_notes/rake-0.9.6.rdoc +0 -64
  93. data/doc/release_notes/rake-10.0.0.rdoc +0 -178
  94. data/doc/release_notes/rake-10.0.1.rdoc +0 -58
  95. data/doc/release_notes/rake-10.0.2.rdoc +0 -53
  96. data/doc/release_notes/rake-10.0.3.rdoc +0 -191
  97. data/doc/release_notes/rake-10.1.0.rdoc +0 -61
  98. data/lib/rake/alt_system.rb +0 -110
  99. data/lib/rake/contrib/.document +0 -1
  100. data/lib/rake/contrib/compositepublisher.rb +0 -21
  101. data/lib/rake/contrib/ftptools.rb +0 -137
  102. data/lib/rake/contrib/publisher.rb +0 -81
  103. data/lib/rake/contrib/rubyforgepublisher.rb +0 -18
  104. data/lib/rake/contrib/sshpublisher.rb +0 -61
  105. data/lib/rake/contrib/sys.rb +0 -4
  106. data/lib/rake/ext/module.rb +0 -2
  107. data/lib/rake/ext/pathname.rb +0 -25
  108. data/lib/rake/ext/time.rb +0 -16
  109. data/lib/rake/gempackagetask.rb +0 -4
  110. data/lib/rake/pathmap.rb +0 -3
  111. data/lib/rake/rdoctask.rb +0 -4
  112. data/lib/rake/ruby182_test_unit_fix.rb +0 -29
  113. data/lib/rake/runtest.rb +0 -27
  114. data/rakelib/publish.rake +0 -20
  115. data/rakelib/test_times.rake +0 -25
  116. data/test/file_creation.rb +0 -34
  117. data/test/helper.rb +0 -130
  118. data/test/support/rakefile_definitions.rb +0 -478
  119. data/test/support/ruby_runner.rb +0 -34
  120. data/test/test_private_reader.rb +0 -42
  121. data/test/test_rake.rb +0 -40
  122. data/test/test_rake_application.rb +0 -643
  123. data/test/test_rake_application_options.rb +0 -466
  124. data/test/test_rake_backtrace.rb +0 -119
  125. data/test/test_rake_clean.rb +0 -61
  126. data/test/test_rake_cpu_counter.rb +0 -68
  127. data/test/test_rake_definitions.rb +0 -84
  128. data/test/test_rake_directory_task.rb +0 -76
  129. data/test/test_rake_dsl.rb +0 -40
  130. data/test/test_rake_early_time.rb +0 -31
  131. data/test/test_rake_extension.rb +0 -59
  132. data/test/test_rake_file_creation_task.rb +0 -56
  133. data/test/test_rake_file_list.rb +0 -655
  134. data/test/test_rake_file_list_path_map.rb +0 -8
  135. data/test/test_rake_file_task.rb +0 -197
  136. data/test/test_rake_file_utils.rb +0 -309
  137. data/test/test_rake_ftp_file.rb +0 -74
  138. data/test/test_rake_functional.rb +0 -482
  139. data/test/test_rake_invocation_chain.rb +0 -64
  140. data/test/test_rake_late_time.rb +0 -18
  141. data/test/test_rake_linked_list.rb +0 -84
  142. data/test/test_rake_makefile_loader.rb +0 -46
  143. data/test/test_rake_multi_task.rb +0 -64
  144. data/test/test_rake_name_space.rb +0 -57
  145. data/test/test_rake_package_task.rb +0 -79
  146. data/test/test_rake_path_map.rb +0 -168
  147. data/test/test_rake_path_map_explode.rb +0 -34
  148. data/test/test_rake_path_map_partial.rb +0 -18
  149. data/test/test_rake_pathname_extensions.rb +0 -15
  150. data/test/test_rake_pseudo_status.rb +0 -21
  151. data/test/test_rake_rake_test_loader.rb +0 -20
  152. data/test/test_rake_reduce_compat.rb +0 -26
  153. data/test/test_rake_require.rb +0 -40
  154. data/test/test_rake_rules.rb +0 -388
  155. data/test/test_rake_scope.rb +0 -44
  156. data/test/test_rake_task.rb +0 -393
  157. data/test/test_rake_task_argument_parsing.rb +0 -119
  158. data/test/test_rake_task_arguments.rb +0 -127
  159. data/test/test_rake_task_lib.rb +0 -9
  160. data/test/test_rake_task_manager.rb +0 -178
  161. data/test/test_rake_task_manager_argument_resolution.rb +0 -19
  162. data/test/test_rake_task_with_arguments.rb +0 -172
  163. data/test/test_rake_test_task.rb +0 -146
  164. data/test/test_rake_thread_pool.rb +0 -145
  165. data/test/test_rake_top_level_functions.rb +0 -71
  166. data/test/test_rake_win32.rb +0 -72
  167. data/test/test_thread_history_display.rb +0 -101
  168. data/test/test_trace_output.rb +0 -52
@@ -1,74 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
- require 'date'
3
- require 'time'
4
- require 'rake/contrib/ftptools'
5
-
6
- class FakeDate
7
- def self.today
8
- Date.new(2003, 10, 3)
9
- end
10
-
11
- def self.now
12
- Time.local(2003, 10, 3, 12, 00, 00)
13
- end
14
- end
15
-
16
- class TestRakeFtpFile < Rake::TestCase
17
-
18
- def setup
19
- super
20
-
21
- Rake::FtpFile.class_eval {
22
- @date_class = FakeDate
23
- @time_class = FakeDate
24
- }
25
- end
26
-
27
- def test_general
28
- file = Rake::FtpFile.new(
29
- "here",
30
- "-rw-r--r-- 1 a279376 develop 121770 Mar 6 14:50 wiki.pl")
31
- assert_equal "wiki.pl", file.name
32
- assert_equal "here/wiki.pl", file.path
33
- assert_equal "a279376", file.owner
34
- assert_equal "develop", file.group
35
- assert_equal 0644, file.mode
36
- assert_equal 121_770, file.size
37
- assert_equal Time.mktime(2003, 3, 6, 14, 50, 0, 0), file.time
38
- assert ! file.directory?
39
- assert ! file.symlink?
40
- end
41
-
42
- def test_far_date
43
- file = Rake::FtpFile.new(
44
- ".",
45
- "drwxr-xr-x 3 a279376 develop 4096 Nov 26 2001 vss")
46
- assert_equal Time.mktime(2001, 11, 26, 0, 0, 0, 0), file.time
47
- end
48
-
49
- def test_close_date
50
- file = Rake::FtpFile.new(
51
- ".",
52
- "drwxr-xr-x 3 a279376 develop 4096 Nov 26 15:35 vss")
53
- assert_equal Time.mktime(2002, 11, 26, 15, 35, 0, 0), file.time
54
- end
55
-
56
- def test_directory
57
- file = Rake::FtpFile.new(
58
- ".",
59
- "drwxrwxr-x 9 a279376 develop 4096 Mar 13 14:32 working")
60
- assert file.directory?
61
- assert !file.symlink?
62
- end
63
-
64
- def test_symlink
65
- file = Rake::FtpFile.new(
66
- ".",
67
- "lrwxrwxrwx 1 a279376 develop 64 Mar 26 2002 " +
68
- "xtrac -> /home/a279376/working/ics/development/java/" +
69
- "com/fmr/fwp/ics/xtrac")
70
- assert_equal 'xtrac', file.name
71
- assert file.symlink?
72
- assert !file.directory?
73
- end
74
- end
@@ -1,482 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
- require 'fileutils'
3
- require 'open3'
4
-
5
- class TestRakeFunctional < Rake::TestCase
6
- include RubyRunner
7
-
8
- def setup
9
- super
10
-
11
- if @verbose
12
- puts
13
- puts
14
- puts '-' * 80
15
- puts @__name__
16
- puts '-' * 80
17
- end
18
- end
19
-
20
- def test_rake_default
21
- rakefile_default
22
-
23
- rake
24
-
25
- assert_match(/^DEFAULT$/, @out)
26
- end
27
-
28
- def test_rake_error_on_bad_task
29
- rakefile_default
30
-
31
- rake '-t', 'xyz'
32
-
33
- assert_match(/rake aborted/, @err)
34
- end
35
-
36
- def test_env_available_at_top_scope
37
- rakefile_default
38
-
39
- rake "TESTTOPSCOPE=1"
40
-
41
- assert_match(/^TOPSCOPE$/, @out)
42
- end
43
-
44
- def test_env_available_at_task_scope
45
- rakefile_default
46
-
47
- rake 'TESTTASKSCOPE=1', 'task_scope'
48
-
49
- assert_match(/^TASKSCOPE$/, @out)
50
- end
51
-
52
- def test_multi_desc
53
- ENV['RAKE_COLUMNS'] = '80'
54
- rakefile_multidesc
55
-
56
- rake "-T"
57
-
58
- assert_match %r{^rake a *# A / A2 *$}, @out
59
- assert_match %r{^rake b *# B *$}, @out
60
- refute_match %r{^rake c}, @out
61
- assert_match %r{^rake d *# x{65}\.\.\.$}, @out
62
- end
63
-
64
- def test_long_description
65
- rakefile_multidesc
66
-
67
- rake "--describe"
68
-
69
- assert_match %r{^rake a\n *A\n *A2 *$}m, @out
70
- assert_match %r{^rake b\n *B *$}m, @out
71
- assert_match %r{^rake d\n *x{80}}m, @out
72
- refute_match %r{^rake c\n}m, @out
73
- end
74
-
75
- def test_proper_namespace_access
76
- rakefile_access
77
-
78
- rake
79
-
80
- refute_match %r{^BAD:}, @out
81
- end
82
-
83
- def test_rbext
84
- rakefile_rbext
85
-
86
- rake "-N"
87
-
88
- assert_match %r{^OK$}, @out
89
- end
90
-
91
- def test_system
92
- rake_system_dir
93
-
94
- rake '-g', "sys1"
95
-
96
- assert_match %r{^SYS1}, @out
97
- end
98
-
99
- def test_system_excludes_rakelib_files_too
100
- rake_system_dir
101
-
102
- rake '-g', "sys1", '-T', 'extra'
103
-
104
- refute_match %r{extra:extra}, @out
105
- end
106
-
107
- def test_by_default_rakelib_files_are_included
108
- rake_system_dir
109
- rakefile_extra
110
-
111
- rake '-T', 'extra', '--trace'
112
-
113
- assert_match %r{extra:extra}, @out
114
- end
115
-
116
- def test_implicit_system
117
- rake_system_dir
118
- Dir.chdir @tempdir
119
-
120
- rake "sys1", "--trace"
121
-
122
- assert_match %r{^SYS1}, @out
123
- end
124
-
125
- def test_no_system
126
- rake_system_dir
127
- rakefile_extra
128
-
129
- rake '-G', "sys1"
130
-
131
- assert_match %r{^Don't know how to build task}, @err # emacs wart: '
132
- end
133
-
134
- def test_nosearch_with_rakefile_uses_local_rakefile
135
- rakefile_default
136
-
137
- rake "--nosearch"
138
-
139
- assert_match %r{^DEFAULT}, @out
140
- end
141
-
142
- def test_nosearch_without_rakefile_finds_system
143
- rakefile_nosearch
144
- rake_system_dir
145
-
146
- rake "--nosearch", "sys1"
147
-
148
- assert_match %r{^SYS1}, @out
149
- end
150
-
151
- def test_nosearch_without_rakefile_and_no_system_fails
152
- rakefile_nosearch
153
- ENV['RAKE_SYSTEM'] = 'not_exist'
154
-
155
- rake "--nosearch"
156
-
157
- assert_match %r{^No Rakefile found}, @err
158
- end
159
-
160
- def test_invalid_command_line_options
161
- rakefile_default
162
-
163
- rake "--bad-options"
164
-
165
- assert_match %r{invalid +option}i, @err
166
- end
167
-
168
- def test_inline_verbose_default_should_show_command
169
- rakefile_verbose
170
-
171
- rake "inline_verbose_default"
172
-
173
- assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
174
- end
175
-
176
- def test_inline_verbose_true_should_show_command
177
- rakefile_verbose
178
-
179
- rake "inline_verbose_true"
180
-
181
- assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
182
- end
183
-
184
- def test_inline_verbose_false_should_not_show_command
185
- rakefile_verbose
186
-
187
- rake "inline_verbose_false"
188
-
189
- refute_match(/#{Regexp.quote(RUBY)} -e/, @err)
190
- end
191
-
192
- def test_block_verbose_false_should_not_show_command
193
- rakefile_verbose
194
-
195
- rake "block_verbose_false"
196
-
197
- refute_match(/#{Regexp.quote(RUBY)} -e/, @err)
198
- end
199
-
200
- def test_block_verbose_true_should_show_command
201
- rakefile_verbose
202
-
203
- rake "block_verbose_true"
204
-
205
- assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
206
- end
207
-
208
- def test_standalone_verbose_true_should_show_command
209
- rakefile_verbose
210
-
211
- rake "standalone_verbose_true"
212
-
213
- assert_match(/#{Regexp.quote(RUBY)} -e/, @err)
214
- end
215
-
216
- def test_standalone_verbose_false_should_not_show_command
217
- rakefile_verbose
218
-
219
- rake "standalone_verbose_false"
220
-
221
- refute_match(/#{Regexp.quote(RUBY)} -e/, @err)
222
- end
223
-
224
- def test_dry_run
225
- rakefile_default
226
-
227
- rake "-n", "other"
228
-
229
- assert_match %r{Execute \(dry run\) default}, @err
230
- assert_match %r{Execute \(dry run\) other}, @err
231
- refute_match %r{DEFAULT}, @out
232
- refute_match %r{OTHER}, @out
233
- end
234
-
235
- # Test for the trace/dry_run bug found by Brian Chandler
236
- def test_dry_run_bug
237
- rakefile_dryrun
238
-
239
- rake
240
-
241
- FileUtils.rm_f 'temp_one'
242
-
243
- rake "--dry-run"
244
-
245
- refute_match(/No such file/, @out)
246
- end
247
-
248
- # Test for the trace/dry_run bug found by Brian Chandler
249
- def test_trace_bug
250
- rakefile_dryrun
251
-
252
- rake
253
-
254
- FileUtils.rm_f 'temp_one'
255
-
256
- rake "--trace"
257
-
258
- refute_match(/No such file/, @out)
259
- end
260
-
261
- def test_imports
262
- rakefile_imports
263
-
264
- rake
265
-
266
- assert File.exist?(File.join(@tempdir, 'dynamic_deps')),
267
- "'dynamic_deps' file should exist"
268
- assert_match(/^FIRST$\s+^DYNAMIC$\s+^STATIC$\s+^OTHER$/, @out)
269
- end
270
-
271
- def test_regenerate_imports
272
- rakefile_regenerate_imports
273
-
274
- rake
275
-
276
- assert_match(/^INITIAL\s+^REGENERATED$/, @out)
277
- end
278
-
279
- def test_rules_chaining_to_file_task
280
- rakefile_chains
281
-
282
- rake
283
-
284
- assert File.exist?(File.join(@tempdir, 'play.app')),
285
- "'play.app' file should exist"
286
- end
287
-
288
- def test_file_creation_task
289
- rakefile_file_creation
290
-
291
- rake "prep"
292
- rake "run"
293
- rake "run"
294
-
295
- assert(@err !~ /^cp src/, "Should not recopy data")
296
- end
297
-
298
- def test_dash_f_with_no_arg_foils_rakefile_lookup
299
- rakefile_rakelib
300
-
301
- rake '-I', 'rakelib', '-rtest1', '-f'
302
-
303
- assert_match(/^TEST1$/, @out)
304
- end
305
-
306
- def test_dot_rake_files_can_be_loaded_with_dash_r
307
- rakefile_rakelib
308
-
309
- rake '-I', 'rakelib', '-rtest2', '-f'
310
-
311
- assert_empty @err
312
- assert_match(/^TEST2$/, @out)
313
- end
314
-
315
- def test_can_invoke_task_in_toplevel_namespace
316
- rakefile_namespace
317
-
318
- rake "copy"
319
-
320
- assert_match(/^COPY$/, @out)
321
- end
322
-
323
- def test_can_invoke_task_in_nested_namespace
324
- rakefile_namespace
325
-
326
- rake "nest:copy"
327
-
328
- assert_match(/^NEST COPY$/, @out)
329
- end
330
-
331
- def test_tasks_can_reference_task_in_same_namespace
332
- rakefile_namespace
333
-
334
- rake "nest:xx"
335
-
336
- assert_match(/^NEST COPY$/m, @out)
337
- end
338
-
339
- def test_tasks_can_reference_task_in_other_namespaces
340
- rakefile_namespace
341
-
342
- rake "b:run"
343
-
344
- assert_match(/^IN A\nIN B$/m, @out)
345
- end
346
-
347
- def test_anonymous_tasks_can_be_invoked_indirectly
348
- rakefile_namespace
349
-
350
- rake "anon"
351
-
352
- assert_match(/^ANON COPY$/m, @out)
353
- end
354
-
355
- def test_rake_namespace_refers_to_toplevel
356
- rakefile_namespace
357
-
358
- rake "very:nested:run"
359
-
360
- assert_match(/^COPY$/m, @out)
361
- end
362
-
363
- def test_file_task_are_not_scoped_by_namespaces
364
- rakefile_namespace
365
-
366
- rake "xyz.rb"
367
-
368
- assert_match(/^XYZ1\nXYZ2$/m, @out)
369
- end
370
-
371
- def test_file_task_dependencies_scoped_by_namespaces
372
- rakefile_namespace
373
-
374
- rake "scopedep.rb"
375
-
376
- assert_match(/^PREPARE\nSCOPEDEP$/m, @out)
377
- end
378
-
379
- def test_test_task_descriptions
380
- rakefile_test_task
381
-
382
- rake "-T"
383
-
384
- assert_match(/custom test task description/, @out)
385
- end
386
-
387
- def test_comment_before_task_acts_like_desc
388
- rakefile_comments
389
-
390
- rake "-T"
391
-
392
- refute_match(/comment for t1/, @out)
393
- end
394
-
395
- def test_comment_separated_from_task_by_blank_line_is_not_picked_up
396
- rakefile_comments
397
-
398
- rake "-T"
399
-
400
- refute_match("t2", @out)
401
- end
402
-
403
- def test_comment_after_desc_is_ignored
404
- rakefile_comments
405
-
406
- rake "-T"
407
-
408
- assert_match("override comment for t3", @out)
409
- end
410
-
411
- def test_comment_before_desc_is_ignored
412
- rakefile_comments
413
-
414
- rake "-T"
415
-
416
- assert_match("override comment for t4", @out)
417
- end
418
-
419
- def test_correct_number_of_tasks_reported
420
- rakefile_comments
421
-
422
- rake "-T"
423
-
424
- assert_equal(2, @out.split(/\n/).grep(/t\d/).size)
425
- end
426
-
427
- def test_file_list_is_requirable_separately
428
- ruby '-rrake/file_list', '-e', 'puts Rake::FileList["a"].size'
429
- assert_equal "1\n", @out
430
- end
431
-
432
- def can_detect_signals?
433
- system RUBY, '-e', 'Process.kill "TERM", $$'
434
- status = $?
435
- if @verbose
436
- puts " SIG status = #{$?.inspect}"
437
- puts " SIG status.respond_to?(:signaled?) = " +
438
- "#{$?.respond_to?(:signaled?).inspect}"
439
- puts " SIG status.signaled? = #{status.signaled?}" if
440
- status.respond_to?(:signaled?)
441
- end
442
- status.respond_to?(:signaled?) && status.signaled?
443
- end
444
-
445
- def test_signal_propagation_in_tests
446
- if can_detect_signals?
447
- rakefile_test_signal
448
- rake
449
- assert_match(/ATEST/, @out)
450
- refute_match(/BTEST/, @out)
451
- else
452
- skip "Signal detect seems broken on this system"
453
- end
454
- end
455
-
456
- def test_failing_test_sets_exit_status
457
- skip if uncertain_exit_status?
458
- rakefile_failing_test_task
459
- rake
460
- assert @exit.exitstatus > 0, "should be non-zero"
461
- end
462
-
463
- def test_stand_alone_filelist
464
- rakefile_stand_alone_filelist
465
-
466
- run_ruby @ruby_options + ["stand_alone_filelist.rb"]
467
-
468
- assert_match(/^stand_alone_filelist\.rb$/, @out)
469
- assert_equal 0, @exit.exitstatus unless uncertain_exit_status?
470
- end
471
-
472
- private
473
-
474
- # We are unable to accurately verify that Rake returns a proper
475
- # error exit status using popen3 in Ruby 1.8.7 and JRuby. This
476
- # predicate function can be used to skip tests or assertions as
477
- # needed.
478
- def uncertain_exit_status?
479
- RUBY_VERSION < "1.9" || defined?(JRUBY_VERSION)
480
- end
481
-
482
- end