Oops, there's a make distcheck...? Now it works.

master
Marc Wäckerlin 20 years ago
parent 91119df081
commit 80dcf5c1fb
  1. 8
      mrw/auto_test.cpp
  2. 3
      mrw/configfile_check.sh
  3. 8
      mrw/configfile_test.cpp
  4. 17
      mrw/doxyfile.in
  5. 10
      mrw/exec_test.cpp
  6. 43
      mrw/functiontrace_test.cpp

@ -9,6 +9,9 @@
@license LGPL, see file <a href="license.html">COPYING</a>
$Log$
Revision 1.5 2005/04/07 20:55:21 marc
Oops, there's a make distcheck...? Now it works.
Revision 1.4 2004/11/25 18:27:03 marc
additional test for release and reset
@ -27,12 +30,14 @@
*/
#include <mrw/auto.hpp>
#include <mrw/stdext.hpp> // ifelse
#include <cppunit/TestFixture.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <fcntl.h> // open
#include <string.h> // strncpy
#include <stdlib.h> // getenv
class AutoTest: public CppUnit::TestFixture {
public:
@ -42,7 +47,8 @@ public:
{
mrw::AutoFile a;
CPPUNIT_ASSERT(a==-1); // init as -1
i = a = open("test.dat", O_RDONLY);
i = a = open((std::string(mrw::ifelse(getenv("srcdir"), "."))
+"/test.dat").c_str(), O_RDONLY);
CPPUNIT_ASSERT(i==a && a>0); // file is now open
mrw::AutoFile b(a);
CPPUNIT_ASSERT(a==-1 && i==b); // b has taken ownership

@ -1,3 +1,4 @@
#! /bin/bash
test -z "`diff configfile2.ini configfile.ini.result`" && rm configfile2.ini
test -z "`diff $srcdir/configfile2.ini $srcdir/configfile.ini.result`" \
&& rm configfile2.ini

@ -9,6 +9,9 @@
@license LGPL, see file <a href="license.html">COPYING</a>
$Log$
Revision 1.2 2005/04/07 20:55:21 marc
Oops, there's a make distcheck...? Now it works.
Revision 1.1 2005/01/07 00:31:38 marc
initial version
@ -17,15 +20,18 @@
#include <mrw/configfile.hpp>
#include <mrw/file.hpp>
#include <mrw/stdext.hpp> // ifelse
#include <cppunit/TestFixture.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <stdlib.h> // getenv
class ConfigFileTest: public CppUnit::TestFixture {
public:
void CheckFile() {
mrw::File::copy("configfile.ini", "configfile2.ini");
std::string srcdir(mrw::ifelse(getenv("srcdir"), "."));
mrw::File::copy(srcdir+"/configfile.ini", "configfile2.ini");
mrw::ConfigFileWriter config("configfile2.ini");
CPPUNIT_ASSERT(config("", "xxx", ".")=="yyy");
CPPUNIT_ASSERT(config("Section", "abc", ".")=="");

@ -9,6 +9,9 @@
## @license LGPL, see file <a href="license.html">COPYING</a>
##
## $Log$
## Revision 1.15 2005/04/07 20:55:21 marc
## Oops, there's a make distcheck...? Now it works.
##
## Revision 1.14 2005/03/14 16:23:28 marc
## source code browser
## a4 instead of a4wide
@ -81,7 +84,7 @@ PROJECT_NUMBER = "Version @MAJOR@.@MINOR@.@LEAST@"
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doc
OUTPUT_DIRECTORY = @top_builddir@doc
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
@ -194,7 +197,7 @@ FULL_PATH_NAMES = YES
# only done if one of the specified strings matches the left-hand part of
# the path. It is allowed to use relative paths in the argument list.
STRIP_FROM_PATH = ..
STRIP_FROM_PATH = @top_srcdir@
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
@ -404,7 +407,7 @@ WARN_LOGFILE = doxygen.errors
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../mrw
INPUT = @top_srcdir@/mrw
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@ -442,7 +445,7 @@ EXCLUDE_PATTERNS = *_test*
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH = .. examples
EXAMPLE_PATH = @top_srcdir@ @srcdir@/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
@ -565,20 +568,20 @@ HTML_FILE_EXTENSION = .html
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
HTML_HEADER = @srcdir@/head.html
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
HTML_FOOTER = @srcdir@/foot.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
HTML_STYLESHEET =
HTML_STYLESHEET = @srcdir@/style.css
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to

@ -9,6 +9,9 @@
@license LGPL, see file <a href="license.html">COPYING</a>
$Log$
Revision 1.8 2005/04/07 20:55:21 marc
Oops, there's a make distcheck...? Now it works.
Revision 1.7 2004/12/20 13:21:21 marc
exception tests: each exception must be in an own test case
@ -34,20 +37,23 @@
*/
#include <mrw/exec.hpp>
#include <mrw/stacktrace.hpp>
#include <mrw/stdext.hpp>
#include <cppunit/TestFixture.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <string>
#include <stdlib.h>
class ExecTest: public CppUnit::TestFixture {
public:
void lsTest() {
std::string res = (mrw::Cmd("/bin/ls"), "-l", "..").execute();
std::string res = (mrw::Cmd("/bin/ls"), "-l",
std::string(getenv("srcdir"))+"/..").execute();
CPPUNIT_ASSERT(res.find("COPYING")<res.size());
}
void catTest() {
std::string res =mrw::Cmd("/bin/cat").execute("This is a test");
std::string res = mrw::Cmd("/bin/cat").execute("This is a test");
CPPUNIT_ASSERT(res=="This is a test");
}
void excTest1() {

@ -9,6 +9,9 @@
@license LGPL, see file <a href="license.html">COPYING</a>
$Log$
Revision 1.3 2005/04/07 20:55:21 marc
Oops, there's a make distcheck...? Now it works.
Revision 1.2 2005/03/11 23:18:02 marc
bugfix: linenumbers change at checkin...
@ -82,26 +85,26 @@ class FunctionTraceTest: public CppUnit::TestFixture {
void Calls() {
fn(A());
mrw::RegExp match
("functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::A\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::A\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - \\\\ fn\\(A\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn1\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn2\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn3\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn3\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn2\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn1\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - / fn\\(A\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::~A\\(\\)\n"
"functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::~A\\(\\)\n");
(".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::A\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::A\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - \\\\ fn\\(A\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn1\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn2\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn3\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn3\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn4\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn2\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::fn1\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - / fn\\(A\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: \\\\ A::~A\\(\\)\n"
".*functiontrace_test.cpp:[0-9]+ - *0x[0-9a-fA-F]+: / A::~A\\(\\)\n");
CPPUNIT_ASSERT(match(mrw::File::read("functiontrace_test.log")));
mrw::File::remove("functiontrace_test.log");
}

Loading…
Cancel
Save