projects / phoronix-test-suite.git / commitdiff
Build Results
 
Summary

Description: Phoronix Test Suite open-source benchmarking development
Last Change: Mon 12/15/14 13:00

Recent Commits
Time
Signed-Off By
Description
Commit Diff
Mon 12/15/14 13:00
Michael Larabel  
phoromatic: Move IP info... 
Mon 12/15/14 12:07
Michael Larabel  
phoromatic: Attempt to... 
Mon 12/15/14 11:45
Michael Larabel  
phoromatic: Add... 
Mon 12/15/14 11:26
Michael Larabel  
phoromatic: Improve... 
Tue 12/9/14 12:04
Michael Larabel  
pts-core: Add... 
Tue 12/9/14 11:20
Michael Larabel  
Phoronix Test Suite... 
 
> --git a/CHANGE-LOG b/CHANGE-LOG
index e51a744
..484a216 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -4,+4,@@ Phoronix Test Suite (Git)

 - 
pts-coreImprovement for detecting errors from failed test installations
 
pts-coreAllow "Deprecated" flag for ProfileStatus in the XML test profile schema
+- pts-coreSupport for scanning test run log files automatically to look for errors when tests fail to execute

 Phoronix Test Suite 4.4 Milestone 1
 23 January 2013
diff 
--git a/pts-core/objects/client/pts_test_execution.php b/pts-core/objects/client/pts_test_execution.php
index 5b4904d
..6ee2d0a 100644
--- a/pts-core/objects/client/pts_test_execution.php
+++ b/pts-core/objects/client/pts_test_execution.php
@@ -180,+180,16 @@ class pts_test_execution
                 
if($exit_status != && phodevi::is_bsd() == false)
                 {
                     
pts_client::$display->test_run_instance_error('The test exited with a non-zero exit status.');
+                    if(
is_file($test_log_file))
+                    {
+                        
$scan_log pts_file_io::file_get_contents($test_log_file);
+                        
$test_run_error pts_tests::scan_for_error($scan_log$test_run_request->test_profile->get_test_executable_dir());
+
+                        if(
$test_run_error)
+                        {
+                            
pts_client::$display->test_run_instance_error('E: ' $test_run_error);
+                        }
+                    }
                     
$exit_status_pass false;
                 }
             }
@@ -
199,10 +209,20 @@ class pts_test_execution

                 
if(!empty($test_result))
                 {
-                    if(
$test_run_time <= 10 && intval($test_result) == $test_result && $test_run_request->test_profile->get_estimated_run_time() > 60)
+                    if(
$test_run_time && intval($test_result) == $test_result && $test_run_request->test_profile->get_estimated_run_time() > 60)
                     {
-                        
// If the test ended in less than 10 seconds, outputted some int, and normally the test takes much longer, then it's likely some invalid run
+                        // If the test ended in less than 5 seconds, outputted some int, and normally the test takes much longer, then it's likely some invalid run
                         
pts_client::$display->test_run_instance_error('The test run ended prematurely.');
+                        if(
is_file($test_log_file))
+                        {
+                            
$scan_log pts_file_io::file_get_contents($test_log_file);
+                            
$test_run_error pts_tests::scan_for_error($scan_log$test_run_request->test_profile->get_test_executable_dir());
+
+                            if(
$test_run_error)
+                            {
+                                
pts_client::$display->test_run_instance_error('E: ' $test_run_error);
+                            }
+                        }
                     }
                     else
                     {
@@ -
211,+231,16 @@ class pts_test_execution
                 
}
                 else if(
$test_run_request->test_profile->get_display_format() != 'NO_RESULT')
                 {
+                    if(
is_file($test_log_file))
+                    {
+                        
$scan_log pts_file_io::file_get_contents($test_log_file);
+                        
$test_run_error pts_tests::scan_for_error($scan_log$test_run_request->test_profile->get_test_executable_dir());
+
+                        if(
$test_run_error)
+                        {
+                            
pts_client::$display->test_run_instance_error('E: ' $test_run_error);
+                        }
+                    }
                     
pts_client::$display->test_run_instance_error('The test run did not produce a result.');
                 }

diff --git a/pts-core/objects/client/pts_test_installer.php b/pts-core/objects/client/pts_test_installer.php
index df8efbb
..e9217af 100644
--- a/pts-core/objects/client/pts_test_installer.php
+++ b/pts-core/objects/client/pts_test_installer.php
@@ -693,41 +693,@@ class pts_test_installer
                         
if(is_file($test_install_directory 'install.log'))
                         {
                             
$install_log pts_file_io::file_get_contents($test_install_directory 'install.log');
-                            foreach(array(
'fatal error''error:''undefined reference''returned 1 exit status''not found') as $error_string)
-                            {
-                                if((
$e strripos($install_log$error_string)) !== false)
-                                {
-
-                                    if((
$line_end strpos($install_logPHP_EOL$e)) !== false)
-                                    {
-                                        
$install_log substr($install_log0$line_end);
-                                    }
-
-                                    if((
$line_start_e strrpos($install_logPHP_EOL)) !== false)
-                                    {
-                                        
$install_log substr($install_log, ($line_start_e 1));
-                                    }
-
-                                    
$install_log str_replace(array(PTS_TEST_PROFILE_PATH$test_install_directory), null$install_log);
-
-                                    if(isset(
$install_log[8]) && !isset($install_log[144]) && strpos($install_logPHP_EOL) === false)
-                                    {
-                                        
$install_error $install_log;
-                                    }
-
-                                }
-                            }
-
-                            if(
$install_error == null && ($s strrpos($install_logPHP_EOL)) !== false && stripos($install_log'found'$s) !== false && stripos($install_log'no', ($s 1)) !== false)
-                            {
-                                
// See if the last line of the log is e.g. 'No OpenCL Environment Found', 'FFFFF Not Found', Etc
-                                $last_line trim(substr($install_log$s));
-                                if(isset(
$last_line[8]) && !isset($last_line[144]))
-                                {
-                                    
$install_error $last_line;
-                                }
-                            }
-
+                            
$install_error pts_tests::scan_for_error($install_log$test_install_directory);
                             
copy($test_install_directory 'install.log'$test_install_directory 'install-failed.log');
                         }

@@ -
735,+701,@@ class pts_test_installer
                         pts_client
::$display->test_install_error('The installer exited with a non-zero exit status.');
                         if(
$install_error != null)
                         {
-                            
$test_install_request->install_error self::pretty_error_string($install_error);
+                            
$test_install_request->install_error pts_tests::pretty_error_string($install_error);
                             
pts_client::$display->test_install_error('ERROR: ' $test_install_request->install_error);
                         }
                         
pts_client::$display->test_install_error('LOG: ' str_replace(pts_client::user_home_directory(), '~/'$test_install_directory) . 'install-failed.log' PHP_EOL);
@@ -
780,43 +746,@@ class pts_test_installer

         
return $installed;
     }
-    public static function 
pretty_error_string($error)
-    {
-        if((
$t strpos($error'.h: No such file')) !== false)
-        {
-            
$pretty_error substr($errorstrrpos($error' ', (- (strlen($error) - $t))));
-            
$pretty_error substr($pretty_error0strpos($pretty_error':'));
-
-            if(isset(
$pretty_error[2]))
-            {
-                
$error 'Missing Header File: ' trim($pretty_error);
-            }
-        }
-        else if((
$t strpos($error'configure: error: ')) !== false)
-        {
-            
$pretty_error substr($error, ($t strlen('configure: error: ')));
-
-            if((
$t strpos($pretty_error'not found.')) !== false)
-            {
-                
$pretty_error substr($pretty_error0, ($t strlen('not found.')));
-            }
-
-            
$error $pretty_error;
-        }
-        else if((
$t strpos($error': not found')) !== false)
-        {
-            
$pretty_error substr($error0$t);
-            
$pretty_error substr($pretty_error, (strrpos($pretty_error' ') + 1));
-            
$error 'Missing Command: ' $pretty_error;
-        }
-
-        if((
$x strpos($error'See docs')) !== false)
-        {
-            
$error substr($error0$x);
-        }
-
-        return 
trim($error);
-    }
     public static function 
validate_md5_download_file($filename$verified_md5)
     {
         
$valid false;
diff --git a/pts-core/objects/client/pts_tests.php b/pts-core/objects/client/pts_tests.php
index 5a60916
..631f01b 100644
--- a/pts-core/objects/client/pts_tests.php
+++ b/pts-core/objects/client/pts_tests.php
@@ -3,+3,@@
 
/*
     Phoronix Test Suite
     URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
-    Copyright (C) 2008 - 2012, Phoronix Media
-    Copyright (C) 2008 - 2012, Michael Larabel
+    Copyright (C) 2008 - 2013, Phoronix Media
+    Copyright (C) 2008 - 2013, Michael Larabel

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -42,6 +42,82 @@ class pts_tests

         return $cleaned_tests;
     }
+    public static function scan_for_error($log_file, $strip_string)
+    {
+        $error = null;
+
+        foreach(array('fatal error', 'error:', 'undefined reference', 'returned 1 exit status', 'not found') as $error_string)
+        {
+            if(($e = strripos($log_file, $error_string)) !== false)
+            {
+                if(($line_end = strpos($log_file, PHP_EOL, $e)) !== false)
+                {
+                    $log_file = substr($log_file, 0, $line_end);
+                }
+
+                if(($line_start_e = strrpos($log_file, PHP_EOL)) !== false)
+                {
+                    $log_file = substr($log_file, ($line_start_e + 1));
+                }
+
+                $log_file = str_replace(array(PTS_TEST_PROFILE_PATH, $strip_string), null, $log_file);
+
+                if(isset($log_file[8]) && !isset($log_file[144]) && strpos($log_file, PHP_EOL) === false)
+                {
+                    $error = $log_file;
+                }
+            }
+        }
+
+        if($error == null && ($s = strrpos($log_file, PHP_EOL)) !== false && stripos($log_file, 'found', $s) !== false && stripos($log_file, 'no', ($s - 1)) !== false)
+        {
+            // See if the last line of the log is e.g. 'No OpenCL Environment Found', 'FFFFF Not Found', Etc
+            $last_line = trim(substr($log_file, $s));
+            if(isset($last_line[8]) && !isset($last_line[144]))
+            {
+                $error = $last_line;
+            }
+        }
+
+        return $error;
+    }
+    public static function pretty_error_string($error)
+    {
+        if(($t = strpos($error, '.h: No such file')) !== false)
+        {
+            $pretty_error = substr($error, strrpos($error, ' ', (0 - (strlen($error) - $t))));
+            $pretty_error = substr($pretty_error, 0, strpos($pretty_error, ':'));
+
+            if(isset($pretty_error[2]))
+            {
+                $error = 'Missing Header File: ' . trim($pretty_error);
+            }
+        }
+        else if(($t = strpos($error, 'configure: error: ')) !== false)
+        {
+            $pretty_error = substr($error, ($t + strlen('configure: error: ')));
+
+            if(($t = strpos($pretty_error, 'not found.')) !== false)
+            {
+                $pretty_error = substr($pretty_error, 0, ($t + strlen('not found.')));
+            }
+
+            $error = $pretty_error;
+        }
+        else if(($t = strpos($error, ': not found')) !== false)
+        {
+            $pretty_error = substr($error, 0, $t);
+            $pretty_error = substr($pretty_error, (strrpos($pretty_error, ' ') + 1));
+            $error = 'Missing Command: ' . $pretty_error;
+        }
+
+        if(($x = strpos($error, 'See docs')) !== false)
+        {
+            $error = substr($error, 0, $x);
+        }
+
+        return trim($error);
+    }
     public static function extra_environmental_variables(&$test_profile)
     {
         $extra_vars&
 
Phoronix.com
Linux Driver Forums
Copyright © 2014 by Phoronix Media