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

Side by Side Diff: cros_run_unit_tests

Issue 6812021: Rely on Portage to run required stages before "test" stage. (Closed) Base URL: ssh://gitrw.chromium.org:9222/crostestutils.git@master
Patch Set: Adding period at end of comment. Created 9 years, 8 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 29 matching lines...) Expand all
40 40
41 function check_src_test() { 41 function check_src_test() {
42 egrep '^src_test()' "${1}" > /dev/null 42 egrep '^src_test()' "${1}" > /dev/null
43 } 43 }
44 44
45 function record_test_failure() { 45 function record_test_failure() {
46 TEST_FAILURES=$(( TEST_FAILURES + 1 )) 46 TEST_FAILURES=$(( TEST_FAILURES + 1 ))
47 FAILED_PACKAGES="${FAILED_PACKAGES} ${1}" 47 FAILED_PACKAGES="${FAILED_PACKAGES} ${1}"
48 } 48 }
49 49
50 # Run the unit test for the given package, via ebuild src_test() function.
50 function run_unit_test() { 51 function run_unit_test() {
51 FEATURES="-buildpkg -digest noauto" \ 52 FEATURES="-buildpkg -digest" \
52 ebuild-${FLAGS_board} "${1}" clean unpack prepare configure test 53 ebuild-${FLAGS_board} "${1}" clean test clean
53 } 54 }
54 55
55 # Parse command line and die if unexpected parameters given. 56 # Parse command line and die if unexpected parameters given.
56 FLAGS_HELP="usage: ${0} [flags]" 57 FLAGS_HELP="usage: ${0} [flags]"
57 FLAGS "${@}" || exit 1 58 FLAGS "${@}" || exit 1
58 eval set -- "${FLAGS_ARGV}" 59 eval set -- "${FLAGS_ARGV}"
59 check_flags_only_and_allow_null_arg "${@}" && set -- 60 check_flags_only_and_allow_null_arg "${@}" && set --
60 61
61 set -e 62 set -e
62 63
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 warn "${NO_UNITTESTS}" 109 warn "${NO_UNITTESTS}"
109 fi 110 fi
110 111
111 if [ ${TEST_FAILURES} -ne 0 ]; then 112 if [ ${TEST_FAILURES} -ne 0 ]; then
112 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures." 113 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures."
113 error "Following packages had failing tests:" 114 error "Following packages had failing tests:"
114 die "${FAILED_PACKAGES}" 115 die "${FAILED_PACKAGES}"
115 else 116 else
116 info "All unit tests passed." 117 info "All unit tests passed."
117 fi 118 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