8000 Turn off all terminal output in all tests. · rubyzip/rubyzip@cd7bb14 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd7bb14

Browse files
committed
Turn off all terminal output in all tests.
Makes things a lot easier when trying to track down bugs.
1 parent 05af123 commit cd7bb14

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

samples/example_recursive.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def write_entries(entries, path, zipfile)
3333
entries.each do |e|
3434
zipfile_path = path == '' ? e : File.join(path, e)
3535
disk_file_path = File.join(@input_dir, zipfile_path)
36-
puts "Deflating #{disk_file_path}"
3736

3837
if File.directory? disk_file_path
3938
recursively_deflate_directory(disk_file_path, zipfile, zipfile_path)

test/file_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def test_commit
360360
zfRead.close
361361

362362
zf.close
363-
res = system("unzip -t #{TEST_ZIP.zip_name}")
363+
res = system("unzip -tqq #{TEST_ZIP.zip_name}")
364364
assert_equal(res, true)
365365
end
366366

@@ -376,7 +376,7 @@ def test_double_commit(filename = 'test/data/generated/double_commit_test.zip')
376376
zf2 = ::Zip::File.open(filename)
377377
assert(zf2.entries.detect { |e| e.name == 'test1.txt' } != nil)
378378
assert(zf2.entries.detect { |e| e.name == 'test2.txt' } != nil)
379-
res = system("unzip -t #{filename}")
379+
res = system("unzip -tqq #{filename}")
380380
assert_equal(res, true)
381381
end
382382

test/gentestfiles.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def initialize(zip_name, entry_names, comment = '')
7171
end
7272

7373
def self.create_test_zips
74-
raise "failed to create test zip '#{TEST_ZIP1.zip_name}'" unless system("/usr/bin/zip #{TEST_ZIP1.zip_name} test/data/file2.txt")
75-
raise "failed to remove entry from '#{TEST_ZIP1.zip_name}'" unless system("/usr/bin/zip #{TEST_ZIP1.zip_name} -d test/data/file2.txt")
74+
raise "failed to create test zip '#{TEST_ZIP1.zip_name}'" unless system("/usr/bin/zip -q #{TEST_ZIP1.zip_name} test/data/file2.txt")
75+
raise "failed to remove entry from '#{TEST_ZIP1.zip_name}'" unless system("/usr/bin/zip -q #{TEST_ZIP1.zip_name} -d test/data/file2.txt")
7676

7777
File.open('test/data/generated/empty.txt', 'w') {}
7878
File.open('test/data/generated/empty_chmod640.txt', 'w') {}
@@ -93,19 +93,19 @@ def self.create_test_zips
9393
file << testBinaryPattern << rand << "\0" while file.tell < 6E5
9494
end
9595

96-
raise "failed to create test zip '#{TEST_ZIP2.zip_name}'" unless system("/usr/bin/zip #{TEST_ZIP2.zip_name} #{TEST_ZIP2.entry_names.join(' ')}")
96+
raise "failed to create test zip '#{TEST_ZIP2.zip_name}'" unless system("/usr/bin/zip -q #{TEST_ZIP2.zip_name} #{TEST_ZIP2.entry_names.join(' ')}")
9797

9898
if RUBY_PLATFORM =~ /mswin|mingw|cygwin/
99-
raise "failed to add comment to test zip '#{TEST_ZIP2.zip_name}'" unless system("echo #{TEST_ZIP2.comment}| /usr/bin/zip -z #{TEST_ZIP2.zip_name}\"")
99+
raise "failed to add comment to test zip '#{TEST_ZIP2.zip_name}'" unless system("echo #{TEST_ZIP2.comment}| /usr/bin/zip -zq #{TEST_ZIP2.zip_name}\"")
100100
else
101101
# without bash system interprets everything after echo as parameters to
102102
# echo including | zip -z ...
103-
raise "failed to add comment to test zip '#{TEST_ZIP2.zip_name}'" unless system("bash -c \"echo #{TEST_ZIP2.comment} | /usr/bin/zip -z #{TEST_ZIP2.zip_name}\"")
103+
raise "failed to add comment to test zip '#{TEST_ZIP2.zip_name}'" unless system("bash -c \"echo #{TEST_ZIP2.comment} | /usr/bin/zip -zq #{TEST_ZIP2.zip_name}\"")
104104
end
105105

106-
raise "failed to create test zip '#{TEST_ZIP3.zip_name}'" unless system("/usr/bin/zip #{TEST_ZIP3.zip_name} #{TEST_ZIP3.entry_names.join(' ')}")
106+
raise "failed to create test zip '#{TEST_ZIP3.zip_name}'" unless system("/usr/bin/zip -q #{TEST_ZIP3.zip_name} #{TEST_ZIP3.entry_names.join(' ')}")
107107

108-
raise "failed to create test zip '#{TEST_ZIP4.zip_name}'" unless system("/usr/bin/zip #{TEST_ZIP4.zip_name} #{TEST_ZIP4.entry_names.join(' ')}")
108+
raise "failed to create test zip '#{TEST_ZIP4.zip_name}'" unless system("/usr/bin/zip -q #{TEST_ZIP4.zip_name} #{TEST_ZIP4.entry_names.join(' ')}")
109109
rescue
110110
# If there are any Windows developers wanting to use a command line zip.exe
111 8000 111
# to help create the following files, there's a free one available from

test/zip64_full_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_large_zip_file
4444
# note: if this fails, be sure you have UnZip version 6.0 or newer
4545
# as this is the first version to support zip64 extensions
4646
# but some OSes (*cough* OSX) still bundle a 5.xx release
47-
assert system("unzip -t #{test_filename}"), 'third-party zip validation failed'
47+
assert system("unzip -tqq #{test_filename}"), 'third-party zip validation failed'
4848
end
4949
end
5050

0 commit comments

Comments
 (0)
0