Merge "Throw an exception if it fails to push a test case file."
diff --git a/android/cts/runner/src/com/drawelements/deqp/runner/DeqpTestRunner.java b/android/cts/runner/src/com/drawelements/deqp/runner/DeqpTestRunner.java
index 99fcfd9..b570b5a 100644
--- a/android/cts/runner/src/com/drawelements/deqp/runner/DeqpTestRunner.java
+++ b/android/cts/runner/src/com/drawelements/deqp/runner/DeqpTestRunner.java
@@ -1413,10 +1413,12 @@
         checkInterrupted(); // throws if interrupted
 
         final String testCases = generateTestCaseTrie(batch.tests);
-
-        mDevice.executeShellCommand("rm " + APP_DIR + CASE_LIST_FILE_NAME);
+        final String testCaseFilename = APP_DIR + CASE_LIST_FILE_NAME;
+        mDevice.executeShellCommand("rm " + testCaseFilename);
         mDevice.executeShellCommand("rm " + APP_DIR + LOG_FILE_NAME);
-        mDevice.pushString(testCases + "\n", APP_DIR + CASE_LIST_FILE_NAME);
+        if (!mDevice.pushString(testCases + "\n", testCaseFilename)) {
+        	throw new RuntimeException("Failed to write test cases to " + testCaseFilename);
+		}
 
         final String instrumentationName =
                 "com.drawelements.deqp/com.drawelements.deqp.testercore.DeqpInstrumentation";