Added a test script for the api.

svn path=/trunk/boinc/; revision=130
This commit is contained in:
Michael Gary 2002-06-24 02:29:51 +00:00
parent 157187bfbd
commit fdc26384bd
6 changed files with 42 additions and 1 deletions

6
test/core_to_app.xml.in Normal file
View File

@ -0,0 +1,6 @@
<graphics_xsize>0</graphics_xsize>
<graphics_ysize>0</graphics_ysize>
<graphics_refresh_period>0</graphics_refresh_period>
<poll_period>0</poll_period>
<checkpoint_period>1</checkpoint_period>
<cpu_time>0</cpu_time>

View File

@ -179,5 +179,21 @@ function check_results_done() {
}
}
function compare_files($out, $correct) {
PassThru("diff $out $correct", $retval);
if ($retval) {
echo "File mismatch: $out $correct\n";
} else {
echo "Files match: $out $correct\n";
}
}
function initialize_api() {
PassThru("cp core_to_app.xml.in core_to_app.xml");
}
function run_api_test() {
PassThru("../api/api_test");
}
?>

View File

@ -4,7 +4,7 @@
<low_water_days>1</low_water_days>
<resource_share>1</resource_share>
<project>
<master_url>http://localhost/</master_url>
<master_url>http://localhost/boinc-cgi/index.html</master_url>
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
</project>
</preferences>

2
test/ta_correct_atc Normal file
View File

@ -0,0 +1,2 @@
<percent_done>0.000000</percent_done>
<cpu_time_at_checkpoint>5.000000</cpu_time_at_checkpoint>

7
test/ta_correct_f Normal file
View File

@ -0,0 +1,7 @@
blah 17 34.500000
foo
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint

10
test/test_api.php Normal file
View File

@ -0,0 +1,10 @@
#! /usr/local/bin/php
<?php
include_once("init.inc");
initialize_api();
run_api_test();
compare_files("app_to_core.xml", "ta_correct_atc");
compare_files("foobar", "ta_correct_f");
?>