コード例 #1
0
 public static function __post_test_run(&$test_result)
 {
     if ($test_result->test_profile->get_test_hardware_type() != 'Graphics') {
         return;
     }
     // Check for video resolution changes
     // Access the xrandr resolution directly to ensure it's not polling the FB size or one of the KMS modes
     $current_res = phodevi_gpu::gpu_xrandr_resolution();
     if ($current_res != self::$start_video_resolution && self::$start_video_resolution != array(-1, -1)) {
         $video_width = $current_res[0];
         $video_height = $current_res[1];
         $reset = self::$start_video_resolution;
         $reset_width = $reset[0];
         $reset_height = $reset[1];
         //	echo '\nThe video resolution had changed during testing and it was not properly reset! Now resetting to $reset_width x $reset_height from $video_width x $video_height.\n';
         phodevi::set_property('gpu', 'screen-resolution', array($reset_width, $reset_height));
         // Sleep for three seconds to allow time for display to settle after mode-set
         sleep(3);
     }
     if (phodevi::is_nvidia_graphics()) {
         $current_error_position = self::nvidia_gpu_error_count();
         if ($current_error_position > self::$error_pointer && $test_result instanceof pts_test_result) {
             // GPU Error(s) Happened During The Test
             $this_test = $test_result->test_profile->get_identifier();
             $this_error_count = $current_error_position - self::$error_pointer;
             if (isset(self::$error_analysis[$this_test])) {
                 $this_error_count += self::$error_analysis[$this_test];
             }
             self::$error_analysis[$this_test] = $this_error_count;
             // Tally up errors for this test
             self::$error_count += $this_error_count;
             // Add to total error count
             self::$error_pointer = $current_error_position;
             // Reset the pointer
         }
     }
 }