summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-02-20 14:22:32 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-02-20 14:22:32 -0500
commit999484a60896b11df1af9a44e58ccae6fa6ecbed (patch)
tree7dc5662cf6957bbb677191c23f701bc3947c2ca2 /indra/llcommon/tests
parent8b5d5f9652499103b966524e1c0ceef869e29eeb (diff)
Let LLProcess consumer specify desired description for logging.
If caller runs (e.g.) a Python script, it's not very helpful to a human log reader to keep seeing LLProcess instances logged as /pathname/to/python (pid). If caller is aware, the code can at least use the script name as the desc -- or maybe even a hint as to the script's purpose. If caller doesn't explicitly pass a desc, at least shorten to just the basename of the executable.
Diffstat (limited to 'indra/llcommon/tests')
-rw-r--r--indra/llcommon/tests/llprocess_test.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index 1a755c283c..fe599e7892 100644
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -136,6 +136,7 @@ struct PythonProcessLauncher
const char* PYTHON(getenv("PYTHON"));
tut::ensure("Set $PYTHON to the Python interpreter", PYTHON);
+ mParams.desc = desc + " script";
mParams.executable = PYTHON;
mParams.args.add(mScript.getName());
}
@@ -1244,17 +1245,14 @@ namespace tut
std::string pumpname("postend");
EventListener listener(LLEventPumps::instance().obtain(pumpname));
LLProcess::Params params;
+ params.desc = "bad postend";
params.postend = pumpname;
LLProcessPtr child = LLProcess::create(params);
ensure("shouldn't have launched", ! child);
ensure_equals("number of postend events", listener.mHistory.size(), 1);
LLSD postend(listener.mHistory.front());
ensure("has id", ! postend.has("id"));
- // Ha ha, in this case the implementation normally sets "desc" to
- // params.executable. But as the nature of the problem is that
- // params.executable is empty, expecting "desc" to be nonempty is a
- // bit unreasonable!
- //ensure("desc empty", ! postend["desc"].asString().empty());
+ ensure_equals("desc", postend["desc"].asString(), std::string(params.desc));
ensure_equals("state", postend["state"].asInteger(), LLProcess::UNSTARTED);
ensure("has data", ! postend.has("data"));
std::string error(postend["string"]);