From 355c032fcff8ad90d298c2ae5fd107d350142623 Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 2 Sep 2014 07:59:18 +0000 Subject: * test/runner.rb: reporting test coverage for test-all with COVERAGE env. [Feature #10189][ruby-core:64681] * Makefile.in: added task for coverage report. * common.mk: added definition of forked simplecov url. * .gitignore: ignored coverage directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .gitignore | 1 + ChangeLog | 8 ++++++++ Makefile.in | 12 ++++++++++++ common.mk | 2 ++ test/runner.rb | 6 ++++++ 5 files changed, 29 insertions(+) diff --git a/.gitignore b/.gitignore index 50a3f92282..b635de0ca1 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ y.tab.c /config.status /config.status.lineno /configure +/coverage /doc/capi /enc.mk /encdb.h diff --git a/ChangeLog b/ChangeLog index ccd6ac7d8d..0d163b8abe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue Sep 2 16:58:03 2014 SHIBATA Hiroshi + + * test/runner.rb: reporting test coverage for test-all with COVERAGE env. + [Feature #10189][ruby-core:64681] + * Makefile.in: added task for coverage report. + * common.mk: added definition of forked simplecov url. + * .gitignore: ignored coverage directory. + Mon Sep 1 20:11:02 2014 Masaki Suketa * ext/win32ole/win32ole.c (rbtime2vtdate): try to convert millisecond diff --git a/Makefile.in b/Makefile.in index fefb17cff9..484fe540af 100644 --- a/Makefile.in +++ b/Makefile.in @@ -466,6 +466,18 @@ update-rubyspec: update-mspec test-rubyspec-precheck: @if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi +update-coverage: + @$(CHDIR) $(srcdir); \ + if [ -d coverage/simplecov ]; then \ + cd coverage/simplecov; \ + echo updating simplecov ...; \ + exec git pull; \ + else \ + echo retrieving simplecov ...; \ + exec git clone $(SIMPLECOV_GIT_URL) coverage/simplecov; \ + cd coverage/simplecov; \ + fi + INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \ vmtc.inc vm.inc diff --git a/common.mk b/common.mk index 8b019488e7..b9270f5489 100644 --- a/common.mk +++ b/common.mk @@ -18,6 +18,8 @@ SPEC_GIT_BASE = git://github.com/nurse MSPEC_GIT_URL = $(SPEC_GIT_BASE)/mspec.git RUBYSPEC_GIT_URL = $(SPEC_GIT_BASE)/rubyspec.git +SIMPLECOV_GIT_URL = git://github.com/hsbt/simplecov.git + STATIC_RUBY = static-ruby EXTCONF = extconf.rb diff --git a/test/runner.rb b/test/runner.rb index 61fb0960f8..0e6ee3bea4 100644 --- a/test/runner.rb +++ b/test/runner.rb @@ -31,6 +31,12 @@ module Test::Unit end end +if ENV['COVERAGE'] + $LOAD_PATH.unshift "#{src_testdir}/../coverage/simplecov/lib" + require 'simplecov' + SimpleCov.start +end + begin exit Test::Unit::AutoRunner.run(true, src_testdir) rescue NoMemoryError -- cgit v1.2.3