blob: 39e8c6155c0f068a20c2548e036ae616345d7c74 [file] [log] [blame]
rspangler@google.com49fdf182009-10-10 00:57:34 +00001#!/bin/bash
2
3# Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7set -ex
8
Andrew de los Reyes4fe15d02009-12-10 19:01:36 -08009scons debug=1 -j $(cat /proc/cpuinfo |grep '^processor' | wc -l)
rspangler@google.com49fdf182009-10-10 00:57:34 +000010lcov -d . --zerocounters
adlr@google.comc98a7ed2009-12-04 18:54:03 +000011./update_engine_unittests --gtest_filter='-*.RunAsRoot*:*.Fakeroot*'
12fakeroot ./update_engine_unittests --gtest_filter='*.Fakeroot*'
13sudo ./update_engine_unittests --gtest_filter='*.RunAsRoot*'
rspangler@google.com49fdf182009-10-10 00:57:34 +000014lcov --directory . --capture --output-file app.info
15
16# some versions of genhtml support the --no-function-coverage argument,
17# which we want. The problem w/ function coverage is that every template
18# instantiation of a method counts as a different method, so if we
19# instantiate a method twice, once for testing and once for prod, the method
20# is tested, but it shows only 50% function coverage b/c it thinks we didn't
21# test the prod version.
22genhtml --no-function-coverage -o html ./app.info || genhtml -o html ./app.info
adlr@google.comc98a7ed2009-12-04 18:54:03 +000023./local_coverage_rate.sh