diff --git a/test/Makefile.am b/test/Makefile.am index e9ca2fc532..b3a741548f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2,11 +2,14 @@ include $(top_srcdir)/Makefile.incl -TESTS = test_sanity.php \ - test_uc.php \ - test_concat.php \ +TESTS = test_sanity.php \ + test_uc.php \ + test_concat.php \ test_1sec.php \ - test_rsc.php + test_rsc.php \ + test_backend.php + +# test_sticky.php EXTRA_DIST = \ *.xml *.php *wu *result *output \ diff --git a/test/test.inc b/test/test.inc index 7c3af41b19..c75320dec2 100644 --- a/test/test.inc +++ b/test/test.inc @@ -66,7 +66,7 @@ function verbose_echo($level, $line) echo "$line\n"; } else if (VERBOSE == 1) { echo "\r "; - echo "\r$line"; + echo "\r$line "; } } } @@ -969,7 +969,7 @@ class Host { $enc_url = str_replace("/", "_", $enc_url); $path= "$this->host_dir/projects/$enc_url/$filename"; if (!file_exists($path)) { - echo "ERROR: file $path doesn't exist\n"; + error("file $path doesn't exist"); } } } diff --git a/test/test_backend.php b/test/test_backend.php index df7b7f1918..701c7442f1 100644 --- a/test/test_backend.php +++ b/test/test_backend.php @@ -1,5 +1,7 @@ -#! /usr/local/bin/php -add_user($user,$project); $host->install(); - echo "adding work\n"; - $work->install($project); $project->start_servers(); // Start by generating a batch of 500 results - echo "Generating 500 results... "; - while( $project->num_wus_left() < 500 ) sleep(1); - echo "done.\n"; + $n = 0; + while($n < 500 ) { + $n = $project->num_wus_left(); + verbose_echo(1, "Generating results [$n/500]"); + sleep(1); + } + verbose_echo(1, "Generating results... 500 done"); // Stop the project, deinstall make_work, and install the normal backend components $project->stop(); @@ -72,5 +76,5 @@ // Stop the server $project->stop(); - exit($retval); -?> + test_done(); +} ?> diff --git a/test/test_sticky.php b/test/test_sticky.php index 9856cb98e5..9e4c334562 100644 --- a/test/test_sticky.php +++ b/test/test_sticky.php @@ -1,27 +1,23 @@ -#! /usr/local/bin/php -add_user($user); - $project->add_app($app); - $project->add_app_version($app_version); + $project->add_app_and_version("upper_case"); $project->install(); // must install projects before adding to hosts $project->install_feeder(); - $host->log_flags = "log_flags.xml"; $host->add_user($user,$project); $host->install(); - echo "adding work\n"; - $work = new Work($app); $work->wu_template = "uc_wu_sticky"; $work->result_template = "uc_result_sticky"; @@ -42,4 +38,5 @@ $host->check_file_present($project, "uc_wu_sticky_0_0"); $host->check_file_present($project, "uc_wu_sticky_1_0"); -?> + test_done(); +} ?> diff --git a/test/test_uc_slow.php b/test/test_uc_slow.php index d1907e627f..f2015536db 100644 --- a/test/test_uc_slow.php +++ b/test/test_uc_slow.php @@ -1,34 +1,31 @@ -#! /usr/local/bin/php - -add_user($user); - $project->add_app($app); - $project->add_app_version($app_version); + $project->add_app_and_version("upper_case"); $project->install(); // must install projects before adding to hosts - $host->log_flags = "log_flags.xml"; - $host->add_project($project); + $host->add_user($user, $project); $host->install(); - echo "adding work\n"; - - $work = new Work($app); + $work = new Work(); $work->wu_template = "ucs_wu"; $work->result_template = "ucs_result"; array_push($work->input_files, "small_input"); $work->install($project); - $project->start_feeder(); - echo "Now run the client manually; start and stop it a few times\n"; + $project->install_feeder(); + $project->start_servers(); + + verbose_echo(0, "Now run the client manually; start and stop it a few times"); //compare_file("ucs_wu_0_0", "uc_small_correct_output"); -?> +} ?>