mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove rubyspec temporary directories
This commit is contained in:
parent
3497152515
commit
86431f5075
2 changed files with 15 additions and 4 deletions
|
|
@ -823,7 +823,6 @@ test-spec: $(TEST_RUNNABLE)-test-spec
|
|||
yes-test-spec: test-spec-precheck
|
||||
$(gnumake_recursive)$(Q) \
|
||||
$(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT) $(SPECOPTS)
|
||||
$(RMDIR) rubyspec_temp
|
||||
no-test-spec:
|
||||
|
||||
RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
|
||||
|
|
|
|||
|
|
@ -4,13 +4,25 @@
|
|||
# directory is empty when the process exits.
|
||||
|
||||
SPEC_TEMP_DIR_PID = Process.pid
|
||||
SPEC_TEMP_DIR = File.expand_path(ENV["SPEC_TEMP_DIR"] || "rubyspec_temp/#{SPEC_TEMP_DIR_PID}")
|
||||
SPEC_TEMP_DIR_LIST = []
|
||||
if tmpdir = ENV['SPEC_TEMP_DIR']
|
||||
temppath = File.expand_path(tmpdir) + "/"
|
||||
else
|
||||
tmpdir = File.expand_path("rubyspec_temp")
|
||||
temppath = tmpdir + "/#{SPEC_TEMP_DIR_PID}"
|
||||
SPEC_TEMP_DIR_LIST << tmpdir
|
||||
end
|
||||
SPEC_TEMP_DIR_LIST << temppath
|
||||
SPEC_TEMP_DIR = temppath
|
||||
SPEC_TEMP_UNIQUIFIER = "0"
|
||||
|
||||
at_exit do
|
||||
begin
|
||||
if SPEC_TEMP_DIR_PID == Process.pid
|
||||
Dir.delete SPEC_TEMP_DIR if File.directory? SPEC_TEMP_DIR
|
||||
while temppath = SPEC_TEMP_DIR_LIST.pop
|
||||
next unless File.directory? temppath
|
||||
Dir.delete temppath
|
||||
end
|
||||
end
|
||||
rescue SystemCallError
|
||||
STDERR.puts <<-EOM
|
||||
|
|
@ -18,7 +30,7 @@ at_exit do
|
|||
-----------------------------------------------------
|
||||
The rubyspec temp directory is not empty. Ensure that
|
||||
all specs are cleaning up temporary files:
|
||||
#{SPEC_TEMP_DIR}
|
||||
#{temppath}
|
||||
-----------------------------------------------------
|
||||
|
||||
EOM
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue