@Test
public void ndErrorOutputUnix() throws Exception {

  createTempFile(".cpp");
  String output =
    ":foolib:mergeDebugProguardFiles UP-TO-DATE\n" +
    ":foolib:buildNative\n" +
    sourceFilePath + ": In function 'void foo_bar(STRUCT_FOO_BAR*)':\n" +
    sourceFilePath + ":182:1: error: 'xyz' was not declared in this scope\n" +
    sourceFilePath + ": In function 'void foo_bar(STRUCT_FOO_BAR*)':\n" +
    sourceFilePath + ":190:1: warning: some random warning here\n" +
    "make: *** [obj/local/armeabi-v7a/objs/foo/src/bar.o] Error 1\n" +
    ":foolib:buildNative FAILED\n" +
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* What went wrong:\n" +
    "Execution failed for task ':foolib:buildNative'.\n" +
    "> Process 'command '/Users/tnorbye/dev/android-ndk-r9d/ndk-build'' finished with non-zero exit value 2\n" +
    "\n" +
    "* Try:\n" +
    "Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\n" +
    "\n" +
    "BUILD FAILED\n" +
    "\n" +
    "Total time: 7.994 secs";
  assertEquals("0: Simple::foolib:mergeDebugProguardFiles UP-TO-DATE\n" +
               "1: Simple::foolib:buildNative\n" +
               "2: Simple:" + sourceFilePath + ": In function 'void foo_bar(STRUCT_FOO_BAR*)':\n" +
               "3: Error:error: 'xyz' was not declared in this scope\n" +
               "\t" + sourceFilePath + ":182:1\n" +
               "4: Warning:warning: some random warning here\n" +
               "\t" + sourceFilePath + ":190:1\n" +
               "5: Simple:make: *** [obj/local/armeabi-v7a/objs/foo/src/bar.o] Error 1\n" +
               "6: Simple::foolib:buildNative FAILED\n" +
               "7: Error:Execution failed for task ':foolib:buildNative'.\n" +
               "> Process 'command '/Users/tnorbye/dev/android-ndk-r9d/ndk-build'' finished with non-zero exit value 2\n" +
               "8: Info:BUILD FAILED\n" +
               "9: Info:Total time: 7.994 secs\n",
               toString(parser.parseGradleOutput(output)));
  sourceFile.delete();
}