Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: cros_run_unit_tests

Issue 3801003: crosutils: make cros_run_unit_tests prepare before building tests (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # This script builds and runs Chromium OS unit tests. Note that this script 7 # This script builds and runs Chromium OS unit tests. Note that this script
8 # utilizes the src_test stanza in chromeos-base packages. These stanzas 8 # utilizes the src_test stanza in chromeos-base packages. These stanzas
9 # should both build and run the unit tests. 9 # should both build and run the unit tests.
10 10
(...skipping 24 matching lines...) Expand all
35 egrep '^src_test()' "${1}" > /dev/null 35 egrep '^src_test()' "${1}" > /dev/null
36 } 36 }
37 37
38 function record_test_failure() { 38 function record_test_failure() {
39 TEST_FAILURES=$(( TEST_FAILURES + 1 )) 39 TEST_FAILURES=$(( TEST_FAILURES + 1 ))
40 FAILED_PACKAGES="${FAILED_PACKAGES} ${1}" 40 FAILED_PACKAGES="${FAILED_PACKAGES} ${1}"
41 } 41 }
42 42
43 function run_unit_test() { 43 function run_unit_test() {
44 FEATURES="-buildpkg -digest noauto" \ 44 FEATURES="-buildpkg -digest noauto" \
45 ebuild-${FLAGS_board} "${1}" clean unpack configure test 45 ebuild-${FLAGS_board} "${1}" clean unpack prepare configure test
46 } 46 }
47 47
48 # Parse command line and die if unexpected paramters given. 48 # Parse command line and die if unexpected parameters given.
49 FLAGS_HELP="usage: ${0} [flags]" 49 FLAGS_HELP="usage: ${0} [flags]"
50 FLAGS "${@}" || exit 1 50 FLAGS "${@}" || exit 1
51 eval set -- "${FLAGS_ARGV}" 51 eval set -- "${FLAGS_ARGV}"
52 check_flags_only_and_allow_null_arg "${@}" && set -- 52 check_flags_only_and_allow_null_arg "${@}" && set --
53 53
54 set -e 54 set -e
55 55
56 [ -z "${FLAGS_board}" ] && die "--board required" 56 [ -z "${FLAGS_board}" ] && die "--board required"
57 57
58 # If no packages are specified we run all unit tests for chromeos-base 58 # If no packages are specified we run all unit tests for chromeos-base
(...skipping 28 matching lines...) Expand all
87 warn "${NO_UNITTESTS}" 87 warn "${NO_UNITTESTS}"
88 fi 88 fi
89 89
90 if [ ${TEST_FAILURES} -ne 0 ]; then 90 if [ ${TEST_FAILURES} -ne 0 ]; then
91 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures." 91 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures."
92 error "Following packages had failing tests:" 92 error "Following packages had failing tests:"
93 die "${FAILED_PACKAGES}" 93 die "${FAILED_PACKAGES}"
94 else 94 else
95 info "All unit tests passed." 95 info "All unit tests passed."
96 fi 96 fi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698