Create an expectation file for gcstress/debug.

Test: run-libcore-tests.sh --mode=device --vm-arg -Xgc:gcstress --debug
Change-Id: Idbb0eca68522cb9d4fb18700107533e98ae18b33
diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh
index f9f3754..8b3df3a 100755
--- a/tools/run-libcore-tests.sh
+++ b/tools/run-libcore-tests.sh
@@ -103,6 +103,9 @@
 # "org.apache.harmony.security"
 
 vogar_args=$@
+gcstress=false
+debug=false
+
 while true; do
   if [[ "$1" == "--mode=device" ]]; then
     vogar_args="$vogar_args --device-dir=/data/local/tmp"
@@ -125,6 +128,10 @@
     # Remove the --debug from the arguments.
     vogar_args=${vogar_args/$1}
     vogar_args="$vogar_args --vm-arg -XXlib:libartd.so"
+    debug=true
+    shift
+  elif [[ "$1" == "-Xgc:gcstress" ]]; then
+    gcstress=true
     shift
   elif [[ "$1" == "" ]]; then
     break
@@ -151,6 +158,11 @@
 fi
 vogar_args="$vogar_args --vm-arg -Xusejit:$use_jit"
 
+# gcstress and debug may lead to timeouts, so we need a dedicated expectations file for it.
+if [[ $gcstress && $debug ]]; then
+  expectations="$expectations --expectations art/tools/libcore_gcstress_debug_failures.txt"
+fi
+
 # Run the tests using vogar.
 echo "Running tests for the following test packages:"
 echo ${working_packages[@]} | tr " " "\n"