blob: 591b59303f277e06d565674d0457756ff1e23301 [file] [log] [blame]
Jim Cownie18d84732014-05-10 17:02:09 +00001int main()
2{
3 int i; /* Loop index */
4 int result; /* return value of the program */
5 int failed=0; /* Number of failed tests */
6 int success=0; /* number of succeeded tests */
7 static FILE * logFile; /* pointer onto the logfile */
Andrey Churbanova951e212015-04-29 14:36:38 +00008 static const char * logFileName = "<testfunctionname></testfunctionname>.log"; /* name of the logfile */
Jim Cownie18d84732014-05-10 17:02:09 +00009
10
11 /* Open a new Logfile or overwrite the existing one. */
12 logFile = fopen(logFileName,"w+");
13
14 printf("######## OpenMP Validation Suite V %s ######\n", OMPTS_VERSION );
15 printf("## Repetitions: %3d ####\n",REPETITIONS);
16 printf("## Loop Count : %6d ####\n",LOOPCOUNT);
17 printf("##############################################\n");
18 printf("Testing <directive></directive>\n\n");
19
20 fprintf(logFile,"######## OpenMP Validation Suite V %s ######\n", OMPTS_VERSION );
21 fprintf(logFile,"## Repetitions: %3d ####\n",REPETITIONS);
22 fprintf(logFile,"## Loop Count : %6d ####\n",LOOPCOUNT);
23 fprintf(logFile,"##############################################\n");
24 fprintf(logFile,"Testing <directive></directive>\n\n");
25
26 for ( i = 0; i < REPETITIONS; i++ ) {
27 fprintf (logFile, "\n\n%d. run of <testfunctionname></testfunctionname> out of %d\n\n",i+1,REPETITIONS);
28 if(<testfunctionname></testfunctionname>(logFile)){
29 fprintf(logFile,"Test successful.\n");
30 success++;
31 }
32 else {
33 fprintf(logFile,"Error: Test failed.\n");
34 printf("Error: Test failed.\n");
35 failed++;
36 }
37 }
38
39 if(failed==0){
40 fprintf(logFile,"\nDirective worked without errors.\n");
41 printf("Directive worked without errors.\n");
42 result=0;
43 }
44 else{
45 fprintf(logFile,"\nDirective failed the test %i times out of %i. %i were successful\n",failed,REPETITIONS,success);
46 printf("Directive failed the test %i times out of %i.\n%i test(s) were successful\n",failed,REPETITIONS,success);
47 result = (int) (((double) failed / (double) REPETITIONS ) * 100 );
48 }
49 printf ("Result: %i\n", result);
50 return result;
51}