debug savelog option

This commit is contained in:
2023-10-09 23:57:32 +02:00
parent ed9bf2221a
commit c467d1b10e
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
#include "ftest/ftest.h" #include "ftest/ftest.h"
#include <dirent.h> //#include <dirent.h>
/* /*
* by default display in millisecond * by default display in millisecond
@@ -1220,7 +1220,7 @@ final_parallel_test_()
if(savelog){ if(savelog){
FILE *f_savelog; FILE *f_savelog;
f_savelog=fopen(savelog, "w+"); f_savelog=fopen(savelog, "a");
for(size_t id_thrd =0 ; id_thrd <= parallel_nb; ++id_thrd){ for(size_t id_thrd =0 ; id_thrd <= parallel_nb; ++id_thrd){
rewind(f_ou_th[id_thrd]); // put the file pointer to the begin of file; rewind(f_ou_th[id_thrd]); // put the file pointer to the begin of file;
while(fgets(reader, 255,f_ou_th[id_thrd] )){ while(fgets(reader, 255,f_ou_th[id_thrd] )){
+4 -4
View File
@@ -90,7 +90,7 @@ extern char *varHK_EQ, *varHK_TR, *varHK_RN, *varHK_DN, *varHK_OK, *varHK_FL, *v
if (stream == NULL) { fprintf(stderr," error open_memstream %s:%d:%s \n",__FILE__,__LINE__,__func__); exit(0); }\ if (stream == NULL) { fprintf(stderr," error open_memstream %s:%d:%s \n",__FILE__,__LINE__,__func__); exit(0); }\
fprintf(stream, __VA_ARGS__); \ fprintf(stream, __VA_ARGS__); \
fflush(stream);\ fflush(stream);\
rewind(stream);\ /*rewind(stream);*/\
if(is_parallel_nb){\ if(is_parallel_nb){\
long int id_thread=id_of_thread_executed();\ long int id_thread=id_of_thread_executed();\
if(log_parallel){\ if(log_parallel){\
@@ -112,13 +112,13 @@ extern char *varHK_EQ, *varHK_TR, *varHK_RN, *varHK_DN, *varHK_OK, *varHK_FL, *v
} \ } \
else{\ else{\
if(savelog){\ if(savelog){\
FILE *f_savelog = fopen(savelog,"w+");\ FILE *f_savelog = fopen(savelog,"a");\
fprintf(f_savelog, "%s",buf);\ fprintf(f_savelog, "%s",buf);\
fclose(f_savelog);\ fclose(f_savelog);\
}\ }\
else{\ /*else{*/\
fprintf(F_OUT, "%s",buf);\ fprintf(F_OUT, "%s",buf);\
}\ /*}*/\
}\ }\
fclose(stream);\ fclose(stream);\
free(buf);\ free(buf);\
Binary file not shown.
Binary file not shown.