public function initial_checks(&$to_run, $override_display_mode = false) { // Refresh the pts_client::$display in case we need to run in debug mode if (pts_client::$display == false || !pts_client::$display instanceof pts_websocket_display_mode) { pts_client::init_display_mode($override_display_mode); } $to_run = pts_types::identifiers_to_objects($to_run); if ($this->batch_mode && $this->batch_mode['Configured'] == false && !$this->auto_mode) { trigger_error('The batch mode must first be configured.' . PHP_EOL . 'To configure, run phoronix-test-suite batch-setup', E_USER_ERROR); return false; } if (!is_writable(pts_client::test_install_root_path())) { trigger_error('The test installation directory is not writable.' . PHP_EOL . 'Location: ' . pts_client::test_install_root_path(), E_USER_ERROR); return false; } // Cleanup tests to run if (pts_test_run_manager::cleanup_tests_to_run($to_run) == false) { return false; } else { if (count($to_run) == 0) { trigger_error('You must enter at least one test, suite, or result identifier to run.', E_USER_ERROR); return false; } } return true; }
public static function identifier_to_object($identifier) { $return = pts_types::identifiers_to_objects($identifier); return isset($return[0]) ? $return[0] : false; }