Navigation Menu

Skip to content

Commit

Permalink
pts-core: Reimplement is_results_tracker()
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellarabel committed Oct 13, 2015
1 parent a3ac1d5 commit 734fdeb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pts-core/objects/pts_Graph/pts_graph_lines.php
Expand Up @@ -71,7 +71,7 @@ public function __construct(&$result_object, &$result_file = null, $extra_attrib
// add array_values($json_r)
$this->test_result->test_result_buffer->add_test_result($system, array_values($result_r), array_values($raw_r));
}
$max_count = count($this->graph_identifiers) + 2;
$max_count = count($this->graph_identifiers) + 1;
}

$this->max_count = $max_count;
Expand Down
5 changes: 5 additions & 0 deletions pts-core/objects/pts_render.php
Expand Up @@ -173,6 +173,11 @@ public static function render_graph_process(&$result_object, &$result_file = nul
} */
}

if($result_file->is_results_tracker())
{
$extra_attributes['force_tracking_line_graph'] = 1;
}

if((self::multi_way_identifier_check($result_object->test_result_buffer->get_identifiers()) || (isset($extra_attributes['force_tracking_line_graph']) && $extra_attributes['force_tracking_line_graph'])))
{
//$result_table = false;
Expand Down
17 changes: 17 additions & 0 deletions pts-core/objects/pts_result_file.php
Expand Up @@ -312,6 +312,23 @@ public function is_results_tracker()
$this->is_tracker = false;
}
}

if($this->is_tracker == false && count($identifiers) > 4)
{
// See if only numbers are changing between runs
foreach($identifiers as $i => &$identifier)
{
if(($x = strpos($identifier, ': ')) !== false)
{
$identifier = substr($identifier, ($x + 2));
}
if($i > 0 && pts_strings::remove_from_string($identifier, pts_strings::CHAR_NUMERIC | pts_strings::CHAR_DECIMAL) != pts_strings::remove_from_string($identifiers[($i - 1)], pts_strings::CHAR_NUMERIC | pts_strings::CHAR_DECIMAL))
{
return false;
}
}
$this->is_tracker = true;
}
}
else
{
Expand Down

0 comments on commit 734fdeb

Please sign in to comment.