diff -r f44c530f80da -r 2d48e8cdda24 test/harness/testcaseio.c --- a/test/harness/testcaseio.c Sat Oct 26 18:47:33 2013 +0100 +++ b/test/harness/testcaseio.c Wed Oct 02 09:14:33 2013 +0100 @@ -5,6 +5,7 @@ #include #include "testcaseparser.h" #include "testcaseinput.h" +#include "testcaseoutput.h" #include "testcaseio.h" #include "warningsparser.h" @@ -70,6 +71,25 @@ else if (!testcase->expected && !testcase->warnings && !strcmp(tag,"EXPECTED")) testcase->expected=g_strdup(text); + else if (g_str_has_prefix(tag,"EXPECTED(") && tag[strlen(tag)-1]==')') + { + arg=g_strndup(tag+9,strlen(tag)-10); + s=g_path_get_dirname(arg); + if (strcmp(s,".")) + { + g_printerr("%s: Expected files may not have a " + "directory component\n",arg); + g_free(s); + g_free(arg); + testcase_free(testcase); + testcase_parser_free(parser); + return NULL; + } + g_free(s); + testcase->outputs=g_slist_prepend(testcase->outputs, + testcase_output_new(arg,text)); + g_free(arg); + } else if (!testcase->expected && !testcase->warnings && !strcmp(tag,"WARNINGS")) { @@ -108,11 +128,14 @@ } g_free(s); } - else if (!testcase->encoding && !strcmp(tag,"OPTIONS")) + else if (!testcase->options && !strcmp(tag,"OPTIONS")) { testcase->options=g_strsplit(text,"\n",0); - g_free(testcase->options[g_strv_length(testcase->options)-1]); - testcase->options[g_strv_length(testcase->options)-1]=NULL; + if (testcase->options && g_strv_length(testcase->options)>0) + { + g_free(testcase->options[g_strv_length(testcase->options)-1]); + testcase->options[g_strv_length(testcase->options)-1]=NULL; + } } else {