A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Error message pretty printing (to ease grepping on the automatic ranking of my studen...
[simgrid.git]
/
tools
/
tesh
/
tesh.c
diff --git
a/tools/tesh/tesh.c
b/tools/tesh/tesh.c
index
3ad2a76
..
19557d1
100644
(file)
--- a/
tools/tesh/tesh.c
+++ b/
tools/tesh/tesh.c
@@
-21,7
+21,7
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(tesh,"TEst SHell utility");
/*** Options ***/
int timeout_value = 5; /* child timeout value */
/*** Options ***/
int timeout_value = 5; /* child timeout value */
-
+char *testsuite_name;
static void handle_line(const char * filepos, char *line) {
int pos;
static void handle_line(const char * filepos, char *line) {
int pos;
@@
-59,7
+59,8
@@
static void handle_line(const char * filepos, char *line) {
char buff[256];
strerror_r(errno, buff, 256);
char buff[256];
strerror_r(errno, buff, 256);
- ERROR2("Chdir to %s failed: %s",dir+pos+2,buff);
+ perror(bprintf("Chdir to %s failed: %s",dir+pos+2,buff));
+ ERROR1("Test suite `%s': NOK (system error)",testsuite_name);
exit(4);
}
break;
exit(4);
}
break;
@@
-80,6
+81,7
@@
static void handle_line(const char * filepos, char *line) {
default:
ERROR2("[%s] Syntax error: %s",filepos, line);
default:
ERROR2("[%s] Syntax error: %s",filepos, line);
+ ERROR1("Test suite `%s': NOK (syntax error)",testsuite_name);
exit(1);
break;
}
exit(1);
break;
}
@@
-112,6
+114,7
@@
static void handle_suite(const char* filename, FILE* IN) {
if (!rctx->cmd && !rctx->is_empty) {
ERROR1("[%d] Error: no command found in this chunk of lines.",
buffbegin);
if (!rctx->cmd && !rctx->is_empty) {
ERROR1("[%d] Error: no command found in this chunk of lines.",
buffbegin);
+ ERROR1("Test suite `%s': NOK (syntax error)",testsuite_name);
exit(1);
}
if (rctx->cmd)
exit(1);
}
if (rctx->cmd)
@@
-198,9
+201,11
@@
int main(int argc,char *argv[]) {
suitename[strlen(suitename)-5] = '\0';
INFO1("Test suite `%s'",suitename);
suitename[strlen(suitename)-5] = '\0';
INFO1("Test suite `%s'",suitename);
+ testsuite_name = suitename;
IN=fopen(argv[i], "r");
if (!IN) {
perror(bprintf("Impossible to open the suite file `%s'",argv[i]));
IN=fopen(argv[i], "r");
if (!IN) {
perror(bprintf("Impossible to open the suite file `%s'",argv[i]));
+ ERROR1("Test suite `%s': NOK (system error)",testsuite_name);
exit(1);
}
handle_suite(suitename,IN);
exit(1);
}
handle_suite(suitename,IN);