mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* bootstraptest/runner.rb: fix load path.
* common.mk: fix "test" rule to run with "btest". * rubytest.rb, sample/test.rb: fix to show tests progress. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									9aa9c07c07
								
							
						
					
					
						commit
						616f4d3385
					
				
					 5 changed files with 24 additions and 6 deletions
				
			
		|  | @ -1,3 +1,11 @@ | ||||||
|  | Fri Jul  6 18:20:50 2007  Koichi Sasada  <ko1@atdot.net> | ||||||
|  | 
 | ||||||
|  | 	* bootstraptest/runner.rb: fix load path. | ||||||
|  | 
 | ||||||
|  | 	* common.mk: fix "test" rule to run with "btest". | ||||||
|  | 
 | ||||||
|  | 	* rubytest.rb, sample/test.rb: fix to show tests progress. | ||||||
|  | 
 | ||||||
| Fri Jul  6 15:37:48 2007  Koichi Sasada  <ko1@atdot.net> | Fri Jul  6 15:37:48 2007  Koichi Sasada  <ko1@atdot.net> | ||||||
| 
 | 
 | ||||||
| 	* test/ruby/test_iterator.rb: fix test to 1.9 spec. | 	* test/ruby/test_iterator.rb: fix test to 1.9 spec. | ||||||
|  |  | ||||||
|  | @ -5,12 +5,18 @@ | ||||||
| # Never use test/unit in this file. | # Never use test/unit in this file. | ||||||
| # Never use Ruby extensions in this file. | # Never use Ruby extensions in this file. | ||||||
| 
 | 
 | ||||||
| require 'fileutils' | begin | ||||||
|  |   require 'fileutils' | ||||||
|  |   require 'tmpdir' | ||||||
|  | rescue LoadError | ||||||
|  |   $:.unshift File.join(File.dirname(__FILE__), '../lib') | ||||||
|  |   retry | ||||||
|  | end | ||||||
| 
 | 
 | ||||||
| def main | def main | ||||||
|   @ruby = File.expand_path('miniruby') |   @ruby = File.expand_path('miniruby') | ||||||
|   @verbose = false |   @verbose = false | ||||||
|   dir = '/tmp/bootstraptest.tmpwd' |   dir = File.join(Dir.tmpdir, 'bootstraptest.tmpwd') | ||||||
|   quiet = false |   quiet = false | ||||||
|   tests = nil |   tests = nil | ||||||
|   ARGV.delete_if {|arg| |   ARGV.delete_if {|arg| | ||||||
|  | @ -73,8 +79,7 @@ def exec_test(pathes) | ||||||
|   @errbuf = [] |   @errbuf = [] | ||||||
|   @location = nil |   @location = nil | ||||||
|   pathes.each do |path| |   pathes.each do |path| | ||||||
|     puts |     $stderr.print "\n#{File.basename(path)} " | ||||||
|     puts File.basename(path) |  | ||||||
|     load File.expand_path(path) |     load File.expand_path(path) | ||||||
|   end |   end | ||||||
|   $stderr.puts |   $stderr.puts | ||||||
|  |  | ||||||
|  | @ -318,6 +318,7 @@ btest: $(MINIRUBY) PHONY | ||||||
| 	$(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(MINIRUBY)" $(OPTS) | 	$(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(MINIRUBY)" $(OPTS) | ||||||
| 
 | 
 | ||||||
| test: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY | test: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY | ||||||
|  | 	@$(MINIRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(MINIRUBY)" -q | ||||||
| 	@$(MINIRUBY) $(srcdir)/rubytest.rb | 	@$(MINIRUBY) $(srcdir)/rubytest.rb | ||||||
| 
 | 
 | ||||||
| test-all: | test-all: | ||||||
|  |  | ||||||
|  | @ -39,7 +39,7 @@ error = '' | ||||||
| srcdir = File.dirname(__FILE__) | srcdir = File.dirname(__FILE__) | ||||||
| `#{ruby} -I#{srcdir}/lib #{srcdir}/sample/test.rb`.each_line do |line| | `#{ruby} -I#{srcdir}/lib #{srcdir}/sample/test.rb`.each_line do |line| | ||||||
|   if line =~ /^end of test/ |   if line =~ /^end of test/ | ||||||
|     print "test succeeded\n" |     print "\ntest succeeded\n" | ||||||
|     exit true |     exit true | ||||||
|   end |   end | ||||||
|   error << line if %r:^(sample/test.rb|not): =~ line |   error << line if %r:^(sample/test.rb|not): =~ line | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ $ntest=0 | ||||||
| $failed = 0 | $failed = 0 | ||||||
| 
 | 
 | ||||||
| def test_check(what) | def test_check(what) | ||||||
|   printf "%s\n", what |   STDERR.print "\nsample/test.rb:#{what} " | ||||||
|   $what = what |   $what = what | ||||||
|   $testnum = 0 |   $testnum = 0 | ||||||
| end | end | ||||||
|  | @ -16,11 +16,15 @@ def test_ok(cond,n=1) | ||||||
|   $ntest+=1 |   $ntest+=1 | ||||||
|   where = (st = caller(n)) ? st[0] : "caller error! (n=#{n}, trace=#{caller(0).join(', ')}" |   where = (st = caller(n)) ? st[0] : "caller error! (n=#{n}, trace=#{caller(0).join(', ')}" | ||||||
|   if cond |   if cond | ||||||
|  |     STDERR.print "." | ||||||
|     printf "ok %d (%s)\n", $testnum, where |     printf "ok %d (%s)\n", $testnum, where | ||||||
|   else |   else | ||||||
|  |     STDERR.print "F" | ||||||
|     printf "not ok %s %d -- %s\n", $what, $testnum, where |     printf "not ok %s %d -- %s\n", $what, $testnum, where | ||||||
|     $failed+=1  |     $failed+=1  | ||||||
|   end |   end | ||||||
|  |   STDOUT.flush | ||||||
|  |   STDERR.flush | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| # make sure conditional operators work | # make sure conditional operators work | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 ko1
						ko1