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

Unified Diff: src/scripts/run_tests.sh

Issue 1702008: Add crash_reporter functionality (Closed)
Patch Set: add set -e Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/scripts/build_tests.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/run_tests.sh
diff --git a/src/scripts/run_tests.sh b/src/scripts/run_tests.sh
index 7bd5c22b1c3a4ca23dd57c22fc116e2e42676268..83715bd63b8862ad5ecaf71c17cf39f244b15e72 100755
--- a/src/scripts/run_tests.sh
+++ b/src/scripts/run_tests.sh
@@ -36,13 +36,25 @@ LD_LIBRARY_PATH=/build/${FLAGS_board}/lib:/build/${FLAGS_board}/usr/lib:\
# Die on error; print commands
set -ex
+# Change to a test directory to make it easier for tests to write
+# to and clean up temporary files.
+TEST_CWD=$(mktemp -d /tmp/run_tests.XXXX)
+cd $TEST_CWD
+
+function cleanup() {
+ cd -
+ rm -rf $TEST_CWD
+ trap - 0
+}
+
+trap cleanup ERR 0
+
# NOTE: We currently skip cryptohome_tests (which happens to have a different
# suffix than the other tests), because it doesn't work.
-for i in /build/${FLAGS_board}/tests/*_{test,unittests}; do
+for i in ${TESTS_DIR}/*_{test,unittests}; do
if [[ "`file -b $i`" = "POSIX shell script text executable" ]]; then
LD_LIBRARY_PATH=$LD_LIBRARY_PATH /build/${FLAGS_board}/lib/ld-linux.so.2 /build/${FLAGS_board}/bin/bash $i
else
LD_LIBRARY_PATH=$LD_LIBRARY_PATH /build/${FLAGS_board}/lib/ld-linux.so.2 $i
fi
done
-
« no previous file with comments | « src/scripts/build_tests.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698