From b7a415ec0e358967fc39c046fb72f29e227e7104 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 6 Aug 2006 19:43:57 +0000 Subject: It builds with build again, and even the tests now. woo! --- build.conf | 17 ++++++++++++++--- src/exceptions.cpp | 2 +- src/exceptions.h | 1 + src/paramproc.cpp | 9 ++++++++- src/serializerbinary.cpp | 5 +++++ src/test/xmlreadtest/xmlreadtest.cpp | 6 +++--- 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/build.conf b/build.conf index f5626cf..a65878d 100644 --- a/build.conf +++ b/build.conf @@ -1,18 +1,29 @@ -# This is a build file for build +# This is a build file for libbu++ default action: check libbu++.a -"clean" action: clean libbu++.a +"tests" action: check /tests\/.*/ +"clean" action: clean /.*/ +"all" action: check /.*/ create file libbu++.a from files in src using rule lib -set CXXFLAGS += "-ggdb" +for directories matching /src\/test\/(.*)/ in src/test ... + create file "tests/{re:1}" from files in "{match}" using rule exe +set CXXFLAGS += "-ggdb" set CXXFLAGS += "-Isrc -fPIC" +for targets matching /tests\/.*/ set LDFLAGS += "-L. -lbu++" +for testes/plugin set LDFLAGS += "-ldl" + /(.*)\.o$/ requires from command "g++ {CXXFLAGS} -M {re:1}.c*" +/tests\/.*/ requires libbu++.a rule lib matches all /(.*)\.o$/ perform command ... "ar cr {target} {match}" rule cpp matches one /(.*)\.c(pp)?$/ produces "{re:1}.o" perform command ... "g++ {CXXFLAGS} -c -o {target} {match}" + +rule exe matches all /(.*)\.o$/ perform command ... + "g++ -o {target} {match} {LDFLAGS}" diff --git a/src/exceptions.cpp b/src/exceptions.cpp index 441075d..8d30296 100644 --- a/src/exceptions.cpp +++ b/src/exceptions.cpp @@ -2,4 +2,4 @@ #include subExceptionDef( XmlException ) - +subExceptionDef( FileException ) diff --git a/src/exceptions.h b/src/exceptions.h index 1cc891d..3bf2e0b 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -5,5 +5,6 @@ #include subExceptionDecl( XmlException ) +subExceptionDecl( FileException ) #endif diff --git a/src/paramproc.cpp b/src/paramproc.cpp index 90fa9ac..5cb815c 100644 --- a/src/paramproc.cpp +++ b/src/paramproc.cpp @@ -463,7 +463,14 @@ int ParamProc::help( int argc, char *argv[] ) printf(" "); if( (*i)->cChar ) { - printf("-%c, ", (*i)->cChar ); + if( (*i)->sWord.getString() ) + { + printf("-%c, ", (*i)->cChar ); + } + else + { + printf("-%c ", (*i)->cChar ); + } } else { diff --git a/src/serializerbinary.cpp b/src/serializerbinary.cpp index d7143ab..23fb2b1 100644 --- a/src/serializerbinary.cpp +++ b/src/serializerbinary.cpp @@ -1,5 +1,6 @@ #include "serializerbinary.h" #include "serializable.h" +#include "exceptions.h" SerializerBinary::SerializerBinary(FILE *fhFile, bool bLoading): Serializer(bLoading), @@ -15,10 +16,14 @@ SerializerBinary::SerializerBinary(const char *sFileName, bool bLoading): if (bLoading) { fhFile = fopen(sFileName, "rb"); + if( fhFile == NULL ) + throw FileException("Unable to open file: %s", sFileName ); } else { fhFile = fopen(sFileName, "wb"); + if( fhFile == NULL ) + throw FileException("Unable to open file: %s", sFileName ); } } diff --git a/src/test/xmlreadtest/xmlreadtest.cpp b/src/test/xmlreadtest/xmlreadtest.cpp index e2d2a0a..98d8a9e 100644 --- a/src/test/xmlreadtest/xmlreadtest.cpp +++ b/src/test/xmlreadtest/xmlreadtest.cpp @@ -1,6 +1,6 @@ -#include "../xmlfilereader.h" -#include "../xmlstringreader.h" -#include "../xmlfilewriter.h" +#include "xmlfilereader.h" +#include "xmlstringreader.h" +#include "xmlfilewriter.h" int main( int argc, char *argv[] ) { -- cgit v1.2.3