Release 2-3-1 with tag: REL_mrw-c++-2-3-1
This commit is contained in:
BIN
log4cxx-0.9.7-3.i386.rpm
Normal file
BIN
log4cxx-0.9.7-3.i386.rpm
Normal file
Binary file not shown.
@@ -46,13 +46,13 @@ RPMS = /usr/src/packages/RPMS/i586/@PACKAGENAME@-minimal-@MAJOR@.@MINOR@.@LEAST@
|
|||||||
release: tag webserver
|
release: tag webserver
|
||||||
|
|
||||||
tag: distcheck
|
tag: distcheck
|
||||||
cvs ci -R .
|
svn ci -m "Release @MAJOR@-@MINOR@-@LEAST@ with tag: REL_@PACKAGENAME@-@MAJOR@-@MINOR@-@LEAST@" .
|
||||||
cvs tag -FR REL_@PACKAGENAME@-@MAJOR@-@MINOR@-@LEAST@ .
|
svn cp . file:///home/svn/pro/@PACKAGENAME@/tags/REL_@PACKAGENAME@-@MAJOR@-@MINOR@-@LEAST@
|
||||||
|
|
||||||
rpm: dist
|
rpm: dist
|
||||||
cp @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz /usr/src/packages/SOURCES/
|
cp @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz /usr/src/packages/SOURCES/
|
||||||
rpmbuild -ba --clean @PACKAGENAME@.spec
|
rpmbuild -ba --clean @PACKAGENAME@.spec
|
||||||
rpmbuild -ba --clean @PACKAGENAME@-minimal.spec
|
rpmbuild -bb --clean @PACKAGENAME@-minimal.spec
|
||||||
|
|
||||||
webserver: rpm
|
webserver: rpm
|
||||||
ssh root@waeckerlin.org bash -c \
|
ssh root@waeckerlin.org bash -c \
|
||||||
@@ -64,8 +64,9 @@ webserver: rpm
|
|||||||
log4cxx*.rpm \
|
log4cxx*.rpm \
|
||||||
root@waeckerlin.org:/home/marc/mrw-c++/
|
root@waeckerlin.org:/home/marc/mrw-c++/
|
||||||
|
|
||||||
distclean-local:
|
maintainerclean-local:
|
||||||
- find . -name '*~' | xargs rm
|
- find . -name '*~' | xargs rm
|
||||||
|
- rm -r doc
|
||||||
- rm -r autom4te.cache
|
- rm -r autom4te.cache
|
||||||
- rm aclocal.m4 config.guess config.sub configure \
|
- rm aclocal.m4 config.guess config.sub configure \
|
||||||
depcomp install-sh ltmain.sh makefile makefile.in \
|
depcomp install-sh ltmain.sh makefile makefile.in \
|
||||||
|
@@ -10,22 +10,26 @@
|
|||||||
##
|
##
|
||||||
|
|
||||||
# rpmbuild -bb --clean @PACKAGENAME@.spec
|
# rpmbuild -bb --clean @PACKAGENAME@.spec
|
||||||
Summary: MRW's C++ Class Library, facilities for modern C++ programming
|
Name: @PACKAGENAME@
|
||||||
Name: @PACKAGENAME@-minimal
|
|
||||||
Version: @MAJOR@.@MINOR@.@LEAST@
|
Version: @MAJOR@.@MINOR@.@LEAST@
|
||||||
Release: 1
|
Release: 1
|
||||||
License: LGPL
|
License: LGPL
|
||||||
Group: Development/Libraries/C++
|
Group: Development/Libraries/C++
|
||||||
|
Summary: dummy
|
||||||
|
|
||||||
|
%description
|
||||||
|
dummy
|
||||||
|
|
||||||
|
%package minimal
|
||||||
|
Summary: MRW's C++ Class Library (minimal release, no debugging features)
|
||||||
|
Group: Development/Libraries/C++
|
||||||
URL: http://marc.waeckerlin.org/mrw-c++/index.html
|
URL: http://marc.waeckerlin.org/mrw-c++/index.html
|
||||||
Source0: @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz
|
Source0: @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||||
Prefix: /usr
|
Prefix: /usr
|
||||||
|
|
||||||
Summary: MRW's C++ Class Library (minimal release, no debugging features)
|
|
||||||
Group: Development/Libraries/C++
|
|
||||||
Provides: @PACKAGENAME@
|
Provides: @PACKAGENAME@
|
||||||
|
|
||||||
%description
|
%description minimal
|
||||||
@README@
|
@README@
|
||||||
|
|
||||||
This package contains only the shared libraries required at runtime,
|
This package contains only the shared libraries required at runtime,
|
||||||
@@ -56,7 +60,7 @@ rm -r $RPM_BUILD_ROOT/usr/share/doc/packages/@PACKAGENAME@/examples
|
|||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%files
|
%files minimal
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
/usr/lib/libmrw.so
|
/usr/lib/libmrw.so
|
||||||
/usr/lib/libmrw.so.@MAJOR@
|
/usr/lib/libmrw.so.@MAJOR@
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include <sys/mman.h> // munmap, PROT_READ, MAP_SHARED
|
#include <sys/mman.h> // munmap, PROT_READ, MAP_SHARED
|
||||||
#include <unistd.h> // close
|
#include <unistd.h> // close
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
// forward
|
// forward
|
||||||
class bfd;
|
class bfd;
|
||||||
|
132
mrw/autofunctiontracestdlog.cpp
Normal file
132
mrw/autofunctiontracestdlog.cpp
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
/** @file
|
||||||
|
|
||||||
|
$Id: autofunctiontracelog4cxx.cpp,v 1.3 2005/04/14 19:12:18 marc Exp $
|
||||||
|
|
||||||
|
$Date: 2005/04/14 19:12:18 $
|
||||||
|
$Author: marc $
|
||||||
|
|
||||||
|
@copy © Marc Wäckerlin
|
||||||
|
@license LGPL, see file <a href="license.html">COPYING</a>
|
||||||
|
|
||||||
|
1 2 3 4 5 6 7 8
|
||||||
|
5678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GNUG__
|
||||||
|
#error GNU C++ Compiler is required for automatical function trace
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <mrw/string.hpp>
|
||||||
|
#include <mrw/stacktrace.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
|
#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) && _REENTRANT && !_MT
|
||||||
|
#define _MT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// these are special built in functions of GNU Compiler Collection
|
||||||
|
extern "C" void __cyg_profile_func_enter (void *, void *) __attribute__((no_instrument_function));
|
||||||
|
extern "C" void __cyg_profile_func_exit (void *, void *) __attribute__((no_instrument_function));
|
||||||
|
|
||||||
|
namespace mrw {
|
||||||
|
|
||||||
|
// workaround doxygen problem:
|
||||||
|
// - the C++ compiler compiles the following code
|
||||||
|
// - doxygen ignores it
|
||||||
|
#ifndef LET_DOXYGEN_IGNORE_THIS // no matching class member found for
|
||||||
|
// int mrw::ThreadInfo::level()
|
||||||
|
struct ThreadInfo {
|
||||||
|
int level;
|
||||||
|
bool recurse;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MT
|
||||||
|
static __thread ThreadInfo info = {0, false};
|
||||||
|
#else
|
||||||
|
static ThreadInfo info = {0, false};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static bool mainPassed(false);
|
||||||
|
|
||||||
|
class Lock {
|
||||||
|
public:
|
||||||
|
Lock() __attribute__((no_instrument_function));
|
||||||
|
~Lock() __attribute__((no_instrument_function));
|
||||||
|
};
|
||||||
|
// workaround doxygen problem:
|
||||||
|
// - the C++ compiler compiles the following code
|
||||||
|
// - doxygen ignores it
|
||||||
|
#ifndef LET_DOXYGEN_IGNORE_THIS // doxygen can't match with __attribute__ above
|
||||||
|
Lock::Lock() {
|
||||||
|
info.recurse = true;
|
||||||
|
}
|
||||||
|
Lock::~Lock() {
|
||||||
|
info.recurse = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" int main(int, char**);
|
||||||
|
|
||||||
|
/** @addtogroup FunctionTrace */
|
||||||
|
//@{
|
||||||
|
|
||||||
|
/** @defgroup AutoFunctionTraceStdlog Automatic Function Trace to standard out for GNU g++
|
||||||
|
|
||||||
|
Same as @ref AutoFunctionTrace, but traces to @c stdlog.
|
||||||
|
|
||||||
|
If you link to the library @c libmrwautofunctiontracestdlog using
|
||||||
|
a linker option such as: @c -lmrwautofunctiontracestdlog and you
|
||||||
|
must enable the GNU Compiler Collection specific function trace
|
||||||
|
feature with compile and link option @c -finstrument-functions
|
||||||
|
then you get an automatical function trace, that traces to @c
|
||||||
|
stdlog. You don't need to change a single line in your code!
|
||||||
|
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
|
||||||
|
//@}
|
||||||
|
|
||||||
|
//@}
|
||||||
|
|
||||||
|
extern "C" void __cyg_profile_func_enter(void *this_fn, void*) {
|
||||||
|
if (!mrw::mainPassed)
|
||||||
|
if (this_fn == (void*)&::main) // not ANSI C++ conform...
|
||||||
|
mrw::mainPassed=true;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
if (mrw::info.recurse) return;
|
||||||
|
mrw::Lock lock;
|
||||||
|
{
|
||||||
|
static bool init(mrw::StackTrace::createSymtable());
|
||||||
|
if (!init) return;
|
||||||
|
mrw::StackTrace::CodePos pos(mrw::StackTrace::translate(this_fn));
|
||||||
|
std::clog<<std::setw(2+mrw::info.level++)<<std::setfill(' ')
|
||||||
|
<<"\\ "<<pos.function<<" ("<<pos.file<<':'<<pos.line<<')'
|
||||||
|
<<std::endl;
|
||||||
|
}
|
||||||
|
} catch (...) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void __cyg_profile_func_exit(void *this_fn, void*) {
|
||||||
|
if (!mrw::mainPassed)
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
if (this_fn == (void*)&::main) { // not ANSI C++ conform...
|
||||||
|
mrw::mainPassed=false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (mrw::info.recurse || mrw::info.level==0) return;
|
||||||
|
mrw::Lock lock;
|
||||||
|
{
|
||||||
|
mrw::StackTrace::CodePos pos(mrw::StackTrace::translate(this_fn));
|
||||||
|
std::clog<<std::setw(2+--mrw::info.level)<<std::setfill(' ')
|
||||||
|
<<"/ "<<pos.function<<" ("<<pos.file<<':'<<pos.line<<')'
|
||||||
|
<<std::endl;
|
||||||
|
}
|
||||||
|
} catch (...) {}
|
||||||
|
}
|
@@ -58,7 +58,7 @@
|
|||||||
http://boost.org
|
http://boost.org
|
||||||
- log4cxx for automated tracing and function traces:
|
- log4cxx for automated tracing and function traces:
|
||||||
- http://logging.apache.org/log4cxx
|
- http://logging.apache.org/log4cxx
|
||||||
- RPM: http://marc.waeckerlin.org/mrw-c++/log4cxx-0.9.7-2.i386.rpm
|
- RPM: http://marc.waeckerlin.org/mrw-c++/log4cxx-0.9.7-3.i386.rpm
|
||||||
- @ref mrw::StackTrace requires:
|
- @ref mrw::StackTrace requires:
|
||||||
- the GNU Binutils
|
- the GNU Binutils
|
||||||
- either GNU Compiler gcc or GNU C library glibc
|
- either GNU Compiler gcc or GNU C library glibc
|
||||||
|
49
mrw/string_test.cpp
Normal file
49
mrw/string_test.cpp
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/** @file
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
$Date$
|
||||||
|
$Author$
|
||||||
|
|
||||||
|
@copy © Marc Wäckerlin
|
||||||
|
@license LGPL, see file <a href="license.html">COPYING</a>
|
||||||
|
|
||||||
|
$Log$
|
||||||
|
|
||||||
|
1 2 3 4 5 6 7 8
|
||||||
|
5678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
|
*/
|
||||||
|
#include <mrw/string.hpp>
|
||||||
|
#include <mrw/list.hpp>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <cppunit/TestFixture.h>
|
||||||
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||||
|
|
||||||
|
class StringTest: public CppUnit::TestFixture {
|
||||||
|
public:
|
||||||
|
void Join() {
|
||||||
|
std::list<std::string> l;
|
||||||
|
l<<"Hello"<<"World"<<"here"<<"I"<<"am";
|
||||||
|
CPPUNIT_ASSERT(mrw::join(l)=="Hello World here I am");
|
||||||
|
}
|
||||||
|
void Split() {
|
||||||
|
std::string text("Hello World here I am");
|
||||||
|
std::list<std::string> a(mrw::split(text)), b;
|
||||||
|
b<<"Hello"<<"World"<<"here"<<"I"<<"am";
|
||||||
|
CPPUNIT_ASSERT(equal(a.begin(), a.end(), b.begin()));
|
||||||
|
}
|
||||||
|
CPPUNIT_TEST_SUITE(StringTest);
|
||||||
|
CPPUNIT_TEST(Join);
|
||||||
|
CPPUNIT_TEST(Split);
|
||||||
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
};
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION(StringTest);
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
|
||||||
|
return runner.run() ? 0 : 1;
|
||||||
|
}
|
Reference in New Issue
Block a user