From 046327bbae568caac24150545b264b31731dabc5 Mon Sep 17 00:00:00 2001 From: Minero Aoki Date: Sat, 27 Sep 2008 20:26:50 +0000 Subject: [PATCH] calculate test dir from $0 git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4062 1b9489fe-b721-0410-924e-b54b9192deb8 --- tools/list-untested.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/list-untested.rb b/tools/list-untested.rb index 1ca7817..fb89e7b 100644 --- a/tools/list-untested.rb +++ b/tools/list-untested.rb @@ -1,12 +1,18 @@ +require 'pathname' + +def main + Dir.chdir Pathname.new($PROGRAM_NAME).realpath.dirname.dirname + 'test' + test_sh = File.read('test_cbc.sh') + tested = test_sh.scan(/[\$\w\-]+\.cb/).reject {|n| /\$/ =~ n } + + test_sh.scan(%r<\./[\w\-]+>).map {|n| File.basename(n) + '.cb' } + tested = tested.uniq + print_list Dir.glob('*.cb') - tested +end + def print_list(list) list.sort.each do |name| puts name end end -test_sh = File.read('test_cbc.sh') -tested = test_sh.scan(/[\$\w\-]+\.cb/).reject {|n| /\$/ =~ n } + - test_sh.scan(%r<\./[\w\-]+>).map {|n| File.basename(n) + '.cb' } -tested = tested.uniq - -print_list Dir.glob('*.cb') - tested +main