test/harness/testcase.c
changeset 93 9fb13a5dde3b
parent 17 2c88fd553e5d
child 96 8c2d6a0cf717
     1.1 --- a/test/harness/testcase.c	Mon Feb 06 23:55:27 2012 +0000
     1.2 +++ b/test/harness/testcase.c	Mon Sep 23 21:18:27 2013 +0100
     1.3 @@ -469,13 +469,7 @@
     1.4  	g_error_free(error);
     1.5  	return FALSE;
     1.6      }
     1.7 -    if (testcase->expected || testcase->warnings)
     1.8 -	r=testcase_spawn_bookloupe(testcase,&output,&error);
     1.9 -    else
    1.10 -    {
    1.11 -	r=testcase_spawn_bookloupe(testcase,NULL,&error);
    1.12 -        output=NULL;
    1.13 -    }
    1.14 +    r=testcase_spawn_bookloupe(testcase,&output,&error);
    1.15      if (!r)
    1.16      {
    1.17  	g_print("%s: FAIL\n",testcase->basename);
    1.18 @@ -492,37 +486,33 @@
    1.19  	g_error_free(error);
    1.20  	return FALSE;
    1.21      }
    1.22 -    if (testcase->expected || testcase->warnings)
    1.23 +    header=g_string_new("\n\nFile: ");
    1.24 +    g_string_append(header,filename);
    1.25 +    g_string_append(header,"\n");
    1.26 +    if (!g_str_has_prefix(output,header->str))
    1.27      {
    1.28 -	header=g_string_new("\n\nFile: ");
    1.29 -	g_string_append(header,filename);
    1.30 -	g_string_append(header,"\n");
    1.31 -	if (!g_str_has_prefix(output,header->str))
    1.32 +	g_print("%s: FAIL\n",testcase->basename);
    1.33 +	g_print("Unexpected header from bookloupe:\n");
    1.34 +	offset=common_prefix_length(output,header->str);
    1.35 +	print_unexpected(output,offset);
    1.36 +	r=FALSE;
    1.37 +    }
    1.38 +    pos=header->len;
    1.39 +    if (r)
    1.40 +    {
    1.41 +	/* Skip the summary */
    1.42 +	s=strstr(output+pos,"\n\n");
    1.43 +	if (s)
    1.44 +	    pos=s-output+2;
    1.45 +	else
    1.46  	{
    1.47  	    g_print("%s: FAIL\n",testcase->basename);
    1.48 -	    g_print("Unexpected header from bookloupe:\n");
    1.49 -	    offset=common_prefix_length(output,header->str);
    1.50 -	    print_unexpected(output,offset);
    1.51 +	    g_print("Unterminated summary from bookloupe:\n%s\n",output+pos);
    1.52  	    r=FALSE;
    1.53  	}
    1.54 -	pos=header->len;
    1.55 -	if (r)
    1.56 -	{
    1.57 -	    /* Skip the summary */
    1.58 -	    s=strstr(output+pos,"\n\n");
    1.59 -	    if (s)
    1.60 -		pos=s-output+2;
    1.61 -	    else
    1.62 -	    {
    1.63 -		g_print("%s: FAIL\n",testcase->basename);
    1.64 -		g_print("Unterminated summary from bookloupe:\n%s\n",
    1.65 -		  output+pos);
    1.66 -		r=FALSE;
    1.67 -	    }
    1.68 -	}
    1.69 -	g_string_free(header,TRUE);
    1.70 -	r=testcase_check_warnings(testcase,output+pos,&xfail);
    1.71      }
    1.72 +    g_string_free(header,TRUE);
    1.73 +    r=testcase_check_warnings(testcase,output+pos,&xfail);
    1.74      g_free(filename);
    1.75      g_free(output);
    1.76      if (r)