noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 04/06: Task #1044 - Implementation de Test Te


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 04/06: Task #1044 - Implementation de Test Test files
Date: Sat, 15 Nov 2014 01:23:57 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 8b9f4fb2c0626d71743e78c328983b4d88d269d7
Author: Dany De Bontridder <address@hidden>
Date:   Sat Nov 15 02:15:29 2014 +0100

    Task #1044 - Implementation de Test
    Test files
---
 html/test.php |   78 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 66 insertions(+), 12 deletions(-)

diff --git a/html/test.php b/html/test.php
index 84f1449..76774e4 100644
--- a/html/test.php
+++ b/html/test.php
@@ -26,8 +26,7 @@
  *  - secund the test must adapted to this page : if you do a post (or get) 
from a test, you won't get any result
  * if the $_REQUEST[test_select] is not set, so set it . 
  */
-$start_mem=memory_get_usage();
-$start_time=microtime(true);
+
 
 
 include_once("../include/constant.php");
@@ -69,25 +68,34 @@ if ($script=="")
      */
     $scan=scandir('../scenario/');
     $max=count($scan);
-    
+
     echo '<table>';
+    $get='test.php?'.http_build_query(array('script'=>"all", 
'gDossier'=>$gDossierLogInput, 'description'=>"Tous les scripts"));
+    echo '<tr>';
+    echo '<td>';
+    echo '<a href="'.$get.'" target="_blank">';
+    echo "Tous ";
+    echo '</a>';
+    echo '</td>';
+    echo '<td>Tous les scripts</td>';
+    echo '</tr>';
+
     for ($e=0; $e<$max; $e++)
     {
-        if (is_file('../scenario/'.$scan[$e])&&strpos($scan[$e], '.php') == 
true)
+        if (is_file('../scenario/'.$scan[$e])&&strpos($scan[$e], '.php')==true)
         {
             $description="";
             $a_description=file('../scenario/'.$scan[$e]);
             $max_description=count($a_description);
-            for ($w=0;$w<$max_description;$w++)
+            for ($w=0; $w<$max_description; $w++)
             {
-                if (strpos($a_description[$w],'@description:')==true)
+                if (strpos($a_description[$w], '@description:')==true)
                 {
                     $description=$a_description[$w];
-                    
$description=str_replace('//@description:','',$description);
-             
+                    $description=str_replace('//@description:', '', 
$description);
                 }
             }
-            
$get='test.php?'.http_build_query(array('script'=>$scan[$e],'gDossier'=>$gDossierLogInput,'description'=>$description));
+            $get='test.php?'.http_build_query(array('script'=>$scan[$e], 
'gDossier'=>$gDossierLogInput, 'description'=>$description));
             echo '<tr>';
             echo '<td>';
             echo '<a href="'.$get.'" target="_blank">';
@@ -100,10 +108,56 @@ if ($script=="")
     }
     echo '</table>';
 }
+else if ($script=='all')
+{
+    $scan=scandir('../scenario/');
+    $maxscan=count($scan);
+
+    echo '<table>';
+    for ($e_scan=0; $e_scan<$maxscan; $e_scan++)
+    {
+        if (is_file('../scenario/'.$scan[$e_scan])&&strpos($scan[$e_scan], 
'.php')==true)
+        {
+            $description="";
+            $a_description=file('../scenario/'.$scan[$e_scan]);
+            $max_description=count($a_description);
+            for ($w=0; $w<$max_description; $w++)
+            {
+                if (strpos($a_description[$w], '@description:')==true)
+                {
+                    $description=$a_description[$w];
+                    $description=str_replace('//@description:', '', 
$description);
+                }
+            }
+            $start_mem=memory_get_usage();
+            $start_time=microtime(true);
+            $script=str_replace('../', '', $script);
+
+            echo '<h1>'.$script."</h1>";
+            echo '<h2> description = '.$description.'</h2>';
+            include '../scenario/'.$scan[$e_scan];
+            echo '</div>';
+            echo '</div>';
+            $end_mem=memory_get_usage();
+            $end_time=microtime(true);
+
+            echo "<p>start mem : ".$start_mem;
+            echo '</p>';
+            echo "<p>end mem : ".$end_mem;
+            echo '</p>';
+            echo "<p>Diff = ".($end_mem-$start_mem)." bytes ";
+            echo "<p>Diff = ".(round(($end_mem-$start_mem)/1024, 2))." kbytes 
";
+            echo "<p>Diff = ".(round(($end_mem-$start_mem)/1024/1024, 2))." 
Mbytes ";
+            echo '</p>';
+            echo "<p>Execution script ".$script." time = 
".(round(($end_time-$start_time), 4))." secondes</p>";
+        }
+    }
+}
 else
 {
-    
-    $script=str_replace('../','',$script);
+    $start_mem=memory_get_usage();
+    $start_time=microtime(true);
+    $script=str_replace('../', '', $script);
     $description=HtmlInput::default_value_get("description", "aucune 
description");
     echo '<h1>'.$script."</h1>";
     echo '<p> description = '.$description.'<p>';
@@ -121,4 +175,4 @@ else
     echo "<p>Diff = ".(round(($end_mem-$start_mem)/1024/1024, 2))." Mbytes ";
     echo '</p>';
     echo "<p>Execution script ".$script." time = 
".(round(($end_time-$start_time), 4))." secondes</p>";
-}
\ No newline at end of file
+}    
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]