aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcrosperf/machine_manager_unittest.py3
-rwxr-xr-xcrosperf/run_tests.sh28
-rwxr-xr-xtoolchain_utils_githooks/check-style7
3 files changed, 9 insertions, 29 deletions
diff --git a/crosperf/machine_manager_unittest.py b/crosperf/machine_manager_unittest.py
index ee2542f0..3663ab81 100755
--- a/crosperf/machine_manager_unittest.py
+++ b/crosperf/machine_manager_unittest.py
@@ -4,6 +4,7 @@
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
"""Unittest for machine_manager."""
from __future__ import print_function
@@ -250,8 +251,6 @@ class MachineManagerTest(unittest.TestCase):
@mock.patch.object(command_executer.CommandExecuter, 'CrosRunCommandWOutput')
def test_try_to_lock_machine(self, mock_cros_runcmd):
- self.assertRaises(self.mm._TryToLockMachine, None)
-
mock_cros_runcmd.return_value = [0, 'false_lock_checksum', '']
self.mock_cmd_exec.CrosRunCommandWOutput = mock_cros_runcmd
self.mm._machines = []
diff --git a/crosperf/run_tests.sh b/crosperf/run_tests.sh
index 78a2b9fd..d70fc99d 100755
--- a/crosperf/run_tests.sh
+++ b/crosperf/run_tests.sh
@@ -3,30 +3,4 @@
# Copyright 2011 Google Inc. All Rights Reserved.
# Author: raymes@google.com (Raymes Khoury)
-# Make sure the base toolchain-utils directory is in our PYTHONPATH before
-# trying to run this script.
-export PYTHONPATH+=":.."
-
-num_tests=0
-num_failed=0
-
-for test in $(find -name \*test.py); do
- echo RUNNING: ${test}
- ((num_tests++))
- if ! ./${test} ; then
- echo
- echo "*** Test Failed! (${test}) ***"
- echo
- ((num_failed++))
- fi
-done
-
-echo
-
-if [ ${num_failed} -eq 0 ] ; then
- echo "ALL TESTS PASSED (${num_tests} ran)"
- exit 0
-fi
-
-echo "${num_failed} TESTS FAILED (out of ${num_tests})"
-exit 1
+../run_tests_for.py .
diff --git a/toolchain_utils_githooks/check-style b/toolchain_utils_githooks/check-style
index fa06fa3e..c844b1e2 100755
--- a/toolchain_utils_githooks/check-style
+++ b/toolchain_utils_githooks/check-style
@@ -12,6 +12,13 @@ if [[ $# -eq 0 ]]; then
fi
mydir="$(dirname "$(readlink -m "$0")")"
+pydir="${mydir}/.."
+
+if [[ -z "${PYTHONPATH:-}" ]]; then
+ export PYTHONPATH="${pydir}"
+else
+ export PYTHONPATH="${pydir}:${PYTHONPATH}"
+fi
tempfiles=()
rm_tempfiles() {