| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 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 --board="${FLAGS_board}" | |
| 64 egrep '^chromeos-base' ) |
| 64 fi | 65 fi |
| 65 | 66 |
| 66 BLACK_LIST_FILE="$(dirname "$0")/unit_test_black_list.txt" | 67 BLACK_LIST_FILE="$(dirname "$0")/unit_test_black_list.txt" |
| 67 | 68 |
| 68 for package in ${PACKAGE_LIST}; do | 69 for package in ${PACKAGE_LIST}; do |
| 69 if grep -xq "${package}" "${BLACK_LIST_FILE}"; then | 70 if grep -xq "${package}" "${BLACK_LIST_FILE}"; then |
| 70 warn "Skipping package ${package} since it is blacklisted." | 71 warn "Skipping package ${package} since it is blacklisted." |
| 71 continue | 72 continue |
| 72 fi | 73 fi |
| 73 EBUILD_PATH=$( equery-${FLAGS_board} which ${package} 2> /dev/null ) | 74 EBUILD_PATH=$( equery-${FLAGS_board} which ${package} 2> /dev/null ) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 86 warn "${NO_UNITTESTS}" | 87 warn "${NO_UNITTESTS}" |
| 87 fi | 88 fi |
| 88 | 89 |
| 89 if [ ${TEST_FAILURES} -ne 0 ]; then | 90 if [ ${TEST_FAILURES} -ne 0 ]; then |
| 90 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures." | 91 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures." |
| 91 error "Following packages had failing tests:" | 92 error "Following packages had failing tests:" |
| 92 die "${FAILED_PACKAGES}" | 93 die "${FAILED_PACKAGES}" |
| 93 else | 94 else |
| 94 info "All unit tests passed." | 95 info "All unit tests passed." |
| 95 fi | 96 fi |
| OLD | NEW |