Changeset 127

Show
Ignore:
Timestamp:
05/02/08 13:49:52 (8 months ago)
Author:
zork
Message:

fixed static build flags for unix

Files:

Legend:

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

    r126 r127  
    1111    <option name="ODBC_LIBS"/> 
    1212    <option name="ODBC_CFLAGS"/> 
     13    <option name="xml2_LIBS"/> 
     14    <option name="xml2_CXXFLAGS"/> 
    1315  </if> 
    1416   
  • trunk/dba/dba.bkl

    r126 r127  
    9292  </set> 
    9393 
    94   <template id="dbabase"> 
     94  <template id="xml-lib"> 
     95    <if cond="FORMAT!='autoconf'"> 
     96      <if cond="TOOLSET=='win32'"> 
     97        <lib-path>"$(DOLLAR)($(ENV_VAR)LIBXML2)$(DIRSEP)lib"</lib-path> 
     98        <include>"$(DOLLAR)($(ENV_VAR)LIBXML2)$(DIRSEP)include"</include> 
     99      </if> 
     100    </if> 
     101    <if cond="FORMAT=='autoconf'"> 
     102      <cxxflags>$(xml2_CXXFLAGS)</cxxflags> 
     103    </if> 
     104  </template> 
     105   
     106  <template id="xml-exe" template="xml-lib"> 
     107    <if cond="FORMAT!='autoconf'"> 
     108      <if cond="TOOLSET=='win32'"> 
     109        <sys-lib>libxml2</sys-lib> 
     110      </if> 
     111    </if> 
     112    <if cond="FORMAT=='autoconf'"> 
     113      <ldlibs>$(xml2_LIBS)</ldlibs> 
     114    </if>     
     115  </template> 
     116   
     117  <template id="dbabase" template="xml-lib"> 
    95118    <name>dba</name> 
    96119    <sources>$(LIBSOURCES)</sources>--> 
     
    183206  <set var="MSVC6PRJ_MERGED_TARGETS" append="1">dbacsv=dbacsv_static+dbacsv_dynamic</set> 
    184207 
    185   <template id="dbaxml_base"
     208  <template id="dbaxml_base" template="xml-lib"
    186209    <name>dbaxml</name> 
    187210    <include>$(LIBSRC)</include> 
     
    270293  </set> 
    271294 
    272   <lib id="dbatestlib" template="lib" template_append="cppunit" cond="TESTS=='1'"> 
     295  <lib id="dbatestlib" template="lib,xml-lib" template_append="cppunit" cond="TESTS=='1'"> 
    273296    <sources>$(TESTLIB_SOURCES)</sources> 
    274297    <msvc-headers>$(TESTLIB_HEADERS)</msvc-headers> 
     
    284307  </lib> 
    285308 
    286   <template id="dbaexe_base"
     309  <template id="dbaexe_base" template="xml-exe"
    287310    <app-type>console</app-type> 
    288311    <include>$(SRCDIR)</include> 
     
    314337    <library>libdba_static</library> 
    315338    <library>dbacsv_static</library> 
     339    <library>dbaxml_static</library> 
    316340  </exe> 
    317341 
  • trunk/dba/dba/xmlarchive.cpp

    r126 r127  
    1515 
    1616XMLArchive::XMLArchive() 
    17  : Archive() 
     17  : Archive(), 
     18    mDocument(NULL), 
     19    mRootNode(NULL) 
    1820{ 
    1921} 
    2022 
     23void  
     24XMLArchive::open(const char* pOpenStr) { 
     25  //TODO 
     26}; 
     27 
     28void  
     29XMLArchive::open(xmlNodePtr pRoot) { 
     30  //TODO 
     31}; 
     32 
     33IStream*  
     34XMLArchive::getInputStream() { 
     35  //TODO  
     36}; 
     37 
     38OStream*  
     39XMLArchive::getOutputStream() { 
     40  //TODO 
     41}; 
    2142 
    2243XMLArchive::~XMLArchive() 
    2344{ 
     45  xmlFreeDoc(mDocument); 
    2446} 
    2547 
  • trunk/dba/dba/xmlarchive.h

    r126 r127  
    1414 
    1515#include "archive.h" 
     16#include <libxml/tree.h> 
    1617 
    1718namespace dba { 
     19 
     20class OStream; 
     21class IStream; 
    1822 
    1923/** 
     
    2327  public: 
    2428    XMLArchive(); 
    25     ~XMLArchive(); 
     29    virtual void open(const char* pOpenStr); 
     30    void open(xmlNodePtr pRoot); 
     31    virtual bool isOpen() const { return mRootNode != NULL; } 
     32    virtual IStream* getInputStream(); 
     33    virtual OStream* getOutputStream(); 
     34    virtual ~XMLArchive(); 
     35  private: 
     36    /** 
     37      pointer to xml document. NULL if archive is open in external document 
     38    */  
     39    xmlDocPtr mDocument; 
     40    /** 
     41      pointer to xml node that is root of archive. If archive is open using connect string 
     42      then node points to root node of mDocument, otherwise node is set to  
     43      some node of external document 
     44    */ 
     45    xmlNodePtr mRootNode; 
    2646}; 
    2747 
  • trunk/dba/test/main.cpp

    r126 r127  
    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::manual)); 
    151151  //runner.addTest(new CppUnit::TestCaller<SQLite3SQLArchiveTestCase>("debug_test",&SQLite3SQLArchiveTestCase::transactions_rollback)); 
    152   //runner.addTest(dba_tests::ConnectStringTestCase::suite()); 
     152  runner.addTest(dba_tests::XMLTestCase::suite()); 
    153153  //runner.addTest(new CppUnit::TestCaller<OdbcPluginTestCase>("debug_test",&OdbcPluginTestCase::dbConnection)); 
    154154  //runner.addTest(new CppUnit::TestCaller<PostgresSQLArchiveTestCase>("debug_test",&PostgresSQLArchiveTestCase::sqlError)); 
  • trunk/dba/test/xmltestcase.cpp

    r126 r127  
    1414namespace dba_tests { 
    1515 
     16CPPUNIT_TEST_SUITE_REGISTRATION(XMLTestCase); 
     17 
     18void  
     19XMLTestCase::setUp() { 
     20  mArchive = new dba::XMLArchive; 
     21}; 
     22 
     23void  
     24XMLTestCase::tearDown() { 
     25  delete mArchive; 
     26  mArchive = NULL; 
     27}; 
     28 
     29XMLTestCase::~XMLTestCase() { 
     30  delete mArchive; 
     31}; 
     32 
     33//tests 
     34void  
     35XMLTestCase::empty() { 
     36  //TODO 
     37}; 
     38 
    1639} //namespace 
  • trunk/dba/test/xmltestcase.h

    r126 r127  
    1515#include <cppunit/TestCase.h> 
    1616#include <cppunit/extensions/HelperMacros.h> 
     17#include "dba/xmlarchive.h" 
    1718 
    1819namespace dba_tests { 
     
    2425*/ 
    2526class XMLTestCase : public CppUnit::TestCase { 
     27    CPPUNIT_TEST_SUITE(XMLTestCase); 
     28      CPPUNIT_TEST(empty); 
     29    CPPUNIT_TEST_SUITE_END(); 
    2630  public: 
    27  
     31    virtual void setUp(); 
     32    virtual void tearDown(); 
     33    virtual ~XMLTestCase(); 
     34         
     35    //tests 
     36    void empty(); 
     37  private: 
     38    dba::XMLArchive* mArchive; 
    2839}; 
    2940