Home | History | Annotate | Download | only in tests
      1 /*
      2  * Copyright (C) 2011 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.graphics.tests;
     18 
     19 import com.android.ddmlib.IDevice;
     20 import com.android.ddmlib.testrunner.IRemoteAndroidTestRunner;
     21 import com.android.ddmlib.testrunner.RemoteAndroidTestRunner;
     22 import com.android.tradefed.config.Option;
     23 import com.android.tradefed.device.DeviceNotAvailableException;
     24 import com.android.tradefed.device.ITestDevice;
     25 import com.android.tradefed.log.LogUtil.CLog;
     26 import com.android.tradefed.result.BugreportCollector;
     27 import com.android.tradefed.result.FileInputStreamSource;
     28 import com.android.tradefed.result.ITestInvocationListener;
     29 import com.android.tradefed.result.InputStreamSource;
     30 import com.android.tradefed.result.LogDataType;
     31 import com.android.tradefed.testtype.IDeviceTest;
     32 import com.android.tradefed.testtype.IRemoteTest;
     33 import com.android.tradefed.util.FileUtil;
     34 import com.android.tradefed.util.RegexTrie;
     35 import com.android.tradefed.util.RunUtil;
     36 import com.android.tradefed.util.SimpleStats;
     37 import com.android.tradefed.util.StreamUtil;
     38 
     39 import junit.framework.TestCase;
     40 
     41 import org.junit.Assert;
     42 
     43 import java.io.BufferedReader;
     44 import java.io.ByteArrayInputStream;
     45 import java.io.File;
     46 import java.io.FileInputStream;
     47 import java.io.IOException;
     48 import java.io.InputStream;
     49 import java.io.InputStreamReader;
     50 import java.util.ArrayList;
     51 import java.util.Arrays;
     52 import java.util.HashMap;
     53 import java.util.List;
     54 import java.util.Map;
     55 import java.util.concurrent.TimeUnit;
     56 
     57 /**
     58  * Run the OpenGl performance test. The OpenGl performance test benchmarks the performance
     59  * of RenderScript in Android System.
     60  */
     61 public class OpenGlPerformanceTest implements IDeviceTest, IRemoteTest {
     62 
     63     private ITestDevice mTestDevice = null;
     64 
     65     // Define instrumentation test package and runner.
     66     private static final String TEST_PACKAGE_NAME = "com.android.perftest";
     67     private static final String TEST_RUNNER_NAME = ".RsPerfTestRunner";
     68     private static final String TEST_CLASS = "com.android.perftest.RsBenchTest";
     69     private static final String OUTPUT_FILE = "rsbench_result";
     70     private static final int TEST_TIMER = 60 * 60 *1000; // test running timer 1 hour
     71     private static final long START_TIMER = 2 * 60 * 1000; // 2 minutes
     72 
     73     private final RegexTrie<String> mPatternMap = new RegexTrie<>();
     74     private Map<String, String[]> mKeyMap = new HashMap<>();
     75     private Map<String, Double[]> mTestResults = new HashMap<>();
     76 
     77     @Option(name="iterations",
     78             description="The number of iterations to run benchmark tests.")
     79     private int mIterations = 5;
     80 
     81     public OpenGlPerformanceTest() {
     82         // 3 tests, RenderScript Text Rendering
     83         mPatternMap.put("text1", "Fill screen with text 1 time, (\\d+.\\d+),");
     84         mPatternMap.put("text2", "Fill screen with text 3 times, (\\d+.\\d+),");
     85         mPatternMap.put("text3", "Fill screen with text 5 times, (\\d+.\\d+),");
     86         // 6 tests, RenderScript Texture Blending
     87         mPatternMap.put("10xSingleTexture", "Fill screen 10x singletexture, (\\d+.\\d+),");
     88         mPatternMap.put("Multitexture", "Fill screen 10x 3tex multitexture, (\\d+.\\d+),");
     89         mPatternMap.put("BlendedSingleTexture", "Fill screen 10x blended singletexture, " +
     90                 "(\\d+.\\d+),");
     91         mPatternMap.put("BlendedMultiTexture", "Fill screen 10x blended 3tex multitexture, " +
     92                 "(\\d+.\\d+),");
     93         mPatternMap.put("3xModulatedBlendedSingletexture",
     94                 "Fill screen 3x modulate blended singletexture, (\\d+.\\d+),");
     95         mPatternMap.put("1xModulatedBlendedSingletexture",
     96                 "Fill screen 1x modulate blended singletexture, (\\d+.\\d+),");
     97         // 3 tests, RenderScript Mesh
     98         mPatternMap.put("FullScreenMesh10", "Full screen mesh 10 by 10, (\\d+.\\d+),");
     99         mPatternMap.put("FullScrennMesh100", "Full screen mesh 100 by 100, (\\d+.\\d+),");
    100         mPatternMap.put("FullScreenMeshW4", "Full screen mesh W / 4 by H / 4, (\\d+.\\d+),");
    101         // 6 tests, RenderScript Geo Test (light)
    102         mPatternMap.put("GeoTestFlatColor1", "Geo test 25.6k flat color, (\\d+.\\d+),");
    103         mPatternMap.put("GeoTestFlatColor2", "Geo test 51.2k flat color, (\\d+.\\d+),");
    104         mPatternMap.put("GeoTestFlatColor3", "Geo test 204.8k small tries flat color, " +
    105                 "(\\d+.\\d+),");
    106         mPatternMap.put("GeoTestSingleTexture1", "Geo test 25.6k single texture, (\\d+.\\d+),");
    107         mPatternMap.put("GeoTestSingleTexture2", "Geo test 51.2k single texture, (\\d+.\\d+),");
    108         mPatternMap.put("GeoTestSingleTexture3", "Geo test 204.8k small tries single texture, " +
    109                 "(\\d+.\\d+),");
    110         // 9 tests, RenderScript Geo Test (heavy)
    111         mPatternMap.put("GeoTestHeavyVertex1","Geo test 25.6k geo heavy vertex, (\\d+.\\d+),");
    112         mPatternMap.put("GeoTestHeavyVertex2","Geo test 51.2k geo heavy vertex, (\\d+.\\d+),");
    113         mPatternMap.put("GeoTestHeavyVertex3", "Geo test 204.8k geo raster load heavy vertex, " +
    114                 "(\\d+.\\d+),");
    115         mPatternMap.put("GeoTestHeavyFrag1", "Geo test 25.6k heavy fragment, (\\d+.\\d+),");
    116         mPatternMap.put("GeoTestHeavyFrag2", "Geo test 51.2k heavy fragment, (\\d+.\\d+),");
    117         mPatternMap.put("GeoTestHeavyFrag3", "Geo test 204.8k small tries heavy fragment, " +
    118                 "(\\d+.\\d+),");
    119         mPatternMap.put("GeoTestHeavyFragHeavyVertex1",
    120                 "Geo test 25.6k heavy fragment heavy vertex, (\\d+.\\d+),");
    121         mPatternMap.put("GeoTestHeavyFragHeavyVertex2",
    122                 "Geo test 51.2k heavy fragment heavy vertex, (\\d+.\\d+),");
    123         mPatternMap.put("GeoTestHeavyFragHeavyVertex3",
    124                 "Geo test 204.8k small tries heavy fragment heavy vertex, (\\d+.\\d+),");
    125         // 6 tests, RenerScript UI Test
    126         mPatternMap.put("UITestWithIcon10by10", "UI test with icon display 10 by 10, " +
    127                 "(\\d+.\\d+),");
    128         mPatternMap.put("UITestWithIcon100by100", "UI test with icon display 100 by 100, " +
    129                 "(\\d+.\\d+),");
    130         mPatternMap.put("UITestWithImageText3", "UI test with image and text display 3 pages, " +
    131                 "(\\d+.\\d+),");
    132         mPatternMap.put("UITestWithImageText5", "UI test with image and text display 5 pages, " +
    133                 "(\\d+.\\d+),");
    134         mPatternMap.put("UITestListView", "UI test with list view, (\\d+.\\d+),");
    135         mPatternMap.put("UITestLiveWallPaper", "UI test with live wallpaper, (\\d+.\\d+),");
    136 
    137         mKeyMap.put("graphics_text", (new String[]{"text1", "text2", "text3"}));
    138         mKeyMap.put("graphics_geo_light", (new String[]{"GeoTestFlatColor1", "GeoTestFlatColor2",
    139                 "GeoTestFlatColor3", "GeoTestSingleTexture1", "GeoTestSingleTexture2",
    140                 "GeoTestSingleTexture3"}));
    141         mKeyMap.put("graphics_mesh", (new String[]{"FullScreenMesh10","FullScrennMesh100",
    142                 "FullScreenMeshW4"}));
    143         mKeyMap.put("graphics_geo_heavy", (new String[]{"GeoTestHeavyVertex1",
    144                 "GeoTestHeavyVertex2", "GeoTestHeavyVertex3", "GeoTestHeavyFrag1",
    145                 "GeoTestHeavyFrag2", "GeoTestHeavyFrag3", "GeoTestHeavyFragHeavyVertex1",
    146                 "GeoTestHeavyFragHeavyVertex2", "GeoTestHeavyFragHeavyVertex3"}));
    147         mKeyMap.put("graphics_texture", (new String[]{"10xSingleTexture", "Multitexture",
    148                 "BlendedSingleTexture", "BlendedMultiTexture", "3xModulatedBlendedSingletexture",
    149                 "1xModulatedBlendedSingletexture"}));
    150         mKeyMap.put("graphics_ui", (new String[]{"UITestWithIcon10by10", "UITestWithIcon100by100",
    151                 "UITestWithImageText3", "UITestWithImageText5",
    152                 "UITestListView", "UITestLiveWallPaper"}));
    153     }
    154 
    155     /**
    156      * Run the OpenGl benchmark tests
    157      * Collect results and post results to test listener.
    158      */
    159     @Override
    160     public void run(ITestInvocationListener standardListener)
    161             throws DeviceNotAvailableException {
    162         Assert.assertNotNull(mTestDevice);
    163         CLog.d("option values: mIterations(%d)", mIterations);
    164 
    165         // Start the test after device is fully booted and stable
    166         // FIXME: add option in TF to wait until device is booted and stable
    167         RunUtil.getDefault().sleep(START_TIMER);
    168 
    169         IRemoteAndroidTestRunner runner = new RemoteAndroidTestRunner(
    170                 TEST_PACKAGE_NAME, TEST_RUNNER_NAME, mTestDevice.getIDevice());
    171         runner.addInstrumentationArg("iterations", Integer.toString(mIterations));
    172         runner.setClassName(TEST_CLASS);
    173         runner.setMaxTimeToOutputResponse(TEST_TIMER, TimeUnit.MILLISECONDS);
    174         // Add bugreport listener for failed test
    175         BugreportCollector bugListener = new
    176             BugreportCollector(standardListener, mTestDevice);
    177         bugListener.addPredicate(BugreportCollector.AFTER_FAILED_TESTCASES);
    178         bugListener.setDescriptiveName(TEST_CLASS);
    179         mTestDevice.runInstrumentationTests(runner, bugListener);
    180         logOutputFile(bugListener);
    181         cleanOutputFiles();
    182     }
    183 
    184     /**
    185      * Collect test results, report test results to test listener.
    186      *
    187      * @param listener
    188      */
    189     private void logOutputFile(ITestInvocationListener listener)
    190             throws DeviceNotAvailableException {
    191         // take a bug report, it is possible the system crashed
    192         InputStreamSource bugreport = mTestDevice.getBugreport();
    193         listener.testLog("bugreport.txt", LogDataType.BUGREPORT, bugreport);
    194         bugreport.cancel();
    195         File resFile = null;
    196         InputStreamSource outputSource = null;
    197 
    198         for (int i = 0; i < mIterations; i++) {
    199             // In each iteration, the test result is saved in a file rsbench_result*.csv
    200             // e.g. for 10 iterations, results are in rsbench_result0.csv - rsbench_result9.csv
    201             String outputFileName = String.format("%s%d.csv", OUTPUT_FILE, i);
    202             CLog.d("pull result %s", outputFileName);
    203 
    204             try {
    205                 resFile = mTestDevice.pullFileFromExternal(outputFileName);
    206                 if (resFile != null) {
    207                     // Save a copy of the output file
    208                     CLog.d("Sending %d byte file %s into the logosphere!",
    209                             resFile.length(), resFile);
    210                     outputSource = new FileInputStreamSource(resFile);
    211                     listener.testLog(outputFileName, LogDataType.TEXT,
    212                             outputSource);
    213 
    214                     // Parse the results file and report results to dash board
    215                     parseOutputFile(new FileInputStream(resFile), i);
    216                 } else {
    217                     CLog.v("File %s doesn't exist or pulling the file failed", outputFileName);
    218                 }
    219             } catch (IOException e) {
    220                 CLog.e("IOException while reading outputfile %s", outputFileName);
    221             } finally {
    222                 FileUtil.deleteFile(resFile);
    223                 StreamUtil.cancel(outputSource);
    224             }
    225         }
    226 
    227         printTestResults();
    228         printKeyMap();
    229 
    230         Map<String, String> runMetrics = new HashMap<>();
    231 
    232         // After processing the output file, calculate average data and report data
    233         // Find the RU-ITEM keys mapping for data posting
    234         for (Map.Entry<String, String[]> entry: mKeyMap.entrySet()) {
    235             String[] itemKeys = entry.getValue();
    236 
    237             CLog.v("ru key: %s", entry.getKey());
    238 
    239             for (String key: itemKeys) {
    240                 CLog.v("item key: %s", key);
    241                 if (mTestResults.get(key) == null) {
    242                     continue;
    243                 }
    244                 SimpleStats simpleStats = new SimpleStats();
    245                 simpleStats.addAll(Arrays.asList(mTestResults.get(key)));
    246                 double averageFps = simpleStats.mean();
    247                 runMetrics.put(key, String.valueOf(averageFps));
    248             }
    249             reportMetrics(entry.getKey(), runMetrics, listener);
    250             runMetrics.clear();
    251         }
    252     }
    253 
    254     // Parse one result file and save test name and fps value
    255     private void parseOutputFile(InputStream dataInputStream, int iterationId) {
    256         try {
    257             BufferedReader br= new BufferedReader(new InputStreamReader(dataInputStream));
    258             String line = null;
    259             while ((line = br.readLine()) != null) {
    260                 List<List<String>> capture = new ArrayList<>(1);
    261                 String key = mPatternMap.retrieve(capture, line);
    262 
    263                 if (key != null) {
    264                     for (int i = 0; i < capture.size(); i++) {
    265                         CLog.v("caputre.get[%d]: %s", i, capture.get(i).toString());
    266                     }
    267 
    268                     CLog.v("Retrieve key: %s, catpure: %s",
    269                             key, capture.toString());
    270 
    271                     // for value into the corresponding
    272                     Double[] fps = mTestResults.get(key);
    273                     if (fps == null) {
    274                         fps = new Double[mIterations];
    275                         CLog.v("initialize fps array");
    276                     }
    277                     fps[iterationId] = Double.parseDouble(capture.get(0).get(0));
    278                     mTestResults.put(key, fps);
    279                 }
    280             }
    281         } catch (IOException e) {
    282             CLog.e("IOException while reading from data stream");
    283             CLog.e(e);
    284             return;
    285         }
    286     }
    287 
    288     private void printKeyMap() {
    289         for (Map.Entry<String, String[]> entry:mKeyMap.entrySet()) {
    290             CLog.v("ru key: %s", entry.getKey());
    291             for (String itemKey: entry.getValue()) {
    292                 CLog.v("item key: %s", itemKey);
    293             }
    294         }
    295     }
    296 
    297     private void printTestResults() {
    298         for (Map.Entry<String, Double[]> entry: mTestResults.entrySet()) {
    299             CLog.v("key %s:", entry.getKey());
    300             for (Double d: entry.getValue()) {
    301                 CLog.v("value: %f", d.doubleValue());
    302             }
    303         }
    304     }
    305 
    306     /**
    307      * Report run metrics by creating an empty test run to stick them in
    308      * <p />
    309      * Exposed for unit testing
    310      */
    311     protected void reportMetrics(String metricsName, Map<String, String> metrics,
    312             ITestInvocationListener listener) {
    313         // Create an empty testRun to report the parsed runMetrics
    314         CLog.d("About to report metrics to %s: %s", metricsName, metrics);
    315         listener.testRunStarted(metricsName, 0);
    316         listener.testRunEnded(0, metrics);
    317     }
    318 
    319     /**
    320      * Clean up output files from the last test run
    321      */
    322     private void cleanOutputFiles() throws DeviceNotAvailableException {
    323         for (int i = 0; i < mIterations; i++) {
    324             String outputFileName = String.format("%s%d.csv", OUTPUT_FILE, i);
    325             String extStore = mTestDevice.getMountPoint(IDevice.MNT_EXTERNAL_STORAGE);
    326             mTestDevice.executeShellCommand(String.format("rm %s/%s", extStore, outputFileName));
    327         }
    328     }
    329 
    330     @Override
    331     public void setDevice(ITestDevice testDevice) {
    332         mTestDevice = testDevice;
    333     }
    334 
    335     @Override
    336     public ITestDevice getDevice() {
    337         return mTestDevice;
    338     }
    339 
    340     /**
    341      * A meta-test to ensure the parsing working properly
    342      * To run the meta test, run command
    343      * tradefed.sh run singleCommand host -n --class
    344      * 'com.android.graphics.tests.OpenGlPerformanceTest$MetaTest'
    345      */
    346     public static class MetaTest extends TestCase {
    347         private OpenGlPerformanceTest mTestInstance = null;
    348 
    349         private static String join(String... subStrings) {
    350             StringBuilder sb = new StringBuilder();
    351             for (String subString : subStrings) {
    352                 sb.append(subString);
    353                 sb.append("\n");
    354             }
    355             return sb.toString();
    356         }
    357 
    358         @Override
    359         public void setUp() throws Exception {
    360             mTestInstance = new OpenGlPerformanceTest() {};
    361         }
    362 
    363         // Make sure that parsing works
    364         public void testParseOutputFile() throws Exception {
    365             String output = join(
    366                     "Fill screen with text 1 time, 97.65624,",
    367                     "Fill screen with text 3 times, 36.576443,",
    368                     "Fill screen with text 5 times, 12.382367,",
    369                     "Fill screen 10x singletexture, 40.617382,",
    370                     "Fill screen 10x 3tex multitexture, 28.32861,",
    371                     "Fill screen 10x blended singletexture, 18.389112,",
    372                     "Fill screen 10x blended 3tex multitexture, 5.4448433,",
    373                     "Fill screen 3x modulate blended singletexture, 27.754648,",
    374                     "Fill screen 1x modulate blended singletexture, 58.207214,",
    375                     "Full screen mesh 10 by 10, 12.727504,",
    376                     "Full screen mesh 100 by 100, 4.489136,",
    377                     "Full screen mesh W / 4 by H / 4, 2.688967,",
    378                     "Geo test 25.6k flat color, 31.259768,",
    379                     "Geo test 51.2k flat color, 17.985611,",
    380                     "Geo test 204.8k small tries flat color, 3.6580455,",
    381                     "Geo test 25.6k single texture, 30.03905,",
    382                     "Geo test 51.2k single texture, 14.622021,",
    383                     "Geo test 204.8k small tries single texture, 3.7195458,",
    384                     "Geo test 25.6k geo heavy vertex, 20.104542,",
    385                     "Geo test 51.2k geo heavy vertex, 8.982305,",
    386                     "Geo test 204.8k geo raster load heavy vertex, 2.9978714,",
    387                     "Geo test 25.6k heavy fragment, 30.788176,",
    388                     "Geo test 51.2k heavy fragment, 6.938662,",
    389                     "Geo test 204.8k small tries heavy fragment, 2.9441204,",
    390                     "Geo test 25.6k heavy fragment heavy vertex, 16.331863,",
    391                     "Geo test 51.2k heavy fragment heavy vertex, 4.531243,",
    392                     "Geo test 204.8k small tries heavy fragment heavy vertex, 1.6915321,",
    393                     "UI test with icon display 10 by 10, 93.370674,",
    394                     "UI test with icon display 100 by 100, 1.2948335,",
    395                     "UI test with image and text display 3 pages, 99.50249,",
    396                     "UI test with image and text display 5 pages, 77.57951,",
    397                     "UI test with list view, 117.78562,",
    398                     "UI test with live wallpaper, 38.197098,");
    399 
    400             InputStream inputStream = new ByteArrayInputStream(output.getBytes());
    401             mTestInstance.parseOutputFile(inputStream, 0);
    402             assertNotNull(mTestInstance.mTestResults);
    403 
    404             // 3 tests, RenderScript Text Rendering
    405             assertEquals("97.65624", mTestInstance.mTestResults.get("text1")[0].toString());
    406             assertEquals("36.576443", mTestInstance.mTestResults.get("text2")[0].toString());
    407             assertEquals("12.382367", mTestInstance.mTestResults.get("text3")[0].toString());
    408 
    409             // 6 tests, RenderScript Texture Blending
    410             assertEquals("40.617382",
    411                     mTestInstance.mTestResults.get("10xSingleTexture")[0].toString());
    412             assertEquals("28.32861",
    413                     mTestInstance.mTestResults.get("Multitexture")[0].toString());
    414             assertEquals("18.389112",
    415                     mTestInstance.mTestResults.get("BlendedSingleTexture")[0].toString());
    416             assertEquals("5.4448433",
    417                     mTestInstance.mTestResults.get("BlendedMultiTexture")[0].toString());
    418             assertEquals("27.754648",
    419                     mTestInstance.mTestResults.get(
    420                             "3xModulatedBlendedSingletexture")[0].toString());
    421             assertEquals("58.207214",
    422                     mTestInstance.mTestResults.get(
    423                             "1xModulatedBlendedSingletexture")[0].toString());
    424 
    425             // 3 tests, RenderScript Mesh
    426             assertEquals("12.727504",
    427                     mTestInstance.mTestResults.get("FullScreenMesh10")[0].toString());
    428             assertEquals("4.489136",
    429                     mTestInstance.mTestResults.get("FullScrennMesh100")[0].toString());
    430             assertEquals("2.688967",
    431                     mTestInstance.mTestResults.get("FullScreenMeshW4")[0].toString());
    432 
    433             // 6 tests, RenderScript Geo Test (light)
    434             assertEquals("31.259768",
    435                     mTestInstance.mTestResults.get("GeoTestFlatColor1")[0].toString());
    436             assertEquals("17.985611",
    437                     mTestInstance.mTestResults.get("GeoTestFlatColor2")[0].toString());
    438             assertEquals("3.6580455",
    439                     mTestInstance.mTestResults.get("GeoTestFlatColor3")[0].toString());
    440             assertEquals("30.03905",
    441                     mTestInstance.mTestResults.get("GeoTestSingleTexture1")[0].toString());
    442             assertEquals("14.622021",
    443                     mTestInstance.mTestResults.get("GeoTestSingleTexture2")[0].toString());
    444             assertEquals("3.7195458",
    445                     mTestInstance.mTestResults.get("GeoTestSingleTexture3")[0].toString());
    446 
    447             // 9 tests, RenderScript Geo Test (heavy)
    448             assertEquals("20.104542",
    449                     mTestInstance.mTestResults.get("GeoTestHeavyVertex1")[0].toString());
    450             assertEquals("8.982305",
    451                     mTestInstance.mTestResults.get("GeoTestHeavyVertex2")[0].toString());
    452             assertEquals("2.9978714",
    453                     mTestInstance.mTestResults.get("GeoTestHeavyVertex3")[0].toString());
    454             assertEquals("30.788176",
    455                     mTestInstance.mTestResults.get("GeoTestHeavyFrag1")[0].toString());
    456             assertEquals("6.938662",
    457                     mTestInstance.mTestResults.get("GeoTestHeavyFrag2")[0].toString());
    458             assertEquals("2.9441204",
    459                     mTestInstance.mTestResults.get("GeoTestHeavyFrag3")[0].toString());
    460             assertEquals("16.331863",
    461                     mTestInstance.mTestResults.get("GeoTestHeavyFragHeavyVertex1")[0].toString());
    462             assertEquals("4.531243",
    463                     mTestInstance.mTestResults.get("GeoTestHeavyFragHeavyVertex2")[0].toString());
    464             assertEquals("1.6915321",
    465                     mTestInstance.mTestResults.get("GeoTestHeavyFragHeavyVertex3")[0].toString());
    466 
    467             // 6 tests, RenerScript UI Test
    468             assertEquals("93.370674",
    469                     mTestInstance.mTestResults.get("UITestWithIcon10by10")[0].toString());
    470             assertEquals("1.2948335",
    471                     mTestInstance.mTestResults.get("UITestWithIcon100by100")[0].toString());
    472             assertEquals("99.50249",
    473                     mTestInstance.mTestResults.get("UITestWithImageText3")[0].toString());
    474             assertEquals("77.57951",
    475                     mTestInstance.mTestResults.get("UITestWithImageText5")[0].toString());
    476             assertEquals("117.78562",
    477                     mTestInstance.mTestResults.get("UITestListView")[0].toString());
    478             assertEquals("38.197098",
    479                     mTestInstance.mTestResults.get("UITestLiveWallPaper")[0].toString());
    480         }
    481 
    482         // Verify parsing two iterations
    483         public void testParseTwoInputs() throws Exception {
    484             String output1 = join(
    485                     "Fill screen with text 1 time, 97.65624,",
    486                     "Fill screen with text 3 times, 36.576443,",
    487                     "UI test with live wallpaper, 38.197098,");
    488             String output2 = join(
    489                     "Fill screen with text 1 time, 97.56097,",
    490                     "Fill screen with text 3 times, 36.75119,",
    491                     "UI test with live wallpaper, 38.05175,");
    492 
    493             InputStream inputStream = new ByteArrayInputStream(output1.getBytes());
    494             mTestInstance.parseOutputFile(inputStream, 0);
    495             //mTestInstance.printTestResults();
    496             inputStream = new ByteArrayInputStream(output2.getBytes());
    497             mTestInstance.parseOutputFile(inputStream, 1);
    498             assertNotNull(mTestInstance.mTestResults);
    499 
    500             assertEquals("97.65624", mTestInstance.mTestResults.get("text1")[0].toString());
    501             assertEquals("36.576443", mTestInstance.mTestResults.get("text2")[0].toString());
    502             assertEquals("38.197098",
    503                     mTestInstance.mTestResults.get("UITestLiveWallPaper")[0].toString());
    504 
    505             assertEquals("97.56097", mTestInstance.mTestResults.get("text1")[1].toString());
    506             assertEquals("36.75119", mTestInstance.mTestResults.get("text2")[1].toString());
    507             assertEquals("38.05175",
    508                     mTestInstance.mTestResults.get("UITestLiveWallPaper")[1].toString());
    509         }
    510     }
    511 }
    512