本文整理汇总了PHP中phodevi::allow_phodevi_caching方法的典型用法代码示例。如果您正苦于以下问题:PHP phodevi::allow_phodevi_caching方法的具体用法?PHP phodevi::allow_phodevi_caching怎么用?PHP phodevi::allow_phodevi_caching使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phodevi
的用法示例。
在下文中一共展示了phodevi::allow_phodevi_caching方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_matisk
//.........这里部分代码省略.........
pts_file_io::mkdir(pts_module::save_dir() . $ini['workload']['save_name']);
}
$spent_context_file = pts_module::save_dir() . $ini['workload']['save_name'] . '.spent-contexts';
if (!is_file($spent_context_file)) {
touch($spent_context_file);
} else {
// If recovering from an existing run, don't rerun contexts that were already executed
$spent_contexts = pts_file_io::file_get_contents($spent_context_file);
$spent_contexts = explode(PHP_EOL, $spent_contexts);
foreach ($spent_contexts as $sc) {
if (($key = array_search($sc, $ini['set_context']['context'])) !== false) {
unset($ini['set_context']['context'][$key]);
}
}
}
if ($ini['set_context']['reboot_support'] && phodevi::is_linux()) {
// In case a set-context involves a reboot, auto-recover
$xdg_config_home = is_dir('/etc/xdg/autostart') && is_writable('/etc/xdg/autostart') ? '/etc/xdg/autostart' : pts_client::read_env('XDG_CONFIG_HOME');
if ($xdg_config_home == false) {
$xdg_config_home = pts_client::user_home_directory() . '.config';
}
if ($xdg_config_home != false && is_dir($xdg_config_home)) {
$autostart_dir = $xdg_config_home . '/autostart/';
pts_file_io::mkdir($xdg_config_home . '/autostart/');
}
file_put_contents($xdg_config_home . '/autostart/phoronix-test-suite-matisk.desktop', '
[Desktop Entry]
Name=Phoronix Test Suite Matisk Recovery
GenericName=Phoronix Test Suite
Comment=Matisk Auto-Recovery Support
Exec=gnome-terminal -e \'phoronix-test-suite matisk ' . $args[0] . '\'
Icon=phoronix-test-suite
Type=Application
Encoding=UTF-8
Categories=System;Monitor;');
}
if ($ini['installation']['block_phodevi_caching']) {
// Block Phodevi caching if changing out system components and there is a chance one of the strings of changed contexts might be cached (e.g. OpenGL user-space driver)
phodevi::$allow_phodevi_caching = false;
}
if (phodevi::system_uptime() < 60) {
echo PHP_EOL . 'Sleeping 45 seconds while waiting for the system to settle...' . PHP_EOL;
sleep(45);
}
self::$ini = $ini;
$total_context_count = count(self::$ini['set_context']['context']);
while (($context = array_shift(self::$ini['set_context']['context'])) !== null) {
echo PHP_EOL . ($total_context_count - count(self::$ini['set_context']['context'])) . ' of ' . $total_context_count . ' in test execution queue [' . $context . ']' . PHP_EOL . PHP_EOL;
self::$context = $context;
if (pts_strings::string_bool(self::$ini['installation']['install_check']) || $ini['set_context']['pre_install'] != null) {
self::process_user_config_external_hook_process('pre_install');
$force_install = false;
$no_prompts = true;
if (pts_strings::string_bool(self::$ini['installation']['force_install'])) {
$force_install = true;
}
if (self::$ini['installation']['external_download_cache'] != null) {
pts_test_install_manager::add_external_download_cache(self::$ini['installation']['external_download_cache']);
}
// Do the actual test installation
pts_test_installer::standard_install(self::$ini['workload']['suite'], $force_install, $no_prompts);
self::process_user_config_external_hook_process('post_install');
}
$batch_mode = false;
$auto_mode = true;
$test_run_manager = new pts_test_run_manager($batch_mode, $auto_mode);
if ($test_run_manager->initial_checks(self::$ini['workload']['suite']) == false) {
return false;
}
if (self::$skip_test_set == false) {
self::process_user_config_external_hook_process('pre_run');
// Load the tests to run
if ($test_run_manager->load_tests_to_run(self::$ini['workload']['suite']) == false) {
return false;
}
// Save results?
$result_identifier = $ini['workload']['result_identifier'];
if ($result_identifier == null) {
$result_identifier = '$MATISK_CONTEXT';
}
// Allow $MATIISK_CONTEXT as a valid user variable to pass it...
$result_identifier = str_replace('$MATISK_CONTEXT', self::$context, $result_identifier);
$test_run_manager->set_save_name(self::$ini['workload']['save_name']);
$test_run_manager->set_results_identifier($result_identifier);
$test_run_manager->set_description(self::$ini['workload']['description']);
// Don't upload results unless it's the last in queue where the context count is now 0
$test_run_manager->auto_upload_to_openbenchmarking(count(self::$ini['set_context']['context']) == 0 && self::$ini['general']['upload_to_openbenchmarking']);
// Run the actual tests
$test_run_manager->pre_execution_process();
$test_run_manager->call_test_runs();
$test_run_manager->post_execution_process();
}
self::$skip_test_set = false;
file_put_contents($spent_context_file, self::$context . PHP_EOL, FILE_APPEND);
pts_file_io::unlink(pts_module::save_dir() . self::$context . '.last-call');
self::process_user_config_external_hook_process('post_run');
}
unlink($spent_context_file);
isset($xdg_config_home) && pts_file_io::unlink($xdg_config_home . '/autostart/phoronix-test-suite-matisk.desktop');
}