diff --git a/test/init.inc b/test/init.inc index f87dab58b1..1c23a5aaa9 100644 --- a/test/init.inc +++ b/test/init.inc @@ -132,28 +132,46 @@ function add_platform($platform) { } } -function add_core_client_message($message, $priority) { +function add_core_client_message($message, $priority, $platform) { global $BOINC_DOWNLOAD_DIR; global $BOINC_UPLOAD_DIR; global $BOINC_PLATFORM; + if( $platform == null ) { + $plat = $BOINC_PLATFORM; + } else { + $plat = $platform; + } PassThru("../tools/add app -app_name core_client -version ".VERSION); - PassThru("../tools/add app_version -app_name core_client -platform_name $BOINC_PLATFORM -version ".VERSION." -exec_dir ../client -exec_file ".CORE_CLIENT." -download_dir $BOINC_DOWNLOAD_DIR -url_base $BOINC_URL_BASE -message '$message' -message_priority '$priority'"); + PassThru("../tools/add app_version -app_name core_client -platform_name $plat -version ".VERSION." -exec_dir ../client -exec_file ".CORE_CLIENT." -download_dir $BOINC_DOWNLOAD_DIR -url_base $BOINC_URL_BASE -message '$message' -message_priority '$priority'"); PassThru("cp ../client/".CORE_CLIENT." $BOINC_DOWNLOAD_DIR"); } -function add_core_client() { - add_core_client_message("", ""); +function add_core_client($platform) { + add_core_client_message("", "", $platform); } -function add_app($name) { +function add_app($name,$platform,$exec_name) { + PassThru("../tools/add app -app_name $name -version ".VERSION); + add_app_version( $name, $platform, $exec_name ); +} + +function add_app_version($name,$platform,$exec_name) { global $BOINC_DOWNLOAD_DIR; global $BOINC_PLATFORM; global $BOINC_URL_BASE; - PassThru("../tools/add app -app_name $name -version ".VERSION); - PassThru("../tools/add app_version -app_name $name -platform_name $BOINC_PLATFORM -version ".VERSION." -exec_dir ../apps -exec_file $name -download_dir $BOINC_DOWNLOAD_DIR -url_base $BOINC_URL_BASE"); - PassThru("cp ../apps/$name $BOINC_DOWNLOAD_DIR"); + if( $exec_name == null ) { + $exec_name = $name; + } + if( $platform == null ) { + $plat = $BOINC_PLATFORM; + } else { + $plat = $platform; + } + + PassThru("../tools/add app_version -app_name $name -platform_name $plat -version ".VERSION." -exec_dir ../apps -exec_file $exec_name -download_dir $BOINC_DOWNLOAD_DIR -url_base $BOINC_URL_BASE"); + PassThru("cp ../apps/$exec_name $BOINC_DOWNLOAD_DIR"); } function create_work($x) { diff --git a/test/sah_test.php b/test/sah_test.php index 474064bb6e..022e2e5207 100755 --- a/test/sah_test.php +++ b/test/sah_test.php @@ -12,9 +12,9 @@ init_client_dirs("account_sah.xml"); copy_to_download_dir("work_unit.sah"); add_platform(); - add_core_client(); + add_core_client(null); add_user(null); - add_app("setiathome-3.06"); + add_app("setiathome-3.06",null,null); create_work("-appname setiathome-3.06 -wu_name sah_wu -wu_template sah_wu -result_template sah_result -nresults 1 work_unit.sah"); echo "starting feeder\n"; start_feeder(); diff --git a/test/test_concat.php b/test/test_concat.php index 4054af752e..eb3463677e 100644 --- a/test/test_concat.php +++ b/test/test_concat.php @@ -13,9 +13,9 @@ init_client_dirs("prefs1.xml"); copy_to_download_dir("input"); add_platform(null); - add_core_client(); + add_core_client(null); add_user(null); - add_app("concat"); + add_app("concat",null,null); create_work("-appname concat -wu_name concat_wu -wu_template concat_wu -result_template concat_result -nresults 2 input input"); start_feeder(); run_client("-exit_when_idle"); diff --git a/test/test_uc.php b/test/test_uc.php index c8f641193e..bce55aeb98 100644 --- a/test/test_uc.php +++ b/test/test_uc.php @@ -14,7 +14,7 @@ copy_to_download_dir("input"); add_platform(null); add_user(null); - add_app("upper_case"); + add_app("upper_case",null,null); create_work("-appname upper_case -rsc_iops 180000000000.0 -rsc_fpops 0.0 -wu_name uc_wu -wu_template uc_wu -result_template uc_result -nresults 5 input input input input input"); start_feeder(); //run_client("-exit_after 10");