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(); }
function get_test_subjects() { return get_all_scripts(); }