Changeset 169

Show
Ignore:
Timestamp:
07/25/08 10:54:15 (5 months ago)
Author:
zork
Message:

cleanup in regression tests configuration

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dba/bakefile/dba.bkl

    r151 r169  
    88    <option name="dbaxml_CXXFLAGS"/> 
    99    <option name="dbaxml_LIBS"/> 
     10    <option name="dbatest_CXXFLAGS"/> 
     11    <option name="dbatest_LIBS"/> 
    1012 
    1113    <template id="dba-lib-static"> 
  • trunk/dba/config.bkl

    r127 r169  
    8888  </set> 
    8989  <set var="XMLLIB_STATIC"> 
    90     <if cond="XML==1">dbacsv_static</if> 
     90    <if cond="XML==1">dbaxml_static</if> 
    9191  </set> 
    9292   
  • trunk/dba/configure.in

    r126 r169  
    211211fi 
    212212 
     213# xml archive 
     214AC_ARG_ENABLE(xml,[--enable-xml compile xml archive support]) 
     215if test "$enable_xml" == "yes"; then 
    213216AC_BUILDER_CUSTOM_LIB([2.6.11],[xml2],[--cflags],[--libs],[xml2], 
    214217  [ 
    215218    XML=1 
    216     AC_SUBST(XML) 
    217219  ], 
    218220  [ 
    219221    XML=0 
    220     AC_SUBST(XML) 
    221     AC_MSG_RESULT([libxml2 library not found. XML support disabled]) 
     222    AC_MSG_ERROR([libxml2 library not found. XML support disabled]) 
    222223  ] 
    223224) 
     225else 
     226  XML=0 
     227fi 
     228AC_SUBST(XML) 
    224229 
    225230AC_BAKEFILE([m4_include(autoconf_inc.m4)]) 
  • trunk/dba/dba.bkl

    r154 r169  
    261261    test/testobject.cpp 
    262262    test/utils.cpp 
    263     test/xmltestcase.cpp 
    264263  </set> 
    265264 
     
    280279    test/testobject.h 
    281280    test/utils.h 
    282     test/xmltestcase.h 
    283281  </set> 
    284282 
     
    308306    <library>dbatestlib</library> 
    309307    <library>$(CSVLIB_STATIC)</library> 
     308    <library>$(XMLLIB_STATIC)</library> 
    310309  </template> 
    311310   
     
    315314      test/stdfilters_test.cpp 
    316315      test/connectstringtestcase.cpp 
     316      test/xmltestcase.cpp 
    317317    </sources> 
    318318    <msvc-headers> 
    319319      test/stdfilters_test.h 
    320320      test/connectstringtestcase.h 
     321      test/xmltestcase.h 
    321322    </msvc-headers> 
    322323    <define>$(define_shared)</define> 
     
    325326  <exe id="dba_test_static" template="testbase" cond="SHARED=='0' and TESTS=='1'"> 
    326327    <nameexe>dba_test_static</nameexe> 
    327     <library>dbaxml_static</library> 
    328     <library>dbacsv_static</library> 
    329328    <library>libdba_static</library> 
    330329  </exe> 
  • trunk/dba/dba/xmlistream.cpp

    r166 r169  
    4141    pNode = pNode->next; 
    4242  return pNode; 
     43}; 
     44 
     45void  
     46XMLIStream::ignoreNonMappedNodes(bool pFlag) { 
     47  throw APIException("ignoreNonMappedNodes is not implemented yet"); 
     48}; 
     49 
     50void  
     51XMLIStream::ignoreNodeOrder(bool pFlag) { 
     52  throw APIException("ignoreNodeOrder is not implemented yet"); 
    4353}; 
    4454 
  • trunk/dba/dba/xmlistream.h

    r166 r169  
    2828      If set to true, then stream will igore all nodes that are not mapped to class 
    2929      members or binded to variables.  
     30      @note Not implemented yet - needs store table reorganization 
    3031      @param pFlag true if stream should ignore not mapped elements, false (the default) otherwise 
    3132    */ 
     
    3637      element order in xml file has to be the same as store table layout. Elements 
    3738      from parent store table should be placed before elements in child store table. 
     39      @note Not implemented yet - needs store table reorganization 
    3840      @param pFlag true if stream should element order, false (the default) otherwise 
    3941    */ 
  • trunk/dba/test/main.cpp

    r164 r169  
    144144  CppUnit::BriefTestProgressListener listener; 
    145145  runner.eventManager().addListener(&listener); 
    146   //runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); 
     146  runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); 
    147147  //runner.addTest(new CppUnit::TestCaller<SQLite3SQLArchiveTestCase>("debug_test",&SQLite3SQLArchiveTestCase::sqlError)); 
    148148  //runner.addTest(new CppUnit::TestCaller<PostgresSQLArchiveTestCase>("debug_test",&PostgresSQLArchiveTestCase::sqlError)); 
     
    150150  //runner.addTest(new CppUnit::TestCaller<dba_tests::CSVTestCase>("debug_test",&dba_tests::CSVTestCase::invalidPos)); 
    151151  //runner.addTest(new CppUnit::TestCaller<SQLite3SQLArchiveTestCase>("debug_test",&SQLite3SQLArchiveTestCase::transactions_rollback)); 
    152   runner.addTest(dba_tests::XMLTestCase::suite()); 
     152  //runner.addTest(dba_tests::XMLTestCase::suite()); 
    153153  //runner.addTest(new CppUnit::TestCaller<dba_tests::XMLTestCase>("debug_test",&dba_tests::XMLTestCase::sublist_two_store)); 
    154154  //runner.addTest(new CppUnit::TestCaller<dba_tests::XMLTestCase>("debug_test",&dba_tests::XMLTestCase::store_two)); 
  • trunk/dba/test/xmltestcase.cpp

    r166 r169  
    1010// 
    1111// 
     12#ifdef TEST_XML 
     13 
    1214#include "xmltestcase.h" 
    1315#include "testobject.h" 
     
    2022#include <fstream> 
    2123 
    22 #ifdef TEST_XML 
    2324 
    2425namespace dba_tests { 
  • trunk/dba/test/xmltestcase.h

    r166 r169  
    1313#define TESTXMLTESTCASE_H 
    1414 
     15#ifdef TEST_XML 
     16 
    1517#include <cppunit/TestCase.h> 
    1618#include <cppunit/extensions/HelperMacros.h> 
     
    1820 
    1921namespace dba_tests { 
    20  
    21 #ifdef TEST_XML 
    2222 
    2323/** 
     
    9393}; 
    9494 
     95} //namespace 
     96 
    9597#endif //TEST_XML 
    9698 
    97 } //namespace 
    98  
    9999#endif 
  • trunk/wxdba/configure.in

    r150 r169  
    1212AC_BUILDER_CUSTOM_LIB([1.0.0],[dba],[--test-cxxflags],[--test-libs],[dbatest],[],[]) 
    1313 
     14ORGCXXFLAGS=$CXXFLAGS 
     15ORGLIBS=$LIBS 
     16AC_LANG(C++) 
     17 
     18CXXFLAGS="$ORGCXXFLAGS $dbacsv_CXXFLAGS" 
     19LIBS="$ORGLIBS -ldbacsv$DEBUG_SUFFIX $dbacsv_LIBS" 
     20AC_MSG_CHECKING([csv support in dba]) 
     21AC_TRY_LINK([#include "dba/csv.h"],[dba::CSVArchive ar], 
     22  [ 
     23    CSV=1 
     24    AC_MSG_RESULT(yes) 
     25  ],[ 
     26    CSV=0 
     27    AC_MSG_RESULT(no) 
     28  ] 
     29) 
     30AC_SUBST(CSV) 
     31 
     32CXXFLAGS="$ORGCXXFLAGS $dbaxml_CXXFLAGS" 
     33LIBS="$ORGLIBS -ldbaxml$DEBUG_SUFFIX $dbaxml_LIBS" 
     34AC_MSG_CHECKING([xml support in dba]) 
     35AC_TRY_LINK([#include "dba/xmlarchive.h"],[dba::XMLArchive ar], 
     36  [ 
     37    XML=1 
     38    AC_MSG_RESULT(yes) 
     39  ], 
     40  [ 
     41    XML=0 
     42    AC_MSG_RESULT(no) 
     43  ] 
     44) 
     45AC_SUBST(XML) 
     46 
     47if test "$TESTS" == "1"; then 
     48  CXXFLAGS="$ORGCXXFLAGS $dbatest_CXXFLAGS" 
     49  LIBS="$ORGLIBS -ldbatest$DEBUG_SUFFIX $dbatest_LIBS" 
     50  AC_TRY_LINK([#include "dba/test/utils.h"],[dba_tests::Utils::getNow()], 
     51    [], 
     52    [ 
     53      AC_MSG_ERROR([Cannot find dba testlib. Try compile dba with --enable-tests]) 
     54    ] 
     55  ) 
     56fi 
     57 
     58CXXFLAGS=$ORGCXXFLAGS 
     59LIBS=$ORGLIBS 
     60 
    1461AC_BAKEFILE([m4_include(autoconf_inc.m4)]) 
    1562AC_OUTPUT(Makefile wxdba-config) 
  • trunk/wxdba/test/xmltestcase.cpp

    r150 r169  
     1#ifdef USE_XML 
     2 
    13#include "xmltestcase.h" 
    24#include "string_filter.h" 
     
    4850 
    4951} //namespace 
     52 
     53#endif //USE_XML 
  • trunk/wxdba/test/xmltestcase.h

    r150 r169  
    11#ifndef WXDBA_TESTXMLTESTCASE_H 
    22#define WXDBA_TESTXMLTESTCASE_H 
     3 
     4#ifdef USE_XML 
    35 
    46#include <cppunit/TestCase.h> 
     
    2527} //namespace 
    2628 
     29#endif //USE_XML 
     30 
    2731#endif 
     32 
  • trunk/wxdba/wxdba.bkl

    r150 r169  
    66  <include file="presets/dba.bkl" once="1"/> 
    77   
     8  <if cond="FORMAT_SUPPORTS_CONDITIONS=='1'"> 
     9    <option name="CSV"> 
     10      <values>0,1</values> 
     11      <default-value>0</default-value> 
     12      <description>Set to 1 to build support for csv file format</description> 
     13    </option> 
     14    <option name="XML"> 
     15      <values>0,1</values> 
     16      <default-value>0</default-value> 
     17      <description>Set to 1 to build support for xml file format</description> 
     18    </option> 
     19  </if> 
     20   
     21  <!-- Aviod matrix of msvc6prj configurations for all possibile options values 
     22        related to optional components --> 
     23  <if cond="FORMAT_SUPPORTS_CONDITIONS=='0'"> 
     24    <set var="CSV">1</set> 
     25    <set var="XML">1</set> 
     26  </if> 
     27 
     28  <!-- defines for optional files --> 
     29  <set var="define_xml"> 
     30    <if cond="XML=='1'">USE_XML</if> 
     31  </set> 
     32  <set var="define_csv"> 
     33    <if cond="CSV=='1'">USE_CSV</if> 
     34  </set> 
     35 
    836  <!-- library --> 
    937  <set var="LIBSRC">$(SRCDIR)$(DIRSEP)wxdba</set> 
     
    90118  </set> 
    91119 
    92   <template id="libwxdbabase"> 
     120 
     121  <template id="product"> 
     122    <define>$(define_xml)</define> 
     123    <define>$(define_csv)</define> 
     124  </template> 
     125 
     126  <template id="libwxdbabase" template="product"> 
    93127    <name>wxdba-base</name> 
    94128    <sources>$(LIBSOURCES-BASE)</sources> 
     
    108142 
    109143 
    110   <template id="libwxdbagui"
     144  <template id="libwxdbagui" template="product"
    111145    <name>wxdba-gui</name> 
    112146    <sources>$(LIBSOURCES-GUI)</sources> 
     
    126160  <set var="MSVC6PRJ_MERGED_TARGETS" append="1">libwxdba_gui=libwxdbagui_static+libwxdbagui_dynamic</set> 
    127161 
     162  <set var="CSVLIB_STATIC"> 
     163    <if cond="CSV==1">dbacsv$(LIBDEBUGSUFFIX)</if> 
     164  </set> 
     165  <set var="XMLLIB_STATIC"> 
     166    <if cond="XML==1">dbaxml$(LIBDEBUGSUFFIX)</if> 
     167  </set> 
     168 
    128169  <!--  
    129170  cppunit test  
    130171  wxFont and wxColour dba tests needs wxWidgets GUI version to compile. 
    131   but it runs as console application 
    132172--> 
    133   <template id="testbase" template_append="cppunitexe,wx-lib-gui"> 
     173  <template id="testbase" template_append="cppunitexe,dbatest-exe-static,wx-lib-gui,product,dba-xml-lib-static"> 
    134174    <app-type>gui</app-type> 
    135175    <include>$(LIBSRC)</include> 
     
    143183      test/xmltestcase.cpp 
    144184    </sources> 
    145     <sys-lib>dbatestd</sys-lib> 
    146   </template> 
    147  
    148   <exe id="wxdba_test_static" template_append="testbase,dba-csv-exe-static,dba-xml-exe-static" cond="SHARED=='0' and USE_GUI=='1' and TESTS=='1'"> 
     185    <sys-lib>$(CSVLIB_STATIC)</sys-lib> 
     186    <sys-lib>$(XMLLIB_STATIC)</sys-lib> 
     187  </template> 
     188 
     189  <exe id="wxdba_test_static" template_append="testbase" cond="SHARED=='0' and USE_GUI=='1' and TESTS=='1'"> 
    149190    <nameexe>wxdba_test_static</nameexe> 
    150191    <library>libwxdbabase_static</library> 
     
    152193  </exe> 
    153194 
    154   <exe id="wxdba_test_dynamic" template_append="testbase,dba-csv-exe-dynamic,dba-xml-exe-dynamic" cond="SHARED=='1' and USE_GUI=='1' and TESTS=='1'"> 
     195  <exe id="wxdba_test_dynamic" template_append="testbase" cond="SHARED=='1' and USE_GUI=='1' and TESTS=='1'"> 
    155196    <nameexe>wxdba_test_dynamic</nameexe> 
    156197    <library>libwxdbabase_dynamic</library> 
  • trunk/wxdba/wxdba/csvarchive.h

    r20 r169  
    99#ifndef WXDBACSVARCHIVE_H 
    1010#define WXDBACSVARCHIVE_H 
     11 
     12#ifdef USE_CSV 
    1113 
    1214#include <wx/string.h> 
     
    4547} 
    4648 
     49#endif //USE_CSV 
     50 
    4751#endif 
  • trunk/wxdba/wxdba/csvistream.h

    r20 r169  
    99#ifndef WXDBACSVISTREAM_H 
    1010#define WXDBACSVISTREAM_H 
     11 
     12#ifdef USE_CSV 
    1113 
    1214#include <dba/csv.h> 
     
    3335} 
    3436 
     37#endif //USE_CSV 
     38 
    3539#endif 
  • trunk/wxdba/wxdba/csvostream.h

    r21 r169  
    99#ifndef WXDBACSVOSTREAM_H 
    1010#define WXDBACSVOSTREAM_H 
     11 
     12#ifdef USE_CSV 
    1113 
    1214#include <dba/csv.h> 
     
    3032} 
    3133 
     34#endif //USE_CSV 
     35 
    3236#endif 
  • trunk/wxdba/wxdba/exception.h

    r150 r169  
    5959}; 
    6060 
     61#ifdef USE_CSV 
     62 
    6163class CSVFileException : public DatabaseException { 
    6264  public: 
     
    6971}; 
    7072 
     73#endif 
     74 
     75#ifdef USE_XML 
     76 
    7177class XMLException : public DatabaseException { 
    7278  public: 
     
    7480}; 
    7581 
     82#endif 
     83 
    7684} 
    7785 
  • trunk/wxdba/wxdba/xmlarchive.cpp

    r153 r169  
     1#ifdef USE_XML 
     2 
    13#include "xmlarchive.h" 
    24#include "wxutils.h" 
     
    1618    else 
    1719      mHandle.setRootNodeName(Tools::ConvertToDbStr(pName,GetConversionSpecs().mDbCharset).c_str()); 
     20  } catch (const dba::Exception& pEx) { 
     21    Exception::Rethrow(pEx); 
     22  }; 
     23}; 
     24 
     25void  
     26XMLArchive::AddNamespace(const wxString& pName, const wxString& pPrefix) { 
     27  try { 
     28    mHandle.addNamespace(Tools::ConvertToDbStr(pName,GetConversionSpecs().mDbCharset).c_str(), 
     29      Tools::ConvertToDbStr(pPrefix,GetConversionSpecs().mDbCharset).c_str()); 
    1830  } catch (const dba::Exception& pEx) { 
    1931    Exception::Rethrow(pEx); 
     
    98110 
    99111} 
     112 
     113#endif //USE_XML 
  • trunk/wxdba/wxdba/xmlarchive.h

    r150 r169  
    11#ifndef WXDBAXMLARCHIVE_H 
    22#define WXDBAXMLARCHIVE_H 
     3 
     4#ifdef USE_XML 
    35 
    46#include <wx/string.h> 
     
    1618    XMLArchive(); 
    1719    void SetRootNodeName(const wxString& pName); 
     20    void AddNamespace(const wxString& pName, const wxString& pPrefix); 
    1821    void Open(const wxString& pOpenStr); 
    1922    bool IsOpen() const; 
     
    3134} 
    3235 
     36#endif //USE_XML 
     37 
    3338#endif 
  • trunk/wxdba/wxdba/xmlistream.cpp

    r150 r169  
     1#ifdef USE_XML 
     2 
    13#include "xmlistream.h" 
    24#include "wxutils.h" 
     
    8688} //namespace 
    8789 
     90#endif //USE_XML 
  • trunk/wxdba/wxdba/xmlistream.h

    r150 r169  
    11#ifndef WXDBAXMLISTREAM_H 
    22#define WXDBAXMLISTREAM_H 
     3 
     4#ifdef USE_XML 
    35 
    46#include <dba/xmlistream.h> 
     
    2628} 
    2729 
     30#endif //USE_XML 
     31 
    2832#endif 
  • trunk/wxdba/wxdba/xmlostream.cpp

    r150 r169  
     1#ifdef USE_XML 
     2 
    13#include "xmlostream.h" 
    24#include "wxutils.h" 
     
    4648} //namespace 
    4749 
     50#endif //USE_XML 
  • trunk/wxdba/wxdba/xmlostream.h

    r150 r169  
    11#ifndef WXDBAXMLOSTREAM_H 
    22#define WXDBAXMLOSTREAM_H 
     3 
     4#ifdef USE_XML 
    35 
    46#include <dba/xmlostream.h> 
     
    2224} //namespace 
    2325 
     26#endif //USE_XML 
     27 
    2428#endif