Skip to content

Commit

Permalink
pts-core: Better parsing of time
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellarabel committed Jul 11, 2016
1 parent f6d4ddd commit 0229f0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/deb-package/build-package-deb.php
Expand Up @@ -63,8 +63,8 @@
$control_file .= "Installed-Size: " . shell_exec("cd /tmp/pts-deb-builder/; du -s | cut -f 1");
$control_file .= "Priority: optional\n";
$control_file .= "Architecture: all\n";
$control_file .= "Depends: php-cli|php5-cli\n";
$control_file .= "Recommends: build-essential, php-gd|php5-gd,\n";
$control_file .= "Depends: php-cli|php5-cli,php5-xml|php-xml\n";
$control_file .= "Recommends: build-essential, php-gd|php5-gd\n";
$control_file .= "Maintainer: Phoronix Media <trondheim-pts@phoronix-test-suite.com>\n";
$control_file .= "Description: An Automated, Open-Source Testing Framework\n " . @str_replace("\n", " ", file_get_contents('pts-core/static/short-description.txt')) . "\n";
$control_file .= "Homepage: http://www.phoronix-test-suite.com/ \n";
Expand Down
10 changes: 10 additions & 0 deletions pts-core/objects/pts_test_result_parser.php
Expand Up @@ -861,6 +861,16 @@ protected static function parse_result_process(&$test_run_request, $parse_xml_fi

// Expand validity checking here
if($is_numeric_check == true && is_numeric($test_result) == false)
{
// E.g. if output time as 06:12.32 (as in blender)
if(substr_count($test_result, ':') == 1 && substr_count($test_result, '.') == 1 && strpos($test_result, '.') > strpos($test_result, ':'))
{
$minutes = substr($test_result, 0, strpos($test_result, ':'));
$seconds = ' ' . substr($test_result, strpos($test_result, ':') + 1);
$test_result = ($minutes * 60) + $seconds;
}
}
if($is_numeric_check == true && is_numeric($test_result) == false)
{
unset($test_results[$x]);
continue;
Expand Down

0 comments on commit 0229f0a

Please sign in to comment.