if(!include->exit_code && !include->interrupted)\r
INFO1("Include from %s OK",include->fstream->name);\r
else if(include->exit_code)\r
- ERROR4("Include `(%s)' NOK : (<%s> %s (%d))", include->fstream->name, command->context->line, error_to_string(include->exit_code, include->err_kind), include->exit_code);\r
+ ERROR3("Include `%s' NOK : (<%s> %s)", include->fstream->name, command->context->line, error_to_string(include->exit_code, include->err_kind));\r
else if(include->interrupted && !include->exit_code)\r
INFO1("Include `(%s)' INTR",include->fstream->name);\r
}\r
{\r
if(!suite->exit_code)\r
{\r
- unit_set_error(suite, ESYNTAX, 1);\r
+ unit_set_error(suite, ESYNTAX, 1, suite->filepos);\r
ERROR2("[%s] Empty suite `(%s)' detected (no includes added)", suite->filepos, suite->description);\r
\r
/* if the --keep-going option is not specified */\r
else if(include->exit_code)\r
{\r
if(!dry_run_flag)\r
- ERROR3("Include `(%s)' NOK : (<%s> %s)", include->fstream->name, command->context->pos, error_to_string(include->exit_code, include->err_kind));\r
+ ERROR3("Include `%s' NOK : (<%s> %s)", include->fstream->name, command->context->pos, error_to_string(include->exit_code, include->err_kind));\r
\r
suite->exit_code = include->exit_code;\r
suite->err_kind = include->err_kind;\r
+ suite->err_line = strdup(include->err_line);\r
}\r
else if(include->interrupted && !include->exit_code)\r
{\r
if(!suite->exit_code && !suite->interrupted)\r
INFO1("Test suite from %s OK",suite->description);\r
else if(suite->exit_code)\r
- ERROR3("Test suite `(%s)' NOK : (<%s> %s) ", suite->description, suite->filepos, error_to_string(suite->exit_code, suite->err_kind));\r
+ ERROR3("Test suite `%s' NOK : (<%s> %s) ", suite->description, suite->err_line, error_to_string(suite->exit_code, suite->err_kind));\r
else if(suite->interrupted && !suite->exit_code)\r
INFO1("Test suite `(%s)' INTR",suite->description);\r
}\r
else if(!root->exit_code)\r
INFO1("Test unit from %s OK",root->fstream->name);\r
else if(root->exit_code)\r
- ERROR2("Test unit `(%s)' : NOK (%s)",root->fstream->name, error_to_string(root->exit_code, root->err_kind)); \r
+ ERROR3("Test unit `%s': NOK (<%s> %s)",root->fstream->name, root->err_line, error_to_string(root->exit_code, root->err_kind)); \r
}\r
\r
/* if it's the last unit, release the runner */\r
unit->sem = NULL;\r
unit->exit_code = 0;\r
unit->err_kind = 0;\r
+ unit->err_line = NULL;\r
unit->filepos = NULL;\r
\r
\r
}\r
\r
void\r
-unit_set_error(unit_t unit, int errcode, int kind)\r
+unit_set_error(unit_t unit, int errcode, int kind, const char* line)\r
{\r
if(!unit->exit_code)\r
{\r
unit->exit_code = errcode;\r
unit->err_kind = kind;\r
+ unit->err_line = strdup(line);\r
\r
if(unit->root && !unit->root->exit_code)\r
{\r
unit->root->exit_code = errcode;\r
unit->root->err_kind = kind;\r
+ unit->root->err_line = strdup(line);\r
}\r
\r
if(!exit_code)\r
\r
exit_code = errcode;\r
err_kind = kind;\r
+ err_line = strdup(line);\r
}\r
}\r
\r
if((*ptr)->description)\r
free((*ptr)->description);\r
\r
+ if((*ptr)->err_line)\r
+ free((*ptr)->err_line);\r
+\r
if((*ptr)->filepos)\r
free((*ptr)->filepos);\r
\r
if(!(unit) || !mutex)\r
{\r
errno = EINVAL;\r
+ xbt_os_sem_release(jobs_sem);\r
return -1;\r
+ \r
}\r
\r
if(!interrupted)\r
unit->thread = xbt_os_thread_create("", unit_start, unit);\r
}\r
else\r
+ {\r
/* the unit is interrupted by the runner before its starting \r
* in this case the unit semaphore is NULL take care of that\r
* in the function unit_free()\r
*/\r
unit->interrupted = 1;\r
+ xbt_os_sem_release(jobs_sem);\r
+ }\r
\r
return 0;\r
\r