From dab2390d336255d64ade35f2f83989496c87450f Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Wed, 27 Jul 2011 03:16:10 -0700 Subject: [PATCH] If test env is found we print test, otherwise we shutdown all output. --- libtest/cmdline.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc index 32d0809d..d7bed820 100644 --- a/libtest/cmdline.cc +++ b/libtest/cmdline.cc @@ -60,10 +60,15 @@ bool exec_cmdline(const std::string& executable, const char *args[]) arg_buffer << " " << *ptr; } -#if 0 - arg_buffer << " > /dev/null 2>&1"; -#endif - std::cerr << std::endl << arg_buffer.str() << std::endl; + if (getenv("LIBTEST_TEST_ENVIRONMENT")) + { + std::cerr << std::endl << arg_buffer.str() << std::endl; + } + else + { + arg_buffer << " > /dev/null 2>&1"; + } + if (system(arg_buffer.str().c_str()) == -1) { return false; -- 2.30.2