#include <libtest/common.h>
-#include <libtest/cmdline.h>
-
using namespace libtest;
#include <cstdlib>
#include <string>
#include <sstream>
+namespace libtest {
+
bool exec_cmdline(const std::string& executable, const char *args[])
{
std::stringstream arg_buffer;
- arg_buffer << "./libtool --mode=execute ";
+ arg_buffer << libtool();
- if (getenv("LIBTEST_TEST_ENVIRONMENT"))
+ if (getenv("PWD"))
{
- arg_buffer << getenv("LIBTEST_TEST_ENVIRONMENT");
- arg_buffer << " ";
+ arg_buffer << getenv("PWD");
+ arg_buffer << "/";
}
arg_buffer << executable;
arg_buffer << " " << *ptr;
}
- if (getenv("LIBTEST_TEST_ENVIRONMENT"))
- {
- std::cerr << std::endl << arg_buffer.str() << std::endl;
- }
- else
- {
+#if 0
arg_buffer << " > /dev/null 2>&1";
- }
+#endif
if (system(arg_buffer.str().c_str()) == -1)
{
return true;
}
+
+const char *gearmand_binary()
+{
+ return GEARMAND_BINARY;
+}
+
+} // namespace exec_cmdline