--- imach/src/imach.c 2015/08/18 13:32:00 1.194 +++ imach/src/imach.c 2015/08/18 16:28:39 1.195 @@ -1,6 +1,14 @@ -/* $Id: imach.c,v 1.194 2015/08/18 13:32:00 brouard Exp $ +/* $Id: imach.c,v 1.195 2015/08/18 16:28:39 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.195 2015/08/18 16:28:39 brouard + Summary: Adding a hack for testing purpose + + After reading the title, ftol and model lines, if the comment line has + a q, starting with #q, the answer at the end of the run is quit. It + permits to run test files in batch with ctest. The former workaround was + $ echo q | imach foo.imach + Revision 1.194 2015/08/18 13:32:00 brouard Summary: Adding error when the covariance matrix doesn't contain the exact number of lines required by the model line. @@ -700,11 +708,11 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.194 2015/08/18 13:32:00 brouard Exp $ */ +/* $Id: imach.c,v 1.195 2015/08/18 16:28:39 brouard Exp $ */ /* $State: Exp $ */ char version[]="Imach version 0.98q5, August 2015,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015"; -char fullversion[]="$Revision: 1.194 $ $Date: 2015/08/18 13:32:00 $"; +char fullversion[]="$Revision: 1.195 $ $Date: 2015/08/18 16:28:39 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -5440,8 +5448,8 @@ int readdata(char datafile[], int firsto if((fic=fopen(datafile,"r"))==NULL) { - printf("Problem while opening datafile: %s\n", datafile);return 1; - fprintf(ficlog,"Problem while opening datafile: %s\n", datafile);return 1; + printf("Problem while opening datafile: %s\n", datafile);fflush(stdout); + fprintf(ficlog,"Problem while opening datafile: %s\n", datafile);fflush(ficlog);return 1; } i=1; @@ -6289,7 +6297,7 @@ int main(int argc, char *argv[]) char pathr[MAXLINE], pathimach[MAXLINE]; char *tok, *val; /* pathtot */ int firstobs=1, lastobs=10; - int c, h , cpt; + int c, h , cpt, c2; int jl=0; int i1, j1, jk, stepsize=0; int count=0; @@ -6505,6 +6513,10 @@ int main(int argc, char *argv[]) ungetc(c,ficpar); fgets(line, MAXLINE, ficpar); numlinepar++; + if(line[1]=='q'){ /* This #q will quit imach (the answer is q) */ + z[0]=line[1]; + } + /* printf("****line [1] = %c \n",line[1]); */ fputs(line, stdout); //puts(line); fputs(line,ficparo); @@ -7849,7 +7861,7 @@ Please run with mle=-1 to get a correct } end: while (z[0] != 'q') { - printf("\nType q for exiting: "); + printf("\nType q for exiting: "); fflush(stdout); scanf("%s",z); } }