Added a test for the time reporting system.

svn path=/trunk/boinc/; revision=247
This commit is contained in:
Michael Gary 2002-07-24 19:47:36 +00:00
parent 20d48bf67a
commit eb9044cbe3
2 changed files with 35 additions and 0 deletions

View File

@ -245,4 +245,16 @@ function clean_api() {
PassThru("rm -f counter app_to_core.xml core_to_app.xml foobar");
}
function compare_time() {
$db_time=mysql_query("select cpu_time from result where name = ucs_wu_0");
$time_file = fopen("time.xml", "r");
fscanf($time_file, "%f", $app_time);
if($db_time != $app_time) {
printf("Time mismatch: app %d server %d\n", $app_time, $db_time);
}
else printf("Times match\n");
fclose($time_file);
PassThru("rm -f time.xml");
}
?>

23
test/test_time.php Normal file
View File

@ -0,0 +1,23 @@
#! /usr/local/bin/php
<?php
// test the time reporting mechanism in the client
//
// You must have done "make" in all source directories
include_once("init.inc");
check_env_vars();
clear_db();
create_keys();
init_client_dirs("prefs1.xml");
copy_to_download_dir("small_input");
add_platform(null);
add_core_client(null);
add_user("prefs.xml");
add_app("uc_slow", null, null);
create_work("-appname uc_slow -wu_name ucs_wu -wu_template ucs_wu -result_template ucs_result -nresults 1 small_input");
start_feeder();
run_client("-exit_when_idle");
compare_file("ucs_wu_0_0", "uc_small_correct_output");
compare_time();
?>