aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-07 09:05:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-07 03:08:12 +0000
commit90b55defb8d8202d5e3a426df83f4976a7c2231a (patch)
tree67c708f6bbd83696dd42f0dd8a53f34745fe24cb
parentf95f1ca82945f6fbdd392f920a8bbcb09013eab0 (diff)
downloadpaludis-90b55defb8d8202d5e3a426df83f4976a7c2231a.tar.gz
paludis-90b55defb8d8202d5e3a426df83f4976a7c2231a.tar.xz
More verbosityness
-rwxr-xr-xtest/run_test.sh2
-rw-r--r--test/test_framework.cc26
2 files changed, 28 insertions, 0 deletions
diff --git a/test/run_test.sh b/test/run_test.sh
index 63b3ebc..056beec 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -10,6 +10,8 @@ testname=${testname%.rb}
testname=${testname%.py}
testname=${testname%.bash}
+export PALUDIS_TEST_PROGRAM=$testname
+
[[ -z "PALUDIS_TESTS_REAL_STDOUT_FD" ]] && export PALUDIS_TESTS_REAL_STDOUT_FD=1
if test -f "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
diff --git a/test/test_framework.cc b/test/test_framework.cc
index a72dee2..4e4759f 100644
--- a/test/test_framework.cc
+++ b/test/test_framework.cc
@@ -24,6 +24,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <unistd.h>
+#include <cstdlib>
#include <sys/time.h>
/** \file
@@ -272,6 +273,31 @@ RunTest::operator() (TestCase * test_case) const
std::cout << "* \"" << test_case->name() << "\": " << std::flush;
+ int extra_fd = -1;
+ if (getenv("PALUDIS_TESTS_REAL_STDOUT_FD"))
+ {
+ std::stringstream s;
+ s << getenv("PALUDIS_TESTS_REAL_STDOUT_FD");
+ s >> extra_fd;
+
+ std::stringstream t;
+ t << ">>> ";
+ if (getenv("PALUDIS_TEST_PROGRAM"))
+ t << getenv("PALUDIS_TEST_PROGRAM");
+ else
+ t << "Unknown Test Program";
+ t << " test " << test_case->name() << "..." << std::endl;
+
+ std::string buf(t.str());
+ while (! buf.empty())
+ {
+ int n(write(extra_fd, buf.c_str(), buf.length()));
+ if (-1 == n)
+ break;
+ buf.erase(0, n);
+ }
+ }
+
for (int repeat = 0 ; repeat < 2 ; ++repeat)
{
if (test_case->skip())