1.1 --- a/test/harness/testcaseio.c Sun Sep 29 22:51:27 2013 +0100
1.2 +++ b/test/harness/testcaseio.c Mon Oct 21 23:36:40 2013 +0100
1.3 @@ -23,7 +23,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 @@ -108,6 +108,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->options && !strcmp(tag,"OPTIONS"))
1.35 {
1.36 testcase->options=g_strsplit(text,"\n",0);