Added target fullcheck.

This commit is contained in:
John Wiegley 2007-05-08 02:53:28 +00:00
parent ee4a167439
commit fa81dc4798
7 changed files with 44 additions and 26 deletions

View file

@ -234,6 +234,13 @@ PyUnitTests: $(srcdir)/tests/python/PyUnitTests.py
| sed "s/%builddir%/$(ESC_builddir)/g" > $@
chmod 755 $@
fullcheck: UnitTests
MallocGuardEdges=1 \
MallocScribble=1 \
MallocPreScribble=1 \
DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib \
$(top_builddir)/UnitTests --verify
######################################################################
DISTCLEANFILES = Doxyfile.gen

View file

@ -1858,6 +1858,13 @@ PyUnitTests: $(srcdir)/tests/python/PyUnitTests.py
| sed "s/%builddir%/$(ESC_builddir)/g" > $@
chmod 755 $@
fullcheck: UnitTests
MallocGuardEdges=1 \
MallocScribble=1 \
MallocPreScribble=1 \
DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib \
$(top_builddir)/UnitTests --verify
alldocs: docs/ledger.info docs/ledger.pdf doxygen-docs
$(top_builddir)/Doxyfile.gen: $(srcdir)/docs/Doxyfile

1
acprep
View file

@ -63,6 +63,7 @@ while [ -n "$1" ]; do
# CPPFLAGS="-I/usr/local/include/stlport $CPPFLAGS"
# LIBS="$LIBS -lstlportstlg"
#fi
CPPFLAGS="$CPPFLAGS -D_GLIBCXX_DEBUG=1" ;;
CXXFLAGS="$CXXFLAGS -g" ;;
--prof | --perf)

View file

@ -283,7 +283,7 @@ namespace {
}
if (sign) {
char * newbuf = new char[std::strlen(result ? result : buf) + 1];
char * newbuf = new char[std::strlen(result ? result : buf) + 2];
newbuf[0] = '-';
std::strcpy(&newbuf[1], result ? result : buf);
mpz_set_str(dest, newbuf, 10);

View file

@ -51,11 +51,6 @@ const char * document_t::ledger_builtins[] = {
"transaction"
};
document_t::document_t(node_t * _top)
: stub(this), top(_top ? _top : &stub) {
TRACE_CTOR(xml::document_t, "node_t *, const char **, const int");
}
document_t::~document_t()
{
TRACE_DTOR(xml::document_t);
@ -159,10 +154,9 @@ void document_t::print(std::ostream& out) const
document_t * node_t::document;
#endif
node_t::node_t(document_t * _document, parent_node_t * _parent,
flags_t _flags)
: supports_flags<>(_flags),
name_id(0), parent(_parent), next(NULL), prev(NULL), attrs(NULL)
node_t::node_t(document_t * _document, parent_node_t * _parent, flags_t _flags)
: supports_flags<>(_flags), name_id(0), parent(_parent),
next(NULL), prev(NULL), attrs(NULL)
{
TRACE_CTOR(node_t, "document_t *, node_t *");
document = _document;

View file

@ -236,18 +236,23 @@ private:
names_map names_index;
terminal_node_t stub;
public:
public:
node_t * top;
private:
terminal_node_t stub;
public:
// Ids 0-9 are reserved. 10-999 are for "builtin" names. 1000+ are
// for dynamically registered names.
enum special_names_t {
CURRENT, PARENT, ROOT, ALL
};
document_t(node_t * _top = NULL);
document_t(node_t * _top = NULL)
: top(_top ? _top : &stub), stub(this) {
TRACE_CTOR(xml::document_t, "node_t *, const char **, const int");
}
~document_t();
void set_top(node_t * _top);

View file

@ -17,17 +17,7 @@
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("Framework");
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("corelib");
CPPUNIT_REGISTRY_ADD("numerics", "corelib");
CPPUNIT_REGISTRY_ADD("balances", "corelib");
CPPUNIT_REGISTRY_ADD("values", "corelib");
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("driver");
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("journal");
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("reports");
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("transforms");
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("numerics");
// Create a sample test, which acts both as a template, and a
// verification that the basic framework is functioning.
@ -62,9 +52,17 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(UnitTests, "framework");
int main(int argc, char* argv[])
{
int index = 1;
if (argc > index && std::string(argv[index]) == "--verify") {
ledger::verify_enabled = true;
index++;
}
// Retreive test path from command line first argument. Default to
// "" which resolves to the top level suite.
std::string testPath = (argc > 1) ? std::string(argv[1]) : std::string("");
std::string testPath = ((argc > index) ? std::string(argv[index]) :
std::string(""));
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
@ -85,8 +83,14 @@ int main(int argc, char* argv[])
CPPUNIT_NS::TestRunner runner;
runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
try {
IF_VERIFY()
initialize_memory_tracing();
runner.run(controller, testPath);
IF_VERIFY()
shutdown_memory_tracing();
// Print test in a compiler compatible format.
CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut());
outputter.write();