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

Unified Diff: third_party/tcmalloc/chromium/src/tests/debugallocation_test.sh

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/tests/debugallocation_test.sh
===================================================================
--- third_party/tcmalloc/chromium/src/tests/debugallocation_test.sh (revision 88335)
+++ third_party/tcmalloc/chromium/src/tests/debugallocation_test.sh (working copy)
@@ -52,21 +52,38 @@
# Increments num_failures if the death test does not succeed.
OneDeathTest() {
"$DEBUGALLOCATION_TEST" "$1" 2>&1 | {
- read regex_line
- regex=`expr "$regex_line" : "Expected regex:\(.*\)"`
- test -z "$regex" && echo "done" # no regex line, not a death-case
- grep "$regex" >/dev/null 2>&1 # pass the rest of the lines through grep
- } || num_failures=`expr $num_failures + 1`
+ regex_line='dummy'
+ # Normally the regex_line is the first line of output, but not
+ # always (if tcmalloc itself does any logging to stderr).
+ while test -n "$regex_line"; do
+ read regex_line
+ regex=`expr "$regex_line" : "Expected regex:\(.*\)"`
+ test -n "$regex" && break # found the regex line
+ done
+ test -z "$regex" && echo "done" || grep "$regex" 2>&1
+ }
}
death_test_num=0 # which death test to run
-while test -z `OneDeathTest "$death_test_num"`; do
- echo "Done with death test $death_test_num"
+while :; do # same as 'while true', but more portable
+ echo -n "Running death test $death_test_num..."
+ output="`OneDeathTest $death_test_num`"
+ case $output in
+ # Empty string means grep didn't find anything.
+ "") echo "FAILED"; num_failures=`expr $num_failures + 1`;;
+ "done"*) echo "done with death tests"; break;;
+ # Any other string means grep found something, like it ought to.
+ *) echo "OK";;
+ esac
death_test_num=`expr $death_test_num + 1`
done
# Test the non-death parts of the test too
-if ! "$DEBUGALLOCATION_TEST"; then
+echo -n "Running non-death tests..."
+if "$DEBUGALLOCATION_TEST"; then
+ echo "OK"
+else
+ echo "FAILED"
num_failures=`expr $num_failures + 1`
fi

Powered by Google App Engine
This is Rietveld 408576698