diff --git a/hphp/runtime/base/program_functions.cpp b/hphp/runtime/base/program_functions.cpp index f11b03e06..8d7ad20bb 100644 --- a/hphp/runtime/base/program_functions.cpp +++ b/hphp/runtime/base/program_functions.cpp @@ -808,6 +808,8 @@ static int execute_program_impl(int argc, char **argv) { "use specified fd for SSL instead of creating a socket") ("admin-port", value(&po.admin_port)->default_value(-1), "start admin listener at specified port") + ("debug-config", value(&po.debugger_options.configFName), + "load specified debugger config file") ("debug-host,h", value(&po.debugger_options.host), "connect to debugger server at specified address") ("debug-port", value(&po.debugger_options.port)->default_value(-1), diff --git a/hphp/test/README.md b/hphp/test/README.md index cfc87ab4d..f9b36a246 100644 --- a/hphp/test/README.md +++ b/hphp/test/README.md @@ -51,6 +51,10 @@ Any suite can have a `config.hdf` file in it that will be used. If one isn't present, then the parent suite it checked recusrivly until we use test/config.hdf. +If a suite contains an `hphpd.hdf` file, all of the files in the suite will be +run with the -m debug and --debug-config _dir_/hphpd.hdf switches added to the +command line. (_dir_ will be replaced by path of the suite directory.) + Name your test in a descriptive manner and when in doubt break your test into many files. You can use comments too so future engineers know if it is a real breakage or they need to change the expected output. diff --git a/hphp/test/quick/debugger/flow.php.norepo b/hphp/test/quick/debugger/flow.php.norepo deleted file mode 100644 index e69de29bb..000000000 diff --git a/hphp/test/quick/debugger/flow.php.opts b/hphp/test/quick/debugger/flow.php.opts deleted file mode 100644 index cf014a32f..000000000 --- a/hphp/test/quick/debugger/flow.php.opts +++ /dev/null @@ -1 +0,0 @@ - -m debug \ No newline at end of file diff --git a/hphp/test/quick/debugger/flow2.php.norepo b/hphp/test/quick/debugger/flow2.php.norepo deleted file mode 100644 index e69de29bb..000000000 diff --git a/hphp/test/quick/debugger/flow2.php.opts b/hphp/test/quick/debugger/flow2.php.opts deleted file mode 100644 index cf014a32f..000000000 --- a/hphp/test/quick/debugger/flow2.php.opts +++ /dev/null @@ -1 +0,0 @@ - -m debug \ No newline at end of file diff --git a/hphp/test/quick/debugger/flow_excep.php.norepo b/hphp/test/quick/debugger/flow_excep.php.norepo deleted file mode 100644 index e69de29bb..000000000 diff --git a/hphp/test/quick/debugger/flow_excep.php.opts b/hphp/test/quick/debugger/flow_excep.php.opts deleted file mode 100644 index cf014a32f..000000000 --- a/hphp/test/quick/debugger/flow_excep.php.opts +++ /dev/null @@ -1 +0,0 @@ - -m debug \ No newline at end of file diff --git a/hphp/test/quick/debugger/flow_gen.php.norepo b/hphp/test/quick/debugger/flow_gen.php.norepo deleted file mode 100644 index e69de29bb..000000000 diff --git a/hphp/test/quick/debugger/flow_gen.php.opts b/hphp/test/quick/debugger/flow_gen.php.opts deleted file mode 100644 index cf014a32f..000000000 --- a/hphp/test/quick/debugger/flow_gen.php.opts +++ /dev/null @@ -1 +0,0 @@ - -m debug \ No newline at end of file diff --git a/hphp/test/quick/debugger/flow_gen_excep.php.norepo b/hphp/test/quick/debugger/flow_gen_excep.php.norepo deleted file mode 100644 index e69de29bb..000000000 diff --git a/hphp/test/quick/debugger/flow_gen_excep.php.opts b/hphp/test/quick/debugger/flow_gen_excep.php.opts deleted file mode 100644 index cf014a32f..000000000 --- a/hphp/test/quick/debugger/flow_gen_excep.php.opts +++ /dev/null @@ -1 +0,0 @@ - -m debug \ No newline at end of file diff --git a/hphp/test/quick/debugger/flow_multistep.php.norepo b/hphp/test/quick/debugger/flow_multistep.php.norepo deleted file mode 100644 index e69de29bb..000000000 diff --git a/hphp/test/quick/debugger/flow_multistep.php.opts b/hphp/test/quick/debugger/flow_multistep.php.opts deleted file mode 100644 index cf014a32f..000000000 --- a/hphp/test/quick/debugger/flow_multistep.php.opts +++ /dev/null @@ -1 +0,0 @@ - -m debug \ No newline at end of file diff --git a/hphp/test/quick/debugger/hphpd.hdf b/hphp/test/quick/debugger/hphpd.hdf new file mode 100644 index 000000000..e32112326 --- /dev/null +++ b/hphp/test/quick/debugger/hphpd.hdf @@ -0,0 +1,68 @@ +UTF8 = 1 +Color = 0 +Color { + SupportedNames { + 1 = black + 2 = red + 3 = green + 4 = brown + 5 = blue + 6 = magenta + 7 = cyan + 8 = gray + 9 = dark_gray + 10 = light_red + 11 = light_green + 12 = yellow + 13 = light_blue + 14 = light_magenta + 15 = light_cyan + 16 = white + } + Palette { + emacs { + Keyword = CYAN + Comment = RED + String = GREEN + Variable = BROWN + Html = GRAY + Tag = MAGENTA + Declaration = BLUE + Constant = MAGENTA + LineNo = GRAY + } + vim { + Keyword = MAGENTA + Comment = BLUE + String = RED + Variable = CYAN + Html = GRAY + Tag = MAGENTA + Declaration = WHITE + Constant = WHITE + LineNo = GRAY + } + } + Help = BROWN + Info = GREEN + Output = CYAN + Error = RED + ItemName = GRAY + HighlightForeground = RED + HighlightBackground = GRAY + Code { + Keyword = CYAN + Comment = RED + String = GREEN + Variable = BROWN + Html = GRAY + Tag = MAGENTA + Declaration = BLUE + Constant = MAGENTA + LineNo = GRAY + } +} +Tutorial = 0 +Tutorial { +} +MaxCodeLines = -1 diff --git a/hphp/test/quick/debugger/printThis.php.norepo b/hphp/test/quick/debugger/printThis.php.norepo deleted file mode 100644 index e69de29bb..000000000 diff --git a/hphp/test/quick/debugger/printThis.php.opts b/hphp/test/quick/debugger/printThis.php.opts deleted file mode 100644 index cf014a32f..000000000 --- a/hphp/test/quick/debugger/printThis.php.opts +++ /dev/null @@ -1 +0,0 @@ - -m debug \ No newline at end of file diff --git a/hphp/test/run b/hphp/test/run index 259692317..a8cd9dc0a 100755 --- a/hphp/test/run +++ b/hphp/test/run @@ -209,6 +209,14 @@ function find_config_for_dir($dir, $name) { return __DIR__.'/'.$name; } +function find_debug_config($test, $name) { + $debug_config = find_config_for_dir(dirname($test), $name); + if (is_file($debug_config)) { + return "-m debug --debug-config ".$debug_config; + } + return ""; +} + function mode_cmd($options) { $repo_args = "-v Repo.Local.Mode=-- -v Repo.Central.Path=".verify_hhbc(); $jit_args = "$repo_args -v Eval.Jit=true -v Eval.JitEnableRenameFunction=true"; @@ -229,6 +237,7 @@ function hhvm_cmd($options, $test) { idx_file($_ENV, 'HHVM_BIN', bin_root().'/hphp/hhvm/hhvm'), '--config', find_config($test, 'config.hdf'), + find_debug_config($test, 'hphpd.hdf'), mode_cmd($options), '-v Eval.EnableArgsInBacktraces=true', read_file("$test.opts"), @@ -368,7 +377,7 @@ function run_test($options, $test) { $hhvm = hhvm_cmd($options, $test); $output = ""; if (isset($options['repo'])) { - if (strpos($test, '.hhas') !== false || is_file($test.'.norepo')) { + if (strpos($test, '.hhas') !== false || strpos($hhvm, '-m debug') != false || is_file($test.'.norepo')) { # We don't have a way to skip, I guess run non-repo? } else { unlink("$test.repo/hhvm.hhbc");