Esempio n. 1
0
 function run_test($subject)
 {
     $bundle = new AsyncBundle($this, $subject);
     $bundle->commands[0] = get_phc_command_line($subject) . " {$this->flags}";
     $bundle->final = "finish";
     $bundle->start();
 }
Esempio n. 2
0
 function run_test($subject)
 {
     $async = new AsyncBundle($this, $subject);
     $async->commands[0] = $this->get_command_line($subject);
     $async->final = "finish";
     $async->start();
 }
Esempio n. 3
0
 function run_test($subject)
 {
     global $phc, $trunk_CPPFLAGS, $phc_compile_plugin, $working_directory, $base_dir;
     // setup the files
     $plugin_name = tempnam($working_directory, "plugin");
     unlink("{$plugin_name}");
     if (!copy($subject, "{$plugin_name}.cpp")) {
         $this->mark_failure($subject, "Copy failed");
         return;
     }
     $async = new AsyncBundle($this, $subject);
     # phc_compile_plugin only allows CFLAGS and LDFLAGS, even
     # though we use CPPFLAGS
     if ($trunk_CPPFLAGS) {
         $CPPFLAGS = "{$trunk_CPPFLAGS}";
     } else {
         $CPPFLAGS = "''";
     }
     $CPPFLAGS[0] = ' ';
     $CPPFLAGS = "CFLAGS='-Wno-deprecated {$CPPFLAGS}";
     $async->commands[0] = "{$CPPFLAGS} {$phc_compile_plugin} {$plugin_name}.cpp";
     $async->err_handlers[0] = "fail_on_output";
     $async->exit_handlers[0] = "fail_on_output";
     // Check it runs under phc
     $files = get_all_scripts();
     $filename = $files[0];
     // --r-option is a special option for reduce_statements.la, which doesn't harm the other tests.
     $async->commands[1] = "{$phc} --run {$plugin_name}.la {$filename} --r-option 0:1";
     $async->err_handlers[1] = "fail_on_output";
     $async->exit_handlers[1] = "fail_on_output";
     $async->final = "async_success";
     $async->start();
 }
Esempio n. 4
0
 function run_test($subject)
 {
     global $phc;
     $bundle = new AsyncBundle($this, $subject);
     $bundle->commands[0] = get_php_command_line($subject);
     $bundle->out_handlers[0] = "homogenize_output";
     $bundle->callbacks[0] = NULL;
     $commands = array();
     foreach (get_pass_list() as $pass) {
         $commands[] = $this->get_command_line($subject, $this->dump, $pass);
         if ($this->last_pass == $pass) {
             break;
         }
     }
     // A slightly different approach here. We add all the passes. As
     // soon as once succeeds, we pass the test. If none succeeds, the
     // fail.
     foreach ($commands as $command) {
         $bundle->commands[] = $command;
         $bundle->out_handlers[] = "homogenize_output";
         $bundle->callbacks[] = "check_output";
     }
     $bundle->final = "finish";
     $bundle->start();
 }
 function run_test($subject)
 {
     $bundle = new AsyncBundle($this, $subject);
     $bundle->commands[0] = get_phc_command_line($subject) . " --run=plugins/tests/raise_globals.la -O1";
     $bundle->final = "finish";
     $bundle->start();
 }
Esempio n. 6
0
 function run_test($subject)
 {
     global $phc;
     $bundle = new AsyncBundle($this, $subject);
     $bundle->commands[0] = get_phc_command_line($subject) . " --generate-c";
     $bundle->final = "finish";
     $bundle->start();
 }
Esempio n. 7
0
 function run_test($subject)
 {
     global $phc;
     $async = new AsyncBundle($this, $subject);
     $async->commands[0] = "cat {$subject} | {$phc} --pretty-print";
     $async->commands[1] = "{$phc} --pretty-print {$subject} 2>&1 | {$phc} --pretty-print";
     $async->final = "two_command_finish";
     $async->start();
 }
Esempio n. 8
0
 function run_test($subject)
 {
     global $phc;
     $async = new AsyncBundle($this, $subject);
     $async->commands[0] = "{$phc} {$subject} --{$this->dump}={$this->pass}";
     $async->err_handlers[0] = "fail_on_output";
     $async->final = "async_success";
     $async->start();
 }
Esempio n. 9
0
 function run_test($subject)
 {
     $async = new AsyncBundle($this, $subject);
     $async->commands[0] = $this->get_command_line1($subject);
     $async->out_handlers[0] = "homogenize_output";
     $async->commands[1] = $this->get_command_line2($subject);
     $async->out_handlers[1] = "homogenize_output";
     $async->final = "two_command_finish";
     $async->start();
 }
Esempio n. 10
0
 function run_test($subject)
 {
     global $phc;
     global $graphviz_gc;
     $async = new AsyncBundle($this, $subject);
     $async->commands[0] = "{$phc} --dump-parse-tree {$subject} | {$graphviz_gc}";
     // there is output. Dont fail.
     $async->err_handlers[0] = "fail_on_output";
     $async->final = "async_success";
     $async->start();
 }
Esempio n. 11
0
 function run_test($subject)
 {
     global $phc;
     $bundle = new AsyncBundle($this, $subject);
     $bundle->commands[0] = get_phc_command_line($subject) . " --pretty-print";
     $bundle->out_handlers[0] = "strip_whitespace";
     $bundle->err_handlers[0] = "fail_on_output";
     $bundle->commands[1] = "cat {$subject}";
     $bundle->out_handlers[1] = "strip_whitespace";
     $bundle->err_handlers[1] = "fail_on_output";
     $bundle->final = "two_command_finish";
     $bundle->start();
 }
Esempio n. 12
0
 function run_test($subject)
 {
     $async = new AsyncBundle($this, $subject);
     $async->commands[0] = $this->get_php_command($subject);
     $async->out_handlers[0] = "homogenize_output";
     $exe_name = wd_name("{$subject}.out." . $this->get_name());
     $async->commands[1] = $this->get_phc_command($subject, $exe_name);
     $async->err_handlers[1] = "fail_on_output";
     $async->exit_handlers[1] = "fail_on_output";
     $async->commands[2] = "{$exe_name}";
     $async->out_handlers[2] = "homogenize_output";
     $async->final = "finish";
     $async->start();
 }
Esempio n. 13
0
 function run_test($subject)
 {
     global $phc;
     $bundle = new AsyncBundle($this, $subject);
     $passes = get_pass_list();
     $last_pass = $passes[count($passes) - 1];
     # Get the output going straight though the compiler
     $bundle->commands[0] = $this->get_command_line($last_pass, $subject);
     $bundle->out_handlers[0] = "homogenize_output";
     $bundle->commands[1] = $this->get_long_command_line($subject, $last_pass);
     $bundle->out_handlers[1] = "homogenize_output";
     $bundle->final = "finish";
     $bundle->start();
 }