@Test
public void ndkWarningOutputUnix() throws Exception {

  // Do not run tests on Windows (see http://b.android.com/222904)
  assumeFalse(SystemInfo.isWindows);
  createTempXmlFile();
  String output =
    ":foolib:compileLint\n" +
    ":foolib:copyDebugLint UP-TO-DATE\n" +
    ":foolib:mergeDebugProguardFiles UP-TO-DATE\n" +
    ":foolib:buildNative\n" +
    "Unexpected close tag: MANIFEST, expecting APPLICATION\n" +
    "jni/Android.mk:24: warning: overriding commands for target `dump'\n" +
    "jni/Android.mk:24: warning: ignoring old commands for target `dump'\n" +
    "jni/Android.mk:24: warning: overriding commands for target `dump'\n" +
    "jni/Android.mk:24: warning: ignoring old commands for target `dump'\n" +
    sourceFilePath + ":393: warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_a_16.o'\n" +
    sourceFilePath + ":393: warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_a_16.o'\n" +
    sourceFilePath + ":393: warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_a_9.o'\n" +
    sourceFilePath + ":393: warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_a_9.o'\n" +
    sourceFilePath + ":393: warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_b_18.o'\n" +
    sourceFilePath + ":393: warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_b_18.o'\n" +
    sourceFilePath + ":393: warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_c.o'\n" +
    sourceFilePath + ":393: warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_c.o'\n" +
    "jni/Android.mk:24: warning: overriding commands for target `dump'\n" +
    "jni/Android.mk:24: warning: ignoring old commands for target `dump'\n" +
    "[armeabi-v7a] Install        : libaacdecoder.so => libs/armeabi-v7a/libaacdecoder.so\n" +
    "[armeabi] Install        : libaacdecoder.so => libs/armeabi/libaacdecoder.so\n" +
    "[x86] Install        : libaacdecoder.so => libs/x86/libaacdecoder.so\n" +
    "[mips] Install        : libaacdecoder.so => libs/mips/libaacdecoder.so\n" +
    ":foolib:copyNativeLibs UP-TO-DATE" +
    ":app:assembleDebug UP-TO-DATE\n" +
    "\n" +
    "BUILD SUCCESSFUL\n" +
    "\n" +
    "Total time: 11.965 secs";
  assertEquals("0: Simple::foolib:compileLint\n" +
               "1: Simple::foolib:copyDebugLint UP-TO-DATE\n" +
               "2: Simple::foolib:mergeDebugProguardFiles UP-TO-DATE\n" +
               "3: Simple::foolib:buildNative\n" +
               "4: Simple:Unexpected close tag: MANIFEST, expecting APPLICATION\n" +
               "5: Warning:warning: overriding commands for target `dump'\n" +
               "\t" + CWD_PATH + "/jni/Android.mk:24:-1\n" +
               "6: Warning:warning: ignoring old commands for target `dump'\n" +
               "\t" + CWD_PATH + "/jni/Android.mk:24:-1\n" +
               "7: Warning:warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_a_16.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "8: Warning:warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_a_16.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "9: Warning:warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_a_9.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "10: Warning:warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_a_9.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "11: Warning:warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_b_18.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "12: Warning:warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_b_18.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "13: Warning:warning: overriding commands for target `obj/local/x86/objs/blah/src/blah3_c.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "14: Warning:warning: ignoring old commands for target `obj/local/x86/objs/blah/src/blah3_c.o'\n" +
               "\t" + sourceFilePath + ":393:-1\n" +
               "15: Simple:[armeabi-v7a] Install        : libaacdecoder.so => libs/armeabi-v7a/libaacdecoder.so\n" +
               "16: Simple:[armeabi] Install        : libaacdecoder.so => libs/armeabi/libaacdecoder.so\n" +
               "17: Simple:[x86] Install        : libaacdecoder.so => libs/x86/libaacdecoder.so\n" +
               "18: Simple:[mips] Install        : libaacdecoder.so => libs/mips/libaacdecoder.so\n" +
               "19: Simple::foolib:copyNativeLibs UP-TO-DATE:app:assembleDebug UP-TO-DATE\n" +
               "20: Info:BUILD SUCCESSFUL\n" +
               "21: Info:Total time: 11.965 secs\n",
               toString(parser.parseGradleOutput(output)));
  sourceFile.delete();
}