<?php $file_lists = array("run_tests/bench_lists/RUBiS.txt", "run_tests/bench_lists/RUBBoS.txt"); // There are a list of files in run_test/benches. $all_files = read_from_bench_lists($file_lists); // Each test belongs to a category $categories = array("test/subjects/benchmarks/RUBBoS/PHP", "test/subjects/benchmarks/RUBiS", "test/subjects/benchmarks/webapps/eveactive_1.0", "test/subjects/benchmarks/webapps/mybloggie2.1.3_beta", "test/subjects/benchmarks/webapps/phpSQLiteAdmin-0.2", "test/subjects/benchmarks/webapps/tigerPhpNewsSystem_1.0_beta_build39", "test/subjects/benchmarks/zend/individual"); $flags = array("", "--flow-insensitive ", "--call-string-length=1 ", "--flow-insensitive --call-string-length=1 "); // What stats do we want to find: $stats = array("bbs_analysed", "starred_uses"); // Start looking in the database $db_filename = $argv[1]; echo "Looking in database: {$db_filename}\n"; $DB = new PDO("sqlite:{$db_filename}"); // Check that we have some result in the database for the file in question check_presence($DB, $stats, $all_files); define("DEBUG", 1); function read_from_bench_lists($lists) { $result = array(); foreach ($lists as $list) { l("Using file list: {$list}"); $lines = file($list, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES); $result = array_merge($result, $lines); } return $result; } function check_presence($db, $stats, $files) { global $flags; foreach ($stats as $stat) {
if ($language == $reference) { continue; } if (file_exists('remove.txt')) { if (!in_array($language, $pull_out_from_specials)) { if ($language != $pull_out_from) { my_remove_tokens("{$res_dir}/" . get_translation_name($language), file('remove.txt', FILE_IGNORE_NEW_LINES)); } } } $l_tokens = my_tokens("{$res_dir}/" . get_translation_name($language)); my_diff_handler($reference, $language, my_compare($tokens, $l_tokens)); } //check_presence('../openmcu-ru/Makefile',$localizations); //check_presence('../openmcu-ru/Makefile.in',$localizations); check_presence('../openmcu-ru/mcu.cxx', $localizations); check_template_html($res_dir . '/template.html', $localizations); check_html_cxx('../openmcu-ru/html.cxx', $localizations); //////////////////////////////////////////////////////////////////////////////////////////////////// function get_translation_name($language) { return "local_{$language}.js"; } function my_token_grabber($tokens, $language) { global $res_dir, $pull_out_from, $pull_out_from_specials; $lang_from = $pull_out_from; if (isset($pull_out_from_specials[$language])) { $lang_from = $pull_out_from_specials[$language]; } $f = file("{$res_dir}/" . get_translation_name($lang_from));