From 80dcf5c1fb0a60d452156e019f8f5e71743f4bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 7 Apr 2005 20:55:21 +0000 Subject: [PATCH] Oops, there's a make distcheck...? Now it works. --- mrw/auto_test.cpp | 8 ++++++- mrw/configfile_check.sh | 3 ++- mrw/configfile_test.cpp | 8 ++++++- mrw/doxyfile.in | 17 ++++++++------- mrw/exec_test.cpp | 10 +++++++-- mrw/functiontrace_test.cpp | 43 ++++++++++++++++++++------------------ 6 files changed, 57 insertions(+), 32 deletions(-) diff --git a/mrw/auto_test.cpp b/mrw/auto_test.cpp index 99f525f..4af9385 100644 --- a/mrw/auto_test.cpp +++ b/mrw/auto_test.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $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 +#include // ifelse #include #include #include #include #include // open #include // strncpy +#include // 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 diff --git a/mrw/configfile_check.sh b/mrw/configfile_check.sh index 5fc004f..b8ffb1d 100755 --- a/mrw/configfile_check.sh +++ b/mrw/configfile_check.sh @@ -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 diff --git a/mrw/configfile_test.cpp b/mrw/configfile_test.cpp index 95ae1ef..74162c9 100644 --- a/mrw/configfile_test.cpp +++ b/mrw/configfile_test.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $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 #include +#include // ifelse #include #include #include #include +#include // 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", ".")==""); diff --git a/mrw/doxyfile.in b/mrw/doxyfile.in index 19e78ce..0c43fd9 100644 --- a/mrw/doxyfile.in +++ b/mrw/doxyfile.in @@ -9,6 +9,9 @@ ## @license LGPL, see file COPYING ## ## $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 diff --git a/mrw/exec_test.cpp b/mrw/exec_test.cpp index 307bf45..542f838 100644 --- a/mrw/exec_test.cpp +++ b/mrw/exec_test.cpp @@ -9,6 +9,9 @@ @license LGPL, see file COPYING $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 #include +#include #include #include #include #include #include +#include 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")COPYING $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"); }