test/harness/testcase.c
changeset 11 4a80c6053a66
parent 9 6a13fe0fc19e
child 17 2c88fd553e5d
     1.1 --- a/test/harness/testcase.c	Mon Jan 30 00:36:31 2012 +0000
     1.2 +++ b/test/harness/testcase.c	Mon Jan 30 23:32:47 2012 +0000
     1.3 @@ -62,7 +62,7 @@
     1.4  	else if (!g_unichar_iszerowidth(c))
     1.5  	    col++;
     1.6      }
     1.7 -    fprintf(stderr,"%s\n%*s^\n",string->str,col,"");
     1.8 +    g_print("%s\n%*s^\n",string->str,col,"");
     1.9      g_string_free(string,TRUE);
    1.10  }
    1.11  
    1.12 @@ -252,8 +252,8 @@
    1.13      GError *error=NULL;
    1.14      if (!testcase_create_input_files(testcase,&error))
    1.15      {
    1.16 -	fprintf(stderr,"%s: FAIL\n",testcase->basename);
    1.17 -	fprintf(stderr,"%s\n",error->message);
    1.18 +	g_print("%s: FAIL\n",testcase->basename);
    1.19 +	g_print("%s\n",error->message);
    1.20  	g_error_free(error);
    1.21  	return FALSE;
    1.22      }
    1.23 @@ -266,8 +266,8 @@
    1.24      }
    1.25      if (!r)
    1.26      {
    1.27 -	fprintf(stderr,"%s: FAIL\n",testcase->basename);
    1.28 -	fprintf(stderr,"%s\n",error->message);
    1.29 +	g_print("%s: FAIL\n",testcase->basename);
    1.30 +	g_print("%s\n",error->message);
    1.31  	g_error_free(error);
    1.32  	(void)testcase_remove_input_files(testcase,NULL);
    1.33  	return FALSE;
    1.34 @@ -275,8 +275,8 @@
    1.35      filename=testcase_resolve_input_files(testcase,"TEST-XXXXXX");
    1.36      if (!testcase_remove_input_files(testcase,&error))
    1.37      {
    1.38 -	fprintf(stderr,"%s: FAIL\n",testcase->basename);
    1.39 -	fprintf(stderr,"%s\n",error->message);
    1.40 +	g_print("%s: FAIL\n",testcase->basename);
    1.41 +	g_print("%s\n",error->message);
    1.42  	g_error_free(error);
    1.43  	return FALSE;
    1.44      }
    1.45 @@ -288,9 +288,9 @@
    1.46  	expected=g_string_new(testcase->expected);
    1.47  	if (!g_str_has_prefix(output,header->str))
    1.48  	{
    1.49 -	    fprintf(stderr,"%s: FAIL\n",testcase->basename);
    1.50 +	    g_print("%s: FAIL\n",testcase->basename);
    1.51  	    offset=common_prefix_length(output,header->str);
    1.52 -	    fprintf(stderr,"Unexpected header from bookloupe:\n");
    1.53 +	    g_print("Unexpected header from bookloupe:\n");
    1.54  	    print_unexpected(output,offset);
    1.55  	    r=FALSE;
    1.56  	}
    1.57 @@ -303,22 +303,22 @@
    1.58  		pos=s-output+2;
    1.59  	    else
    1.60  	    {
    1.61 -		fprintf(stderr,"%s: FAIL\n",testcase->basename);
    1.62 +		g_print("%s: FAIL\n",testcase->basename);
    1.63  		offset=common_prefix_length(output,header->str);
    1.64 -		fprintf(stderr,"Unterminated summary from bookloupe:\n%s\n",
    1.65 +		g_print("Unterminated summary from bookloupe:\n%s\n",
    1.66  		  output+pos);
    1.67  		r=FALSE;
    1.68  	    }
    1.69  	}
    1.70  	if (r && strcmp(output+pos,expected->str))
    1.71  	{
    1.72 -	    fprintf(stderr,"%s: FAIL\n",testcase->basename);
    1.73 +	    g_print("%s: FAIL\n",testcase->basename);
    1.74  	    offset=common_prefix_length(output+pos,expected->str);
    1.75  	    if (!offset && !output[pos+offset])
    1.76 -		fprintf(stderr,"Unexpected zero warnings from bookloupe.\n");
    1.77 +		g_print("Unexpected zero warnings from bookloupe.\n");
    1.78  	    else
    1.79  	    {
    1.80 -		fprintf(stderr,"Unexpected output from bookloupe:\n");
    1.81 +		g_print("Unexpected output from bookloupe:\n");
    1.82  		print_unexpected(output+pos,offset);
    1.83  	    }
    1.84  	    r=FALSE;
    1.85 @@ -329,7 +329,7 @@
    1.86      g_free(filename);
    1.87      g_free(output);
    1.88      if (r)
    1.89 -	fprintf(stderr,"%s: PASS\n",testcase->basename);
    1.90 +	g_print("%s: PASS\n",testcase->basename);
    1.91      return r;
    1.92  }
    1.93