New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
read_trusting.php in trunk/NEMOGCM/TRUST/web – NEMO

source: trunk/NEMOGCM/TRUST/web/read_trusting.php @ 5936

Last change on this file since 5936 was 5936, checked in by nicolasmartin, 8 years ago

Merge dev_r5092_CNRS18_TRUST onto the trunk: add new tool Trusting (ie TRUST directory at root of NEMGOCM) for continuous integration tests on HPC centers & basic validation tests for developers

File size: 1.2 KB
Line 
1
2<?php
3
4$num=1;
5
6function read_trusting ($file) { 
7
8  global $num;
9  $row = 1;
10
11  if (($handle = fopen($file, "r")) !== FALSE) {
12
13    while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
14
15      switch ($row) {
16        case 1: 
17     $num1 = count($data);
18     print("<thead>\n\n"); print("<tr class=\"title\">\n");
19     break;
20        default: 
21     if   ( $row % 2 == 1 ) { print("<tr class=\"odd\">\n") ; }
22     else                   { print("<tr class=\"even\">\n"); }
23      }
24
25      $num = count($data);
26      #echo "<p> $num champs ligne $row: <br /></p>\n";
27
28      for ($c=0; $c<$num1; $c++) {
29        #echo $data[$c] . "<br />\n";
30   if ($c > $num ) { $var=""; } else { $var=trim($data[$c]); }
31
32   switch ($var) { 
33     case "FAILED"   : print("<td bgcolor=\"#FF6666\">".$var."</td>\n"); break;
34     case "Different": print("<td bgcolor=\"#FFFF99\">".$var."</td>\n"); break;
35     case "OK"       : print("<td bgcolor=\"#92CA89\">".$var."</td>\n"); break;
36     default         : print("<td>".$var."</td>\n")                           ;
37   }
38
39      }
40
41      print("</tr>\n\n");
42      if ( $row == 1 ) { print("</thead>\n\n"); print("<tbody>\n\n"); }
43      $row++;
44    }
45
46    fclose($handle);
47  }
48
49  print("</tbody>\n");
50}
51
52?>
Note: See TracBrowser for help on using the repository browser.