mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 01:39:20 +00:00
Do not write XML tests output until end of execution to avoid corrupted XML in case of crash (bis)
This commit is contained in:
parent
5a9e7e66d7
commit
1bb0df3444
1 changed files with 5 additions and 4 deletions
|
|
@ -163,7 +163,7 @@ int main (int argc, char *argv[])
|
|||
int ret;
|
||||
const char *suite_name=NULL;
|
||||
const char *test_name=NULL;
|
||||
const char *xml_file=NULL;
|
||||
const char *xml_file="CUnitAutomated-Results.xml";
|
||||
char *xml_tmp_file=NULL;
|
||||
int xml = 0;
|
||||
FILE* log_file=NULL;
|
||||
|
|
@ -214,7 +214,6 @@ int main (int argc, char *argv[])
|
|||
} else if (strcmp(argv[i], "--xml-file") == 0){
|
||||
CHECK_ARG("--xml-file", ++i, argc);
|
||||
xml_file = argv[i];
|
||||
xml_tmp_file = ms_strdup_printf("%s.tmp", argv[i]);
|
||||
} else if (strcmp(argv[i], "--xml") == 0){
|
||||
xml = 1;
|
||||
} else if (strcmp(argv[i],"--log-file")==0){
|
||||
|
|
@ -240,7 +239,8 @@ int main (int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
|
||||
if( xml_tmp_file != NULL ){
|
||||
if( xml ){
|
||||
xml_tmp_file = ms_strdup_printf("%s.tmp", xml_file);
|
||||
liblinphone_tester_set_xml_output(xml_tmp_file);
|
||||
}
|
||||
liblinphone_tester_enable_xml(xml);
|
||||
|
|
@ -249,8 +249,9 @@ int main (int argc, char *argv[])
|
|||
ret = liblinphone_tester_run_tests(suite_name, test_name);
|
||||
liblinphone_tester_uninit();
|
||||
|
||||
if (xml_tmp_file != NULL) {
|
||||
if ( xml ) {
|
||||
/*create real xml file only if tester did not crash*/
|
||||
ms_strcat_printf(xml_tmp_file, "-Results.xml");
|
||||
rename(xml_tmp_file, xml_file);
|
||||
ms_free(xml_tmp_file);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue