Chromium Code Reviews| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 egrep '^chromeos-base' ) | 67 egrep '^chromeos-base' ) |
| 68 fi | 68 fi |
| 69 | 69 |
| 70 BLACK_LIST_FILE="$(dirname "$0")/unit_test_black_list.txt" | 70 BLACK_LIST_FILE="$(dirname "$0")/unit_test_black_list.txt" |
| 71 | 71 |
| 72 for package in ${PACKAGE_LIST}; do | 72 for package in ${PACKAGE_LIST}; do |
| 73 if grep -xq "${package}" "${BLACK_LIST_FILE}"; then | 73 if grep -xq "${package}" "${BLACK_LIST_FILE}"; then |
| 74 warn "Skipping package ${package} since it is blacklisted." | 74 warn "Skipping package ${package} since it is blacklisted." |
| 75 continue | 75 continue |
| 76 fi | 76 fi |
| 77 EBUILD_PATH=$( equery-${FLAGS_board} which ${package} 2> /dev/null ) | 77 EBUILD_PATH=$( equery-${FLAGS_board} which ${package} 2> /dev/null ) || |
|
petkov
2010/11/22 22:30:14
I thought you needed an \ here but maybe you don't
| |
| 78 warn "${package} not found" | |
| 78 if [ -n "${EBUILD_PATH}" ]; then | 79 if [ -n "${EBUILD_PATH}" ]; then |
| 79 if check_src_test "${EBUILD_PATH}"; then | 80 if check_src_test "${EBUILD_PATH}"; then |
| 80 run_unit_test "${EBUILD_PATH}" || record_test_failure "${package}" | 81 run_unit_test "${EBUILD_PATH}" || record_test_failure "${package}" |
| 81 else | 82 else |
| 82 NO_UNITTESTS="${NO_UNITTESTS} ${package}" | 83 NO_UNITTESTS="${NO_UNITTESTS} ${package}" |
| 83 fi | 84 fi |
| 84 TEST_COUNT=$(( TEST_COUNT + 1 )) | 85 TEST_COUNT=$(( TEST_COUNT + 1 )) |
| 85 fi | 86 fi |
| 86 done | 87 done |
| 87 | 88 |
| 88 if [ -n "${NO_UNITTESTS}" ]; then | 89 if [ -n "${NO_UNITTESTS}" ]; then |
| 89 warn "The following packages have no unit tests:" | 90 warn "The following packages have no unit tests:" |
| 90 warn "${NO_UNITTESTS}" | 91 warn "${NO_UNITTESTS}" |
| 91 fi | 92 fi |
| 92 | 93 |
| 93 if [ ${TEST_FAILURES} -ne 0 ]; then | 94 if [ ${TEST_FAILURES} -ne 0 ]; then |
| 94 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures." | 95 error "Run completed with ${TEST_FAILURES}/${TEST_COUNT} test failures." |
| 95 error "Following packages had failing tests:" | 96 error "Following packages had failing tests:" |
| 96 die "${FAILED_PACKAGES}" | 97 die "${FAILED_PACKAGES}" |
| 97 else | 98 else |
| 98 info "All unit tests passed." | 99 info "All unit tests passed." |
| 99 fi | 100 fi |
| OLD | NEW |