/* logs */
XBT_LOG_NEW_DEFAULT_CATEGORY(tesh,"TEst SHell utility");
-#ifdef WIN32
+#ifdef _XBT_WIN32
/* Windows specific : the previous process error mode */
static UINT
prev_error_mode = 0;
int
err_kind = 0;
+char*
+err_line = NULL;
+
pid_t
pid =0;
static int
sig_int = 0;
-#ifdef WIN32
+#ifdef _XBT_WIN32
static void
sig_int_handler(int signum)
{
/* then, finalize tesh (release all the allocated memory and exits) */
finalize();
- #ifndef WIN32
+ #ifndef _XBT_WIN32
return exit_code;
#endif
char* buffer;
char* suffix = strdup(".tesh");
- #ifdef WIN32
+ #ifdef _XBT_WIN32
/* Windows specific : don't display the general-protection-fault message box and
* the the critical-error-handler message box (instead the system send the error
* to the calling process : tesh)
xbt_os_sem_destroy(units_sem);
/* Windows specific (restore the previouse error mode */
- #ifdef WIN32
+ #ifdef _XBT_WIN32
SetErrorMode(prev_error_mode);
#endif
if(sig_int)
INFO0("Tesh interrupted (receive a SIGINT)");
- else if(!summary_flag && !dry_run_flag && !silent_flag && !just_print_flag && !print_version_flag && !print_usage_flag && is_tesh_root)
+ else if(!summary_flag && !detail_summary_flag && !dry_run_flag && !silent_flag && !just_print_flag && !print_version_flag && !print_usage_flag && is_tesh_root)
{
if(!exit_code)
INFO2("Tesh terminated with exit code %d : %s",exit_code, "success");
else
- ERROR2("Tesh terminated with exit code `(%s)' (%d)",error_to_string(exit_code, err_kind), exit_code);
+ {
+ if(err_line)
+ ERROR3("Tesh terminated with exit code `(<%s> %s)' (%d)",err_line, error_to_string(exit_code, err_kind), exit_code);
+ else
+ ERROR2("Tesh terminated with exit code `(%s)' (%d)", error_to_string(exit_code, err_kind), exit_code);
+
+ }
}
+
+ if(err_line)
+ free(err_line);
/* exit from the xbt framework */
- xbt_exit();
finalized = 1;
/* get to the last / (if any) to get the short name of the file */
delimiter = strrchr(optarg,'/');
- #ifdef WIN32
+ #ifdef _XBT_WIN32
if(!delimiter)
delimiter = strrchr(optarg,'\\');
#endif
if(ENOENT == errno)
ERROR1("File %s does not exist", optarg);
else
- ERROR0("Insufficient memory is available to process the command line - system error");
+ ERROR1("System error :`(%s)'", strerror(errno));
return -1;
}
delimiter = strrchr(optarg,'/');
- #ifdef WIN32
+ #ifdef _XBT_WIN32
if(!delimiter)
delimiter = strrchr(optarg,'\\');
#endif
delimiter = strrchr(optarg,'/');
- #ifdef WIN32
+ #ifdef _XBT_WIN32
if(!delimiter)
delimiter = strrchr(optarg,'\\');
#endif
if(!screen_cleaned)
{
- #ifdef WIN32
+ #ifdef _XBT_WIN32
system("cls");
#else
system("clear");
{
if(!screen_cleaned)
{
- #ifdef WIN32
+ #ifdef _XBT_WIN32
system("cls");
#else
system("clear");