From: a bellenir Date: Tue, 2 Sep 2014 19:40:30 +0000 (+0000) Subject: split coverage analysis into a separate rake task X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=fb4c3e0637a3161c933d356899d2448680f02ede;p=projs%2Flibcds.git split coverage analysis into a separate rake task --- diff --git a/Rakefile b/Rakefile index c62d830..cce8899 100644 --- a/Rakefile +++ b/Rakefile @@ -52,12 +52,15 @@ task :test do TestEnv.Program('build/test_libcds', Dir['source/**/*.c', 'tests/**/*.c']) TestEnv.process sh "build/test_libcds" +end + +desc "Generate test coverage reports" +task :coverage => [:test] do FileList['build/obj/test_source/**/*.gcno'].each do |gcno| obj = gcno.ext('o') path = File.dirname(obj) gcov = File.basename(obj).ext('c.gcov') - sh *['gcov', '-abc', obj] - FileUtils.mv("./#{gcov}","#{path}/#{gcov}") + sh *['gcov', '-abc', obj] and FileUtils.mv("./#{gcov}","#{path}/#{gcov}") end end