test/harness/testcaseio.c
changeset 184 cd3068704d3a
parent 17 2c88fd553e5d
child 191 189183b37598
     1.1 --- a/test/harness/testcaseio.c	Mon Feb 06 23:55:27 2012 +0000
     1.2 +++ b/test/harness/testcaseio.c	Sun Oct 20 21:06:25 2013 +0100
     1.3 @@ -22,7 +22,7 @@
     1.4      GError *err=NULL;
     1.5      char *s,*arg;
     1.6      const char *tag,*text;
     1.7 -    gboolean found_tag=FALSE;
     1.8 +    gboolean found_tag=FALSE,newlines_set=FALSE;
     1.9      parser=testcase_parser_new_from_file(filename);
    1.10      if (!parser)
    1.11  	return NULL;
    1.12 @@ -88,6 +88,24 @@
    1.13  	}
    1.14  	else if (!testcase->encoding && !strcmp(tag,"ENCODING"))
    1.15  	    testcase->encoding=g_strchomp(g_strdup(text));
    1.16 +	else if (!newlines_set && !strcmp(tag,"NEWLINES"))
    1.17 +	{
    1.18 +	    newlines_set=TRUE;
    1.19 +	    s=g_strdup(text);
    1.20 +	    g_strchomp(s);
    1.21 +	    if (!strcmp(s,"LF"))
    1.22 +		testcase->flags|=TESTCASE_UNIX_NEWLINES;
    1.23 +	    else if (strcmp(s,"CRLF"))
    1.24 +	    {
    1.25 +		g_printerr(
    1.26 +		  "%s: Unrecognised style for newlines. Try LF or CRLF.\n",s);
    1.27 +		g_free(s);
    1.28 +		testcase_free(testcase);
    1.29 +		testcase_parser_free(parser);
    1.30 +		return NULL;
    1.31 +	    }
    1.32 +	    g_free(s);
    1.33 +	}
    1.34  	else if (!testcase->encoding && !strcmp(tag,"OPTIONS"))
    1.35  	{
    1.36  	    testcase->options=g_strsplit(text,"\n",0);