mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
tests: add option for listing all failed case IDs
This commit is contained in:
parent
a65f30bd21
commit
0094e3ffa2
@ -57,9 +57,13 @@ def main
|
||||
tests = controller.results.results.keys.collect { |e| re.match(e) ? $1 : nil }.compact
|
||||
error_and_exit "No tests matched RE #{re}" if tests.empty?
|
||||
tests.each { |e| controller.add_test_case e }
|
||||
elsif ((arg == "-F" || (arg == "--list-failed")))
|
||||
controller.list_failed_ids
|
||||
exit 0
|
||||
elsif ((arg == "-h") || (arg == "--help"))
|
||||
puts <<EOHELP
|
||||
Syntax: run.rb [options]
|
||||
-F, --list-failed list IDs of failed tests
|
||||
-f, --failed only run tests marked as failed
|
||||
-n, --new only run tests for which no entry exists in results.txt
|
||||
-dDATE only run tests added after DATE (YYYYMMDD-HHMM)
|
||||
|
@ -162,4 +162,17 @@ class Controller
|
||||
|
||||
@results_mutex.unlock
|
||||
end
|
||||
|
||||
def list_failed_ids
|
||||
entries = @dir_entries.collect do |entry|
|
||||
if (FileTest.file?(entry) && (entry =~ /^test-(\d+).*\.rb$/))
|
||||
class_name = file_name_to_class_name entry
|
||||
@results.status?(class_name) == :failed ? $1.to_i : nil
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
puts entries.reject(&:nil?).sort.map(&:to_s).join(" ")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user