Added a simple script to check missing tests
against other languages and against the generic directory. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9756 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ccf65a1e56
commit
f3fccb5a9d
1 changed files with 53 additions and 0 deletions
53
Examples/test-suite/ruby/check_missing_tests.rb
Executable file
53
Examples/test-suite/ruby/check_missing_tests.rb
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# This script allows you to compare the tests in the current directory
|
||||
# (Ruby) against the tests of other languages to see which ones are missing
|
||||
#
|
||||
# Author:: gga
|
||||
# Copyright:: 2007
|
||||
# License:: Ruby
|
||||
#
|
||||
|
||||
|
||||
ignore = ['ruby','std','typemaps']
|
||||
|
||||
curr = Dir.pwd.sub(/.*\//, '')
|
||||
|
||||
langs = Dir.glob('../*').select { |x| File.directory?("../#{x}") }
|
||||
langs.map! { |x| x.sub(/^\.\.\/*/, '') }
|
||||
langs -= ignore
|
||||
|
||||
# Add generic test directory, too
|
||||
langs << ''
|
||||
|
||||
testsB = Dir.glob("*runme*").map { |x| x.sub(/\.\w+$/, '') }
|
||||
|
||||
|
||||
all_tests = []
|
||||
|
||||
langs.each do |lang|
|
||||
testsA = Dir.glob("../#{lang}/*runme*")
|
||||
testsA.map! { |x| x.sub(/.*\/(\w+)\.\w+$/, '\1') }
|
||||
testsA.delete_if { |x| x =~ /~$/ } # ignore emacs backups
|
||||
|
||||
diff = testsA - testsB
|
||||
|
||||
unless diff.empty?
|
||||
puts '-'*70
|
||||
title = !lang.empty? ? "#{lang[0,1].upcase}#{lang[1..-1]}" : 'Generic'
|
||||
title = "Missing #{title} tests"
|
||||
puts title
|
||||
puts '='*title.size
|
||||
puts diff.join(', ')
|
||||
all_tests += diff
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
all_tests.uniq!
|
||||
|
||||
puts '-'*70
|
||||
puts 'All missing tests'
|
||||
puts '================='
|
||||
puts all_tests.join(', ')
|
||||
Loading…
Add table
Add a link
Reference in a new issue