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

Side by Side Diff: cros_run_unit_tests

Issue 2818021: Adding blacklist support for unit tests and blacklisting currently failing tests. (Closed) Base URL: ssh://git@chromiumos-git//crosutils.git
Patch Set: Power_manager works. Created 10 years, 6 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
« no previous file with comments | « no previous file | unit_test_black_list.txt » ('j') | 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
59 # packages. 59 # packages.
60 if [ -n "${FLAGS_packages}" ]; then 60 if [ -n "${FLAGS_packages}" ]; then
61 PACKAGE_LIST="${FLAGS_packages}" 61 PACKAGE_LIST="${FLAGS_packages}"
62 else 62 else
63 PACKAGE_LIST=$( ./get_package_list chromeos | egrep '^chromeos-base' ) 63 PACKAGE_LIST=$( ./get_package_list chromeos | egrep '^chromeos-base' )
64 fi 64 fi
65 65
66 BLACK_LIST_FILE="$(dirname "$0")/unit_test_black_list.txt"
67
66 for package in ${PACKAGE_LIST}; do 68 for package in ${PACKAGE_LIST}; do
69 if grep -xq "${package}" "${BLACK_LIST_FILE}"; then
70 warn "Skipping package ${package} since it is blacklisted."
71 continue
72 fi
67 EBUILD_PATH=$( equery-${FLAGS_board} which ${package} 2> /dev/null ) 73 EBUILD_PATH=$( equery-${FLAGS_board} which ${package} 2> /dev/null )
68 if [ -n "${EBUILD_PATH}" ]; then 74 if [ -n "${EBUILD_PATH}" ]; then
69 if check_src_test "${EBUILD_PATH}"; then 75 if check_src_test "${EBUILD_PATH}"; then
70 run_unit_test "${EBUILD_PATH}" || record_test_failure "${package}" 76 run_unit_test "${EBUILD_PATH}" || record_test_failure "${package}"
71 else 77 else
72 NO_UNITTESTS="${NO_UNITTESTS} ${package}" 78 NO_UNITTESTS="${NO_UNITTESTS} ${package}"
73 fi 79 fi
74 TEST_COUNT=$(( TEST_COUNT + 1 )) 80 TEST_COUNT=$(( TEST_COUNT + 1 ))
75 fi 81 fi
76 done 82 done
77 83
78 if [ -n "${NO_UNITTESTS}" ]; then 84 if [ -n "${NO_UNITTESTS}" ]; then
79 warn "The following packages have no unit tests:" 85 warn "The following packages have no unit tests:"
80 warn "${NO_UNITTESTS}" 86 warn "${NO_UNITTESTS}"
81 fi 87 fi
82 88
83 if [ ${TEST_FAILURES} -ne 0 ]; then 89 if [ ${TEST_FAILURES} -ne 0 ]; then
84 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures." 90 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures."
85 error "Following packages had failing tests:" 91 error "Following packages had failing tests:"
86 die "${FAILED_PACKAGES}" 92 die "${FAILED_PACKAGES}"
87 else 93 else
88 info "All unit tests passed." 94 info "All unit tests passed."
89 fi 95 fi
OLDNEW
« no previous file with comments | « no previous file | unit_test_black_list.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698