Release 3-2-4
This commit is contained in:
@@ -48,27 +48,40 @@
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <iostream>
|
||||
#ifdef __GNUG__
|
||||
#define LOG std::clog<<__PRETTY_FUNCTION__<<'@'<<__FILE__<<':'<<__LINE__;
|
||||
#else
|
||||
#define LOG std::clog<<__FUNCTION__<<'@'<<__FILE__<<':'<<__LINE__;
|
||||
#endif
|
||||
|
||||
class ExecTest: public CppUnit::TestFixture {
|
||||
public:
|
||||
void lsTest() {
|
||||
LOG;
|
||||
std::string res = (mrw::Cmd("/bin/ls"), "-l",
|
||||
std::string(getenv("srcdir"))+"/..").execute();
|
||||
CPPUNIT_ASSERT(res.find("COPYING")<res.size());
|
||||
}
|
||||
void catTest() {
|
||||
LOG;
|
||||
std::string res = mrw::Cmd("/bin/cat").execute("This is a test");
|
||||
CPPUNIT_ASSERT(res=="This is a test");
|
||||
}
|
||||
void excTest1() {
|
||||
LOG;
|
||||
std::string res = (mrw::Cmd("/bin/false")).execute().result();
|
||||
}
|
||||
void excTest2() {
|
||||
LOG;
|
||||
std::string res = (mrw::Cmd("/bin/false")).execute("").result();
|
||||
}
|
||||
void unexpectedExc() throw(std::bad_exception) {
|
||||
LOG;
|
||||
std::string res = (mrw::Cmd("/bin/false")).execute().result();
|
||||
}
|
||||
void lsTest2() {
|
||||
LOG;
|
||||
std::string res;
|
||||
mrw::PartialExec exec = (mrw::Cmd("/bin/ls"), "-l",
|
||||
std::string(getenv("srcdir"))+"/..").start();
|
||||
@@ -76,6 +89,7 @@ public:
|
||||
CPPUNIT_ASSERT(res.find("COPYING")<res.size());
|
||||
}
|
||||
void catTest2() {
|
||||
LOG;
|
||||
mrw::PartialExec exec = mrw::Cmd("/bin/cat").start(true);
|
||||
std::string res = exec.read("This is a test\n").first;
|
||||
res += exec.read("More to come...\n").first;
|
||||
@@ -84,14 +98,17 @@ public:
|
||||
CPPUNIT_ASSERT(res=="This is a test\nMore to come...\n");
|
||||
}
|
||||
void excTest12() {
|
||||
LOG;
|
||||
mrw::PartialExec exec = (mrw::Cmd("/bin/false")).start();
|
||||
while (!exec.finished()) exec.read();
|
||||
}
|
||||
void excTest22() {
|
||||
LOG;
|
||||
mrw::PartialExec exec = (mrw::Cmd("/bin/false")).start(true);
|
||||
while (!exec.finished()) exec.read("xxx");
|
||||
}
|
||||
void unexpectedExc2() throw(std::bad_exception) {
|
||||
LOG;
|
||||
mrw::PartialExec exec = (mrw::Cmd("/bin/false")).start();
|
||||
while (!exec.finished()) exec.read();
|
||||
}
|
||||
|
@@ -374,7 +374,7 @@ TESTS = $(check_PROGRAMS) $(dist_check_SCRIPTS)
|
||||
endif
|
||||
check_PROGRAMS = $(VALGRIND_CHECKS) $(NO_VALGRIND_CHECKS)
|
||||
|
||||
.PHONY: doc clean-local distclean-local dist-hool install-data-hook \
|
||||
.PHONY: doc clean-local distclean-local dist-hook install-data-hook \
|
||||
uninstall-hook
|
||||
|
||||
deps = $(top_srcdir)/COPYING $(top_srcdir)/README $(top_srcdir)/INSTALL $(top_srcdir)/NEWS $(top_srcdir)/ChangeLog
|
||||
@@ -411,6 +411,7 @@ dist-hook:
|
||||
mkdir -p $(distdir)/doc/html
|
||||
cp $(top_builddir)/doc/html/* $(distdir)/doc/html/.
|
||||
|
||||
if HAVE_DOXYGEN
|
||||
install-data-hook:
|
||||
env | grep -i tmp
|
||||
test -d "$(DESTDIR)$(pkgdatadir)/doc" || \
|
||||
@@ -421,3 +422,4 @@ install-data-hook:
|
||||
uninstall-hook:
|
||||
chmod -R u+w "$(DESTDIR)$(pkgdatadir)/doc"
|
||||
rm -rf "$(DESTDIR)$(pkgdatadir)/doc/html"
|
||||
endif
|
||||
|
Reference in New Issue
Block a user