webserver target
This commit is contained in:
@@ -23,7 +23,7 @@ PROJECT_NAME = "MRW C++ Library"
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = experimental
|
||||
PROJECT_NUMBER = "@MAJOR@.@MINOR@@SUPPORT@"
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
@@ -387,7 +387,7 @@ EXCLUDE_PATTERNS =
|
||||
# directories that contain example code fragments that are included (see
|
||||
# the \include command).
|
||||
|
||||
EXAMPLE_PATH = examples
|
||||
EXAMPLE_PATH = examples ..
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
|
@@ -4,8 +4,6 @@
|
||||
#include <unistd.h> // fork, exec
|
||||
#include <string.h> // memcpy
|
||||
|
||||
#include <iostream>
|
||||
|
||||
mrw::ExecutionFailedExc::ExecutionFailedExc(const std::string& w,
|
||||
const std::string& c)
|
||||
throw(std::bad_exception):
|
||||
|
@@ -1,22 +1,29 @@
|
||||
#include <mrw/exec.hpp>
|
||||
#include <mrw/stacktrace.hpp>
|
||||
#include <cppunit/TestFixture.h>
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
class ExecTest: public CppUnit::TestFixture {
|
||||
public:
|
||||
void lsTest() {
|
||||
std::string res = (mrw::Cmd("/bin/ls"), "-l", "..").execute();
|
||||
CPPUNIT_ASSERT(res.find("COPYING")<res.size());
|
||||
}
|
||||
void excTest() {
|
||||
std::string res = (mrw::Cmd("/bin/false")).execute().result();
|
||||
}
|
||||
CPPUNIT_TEST_SUITE(ExecTest);
|
||||
CPPUNIT_TEST(lsTest);
|
||||
CPPUNIT_TEST_EXCEPTION(excTest, mrw::ExecutionFailedExc);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
};
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(ExecTest);
|
||||
|
||||
int main() {
|
||||
// std::cout<<"RESULT: "
|
||||
// <<(mrw::Cmd("/bin/ls"), "-l", "/tmp").execute().result()
|
||||
// <<std::endl;
|
||||
try {
|
||||
std::cout<<"RESULT: "
|
||||
<<(mrw::Cmd("/bin/false")).execute().result()
|
||||
<<std::endl;
|
||||
} catch (const mrw::exception &x) {
|
||||
mrw::StackTrace::createSymtable();
|
||||
std::cout<<"EXCEPTION: ----------------------------------------"<<std::endl
|
||||
<<"---------- Reason:"<<std::endl
|
||||
<<x.what()<<std::endl
|
||||
<<"---------- Stack:"<<std::endl
|
||||
<<x.stacktrace()<<std::endl
|
||||
<<"---------------------------------------------------"<<std::endl;
|
||||
}
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
|
||||
return runner.run() ? 0 : 1;
|
||||
}
|
||||
|
@@ -1,17 +1,36 @@
|
||||
EXTRA_DIST = doc examples
|
||||
CLEANFILES = doxygen.err
|
||||
CLEANFILES = doxygen.error
|
||||
AM_CPPFLAGS = -I..
|
||||
|
||||
lib_LTLIBRARIES = libmrw.la libautostacktracestderr.la
|
||||
examplesdir = ${pkgdatadir}/examples
|
||||
examples_DATA = examples/*
|
||||
htmldir = ${pkgdatadir}/doc/html
|
||||
html_DATA = doc/html/*
|
||||
EXTRA_DIST = test.dat ${examples_DATA} ${html_DATA}
|
||||
|
||||
lib_LTLIBRARIES = libmrw.la libmrwexcstderr.la
|
||||
|
||||
libmrw_la_SOURCES = mrw.hpp \
|
||||
auto.hpp auto.cpp unistd.hpp \
|
||||
stacktrace.hpp stacktrace.cpp exception.hpp \
|
||||
stacktrace.hpp stacktrace.cpp exception.hpp exception.cpp \
|
||||
exec.hpp exec.cpp
|
||||
libmrw_la_LDFLAGS = -version-info @MAJOR@:@MINOR@:@SUPPORT@
|
||||
libmrw_la_LDFLAGS = -version-info @MAJOR@:@MINOR@
|
||||
libmrw_la_LIBADD = -liberty -lbfd
|
||||
|
||||
libautostacktracestderr_la_SOURCES = autostacktracestderr.cpp
|
||||
libautostacktracestderr_la_LDFLAGS = -version-info @MAJOR@:@MINOR@:@SUPPORT@
|
||||
libmrwexcstderr_la_SOURCES = autostacktracestderr.cpp
|
||||
libmrwexcstderr_la_LDFLAGS = -version-info @MAJOR@:@MINOR@
|
||||
libmrwexcstderr_la_LIBADD = -lmrw
|
||||
|
||||
check_PROGRAMS = auto_test exec_test stacktrace_test
|
||||
auto_test_SOURCES = auto_test.cpp
|
||||
auto_test_CPPFLAGS = -I.. -g3
|
||||
auto_test_LDADD = -lmrw -lcppunit
|
||||
exec_test_SOURCES = exec_test.cpp
|
||||
exec_test_CPPFLAGS = -I.. -g3
|
||||
exec_test_LDADD = -lmrw -lcppunit
|
||||
stacktrace_test_SOURCES = stacktrace_test.cpp
|
||||
stacktrace_test_CPPFLAGS = -I.. -g3
|
||||
stacktrace_test_LDADD = -lmrw -lcppunit
|
||||
TESTS = ${check_PROGRAMS}
|
||||
|
||||
doc: doc/html/index.html
|
||||
doc/html/index.html: doxyfile *.[ch]pp
|
||||
|
@@ -27,15 +27,31 @@
|
||||
|
||||
@section download Download and Installation
|
||||
|
||||
Download the latest version from:
|
||||
- http://marc.waeckerlin.org/c++/libmrw
|
||||
Download this version from here:
|
||||
- http://marc.waeckerlin.org/c++/libmrw/mrw-c++-@MAJOR@.@MINOR@.tar.gz
|
||||
- http://marc.waeckerlin.org/c++/libmrw/mrw-c++-@MAJOR@.@MINOR@.rpm
|
||||
|
||||
The homepage is on:
|
||||
- http://marc.waeckerlin.org/c++/libmrw/index.html
|
||||
|
||||
Install it with:
|
||||
|
||||
@verbatim
|
||||
tar xzvf mrw-c++-<VERSION>.tar.gz
|
||||
cd mrw-c++-<VERSION>
|
||||
tar xzvf mrw-c++-@MAJOR@.@MINOR@.tar.gz
|
||||
cd mrw-c++-@MAJOR@.@MINOR@
|
||||
./configure
|
||||
make all check install
|
||||
@endverbatim
|
||||
*/
|
||||
|
||||
/** @page license License
|
||||
@verbinclude COPYING */
|
||||
|
||||
/** @page readme Readme
|
||||
@verbinclude README */
|
||||
|
||||
/** @page news News
|
||||
@verbinclude NEWS */
|
||||
|
||||
/** @page changes Change Log
|
||||
@verbinclude ChangeLog */
|
@@ -3,27 +3,28 @@
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <iostream>
|
||||
|
||||
class StackTraceTest: public CppUnit::TestFixture {
|
||||
public:
|
||||
/// test if symbols are correctely evaluated
|
||||
void StackTrace() {
|
||||
mrw::StackTrace::createSymtable();
|
||||
mrw::StackTrace s; int l(__LINE__); std::string f(__FILE__);
|
||||
std::stringstream ss;
|
||||
ss<<f<<':'<<l;
|
||||
std::string st(s);
|
||||
int pos(st.find(ss.str()));
|
||||
std::cout<<st<<std::endl;
|
||||
CPPUNIT_ASSERT(pos<st.size());
|
||||
CPPUNIT_ASSERT(st.find("mrw::StackTrace::StackTrace()", pos)<st.size());
|
||||
}
|
||||
CPPUNIT_TEST_SUITE(StackTraceTest);
|
||||
CPPUNIT_TEST(StackTrace);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
};
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(StackTraceTest);
|
||||
namespace mrw {
|
||||
class StackTraceTest: public CppUnit::TestFixture {
|
||||
public:
|
||||
/// test if symbols are correctely evaluated
|
||||
void StackTrace() {
|
||||
mrw::StackTrace::createSymtable();
|
||||
mrw::StackTrace s; int l(__LINE__); std::string f(__FILE__);
|
||||
std::stringstream ss;
|
||||
ss<<f<<':'<<l;
|
||||
std::string st(s);
|
||||
int pos(st.find(ss.str()));
|
||||
CPPUNIT_ASSERT(pos<st.size());
|
||||
CPPUNIT_ASSERT(st.find("mrw::StackTraceTest::StackTrace()", pos)
|
||||
< st.size());
|
||||
}
|
||||
CPPUNIT_TEST_SUITE(StackTraceTest);
|
||||
CPPUNIT_TEST(StackTrace);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
};
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(StackTraceTest);
|
||||
}
|
||||
|
||||
int main() {
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
|
Reference in New Issue
Block a user