Provide a command line switch to specify the path to the debugger config file

Currently the debugger config file is always expected to be at ~/.hphpd.hdf, except when the debugger is controlled via the API, in which case the API client can specify the path. With these changes the path can now also be specified via the command line. Also, the test runner has been modified to look for an hphpd.hdf file and specify the path to it as a command line option. If present, this file also indicates that tests in the directory must be run in debugger mode, making the .opt files redundant. Note that it is important for tests to be able to control the contents of the config file since debugger output is controlled by it and tests will be brittle unless the config is part of the suite and not controlled by the user running the tests
Esse commit está contido em:
Herman Venter
2013-06-07 18:28:49 -07:00
commit de sgolemon
commit 3d0330fd9d
18 arquivos alterados com 84 adições e 8 exclusões
+2
Ver Arquivo
@@ -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<int>(&po.admin_port)->default_value(-1),
"start admin listener at specified port")
("debug-config", value<string>(&po.debugger_options.configFName),
"load specified debugger config file")
("debug-host,h", value<string>(&po.debugger_options.host),
"connect to debugger server at specified address")
("debug-port", value<int>(&po.debugger_options.port)->default_value(-1),
+4
Ver Arquivo
@@ -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.
-1
Ver Arquivo
@@ -1 +0,0 @@
-m debug
-1
Ver Arquivo
@@ -1 +0,0 @@
-m debug
@@ -1 +0,0 @@
-m debug
-1
Ver Arquivo
@@ -1 +0,0 @@
-m debug
@@ -1 +0,0 @@
-m debug
@@ -1 +0,0 @@
-m debug
+68
Ver Arquivo
@@ -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
@@ -1 +0,0 @@
-m debug
+10 -1
Ver Arquivo
@@ -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");