aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-12-31 01:46:25 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-12-31 01:46:25 +0000
commit8352a2b761a6c55a91ad79f3de3d2af3a3be0ce9 (patch)
tree26edd3271eb6d6115b3e34dc59e1b47cba2ffdbf
parentcd3547c0f5b90976f207159c733598254730f019 (diff)
downloadpaludis-8352a2b761a6c55a91ad79f3de3d2af3a3be0ce9.tar.gz
paludis-8352a2b761a6c55a91ad79f3de3d2af3a3be0ce9.tar.xz
More flexible sneaky test hacks
-rw-r--r--paludis/util/test_extras.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/paludis/util/test_extras.cc b/paludis/util/test_extras.cc
index f674dca..e04918d 100644
--- a/paludis/util/test_extras.cc
+++ b/paludis/util/test_extras.cc
@@ -41,21 +41,23 @@ namespace
struct C
{
- std::stringstream s;
+ /* icky hack: don't bother destructing s, it makes log assplode */
+ std::stringstream * s;
int dev_null_pid;
C() :
+ s(new std::stringstream),
dev_null_pid(open("/dev/stderr", O_RDONLY))
{
test::set_exception_to_debug_string(&verbose_exception_to_debug_string);
- if (getenv_with_default("PALUDIS_VERBOSE_TESTS", "").empty())
- {
- Log::get_instance()->set_log_stream(&s);
-
+ if (getenv_with_default("PALUDIS_TESTS_KEEP_STDERR", "").empty())
set_run_command_stderr_fds(dev_null_pid, -1);
- }
- else
+
+ if (getenv_with_default("PALUDIS_TESTS_KEEP_LOG", "").empty())
+ Log::get_instance()->set_log_stream(s);
+
+ if (getenv_with_default("PALUDIS_TESTS_DEBUG_LOG", "").empty())
Log::get_instance()->set_log_level(ll_debug);
}
};