Skip to content

Commit

Permalink
20100422
Browse files Browse the repository at this point in the history
  • Loading branch information
Langeveld committed Apr 22, 2010
1 parent d35b872 commit 54121cb
Show file tree
Hide file tree
Showing 30 changed files with 111 additions and 36 deletions.
50 changes: 45 additions & 5 deletions csource/makedir/izcgiinc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ endif

include $(MAKEDIR)/izextern.mak

all: mocks $(localoutfile)

ifeq ($(MAKECMDGOALS),debug)
DOEDEBUG = debug
endif
Expand Down Expand Up @@ -47,24 +49,62 @@ IMGDIR= ./img/
WSDLDIR= ./wsdl/
ELMDIR= ./elm/

mock_files := $(shell grep -l MOCK *.?pp)
headers = $(wildcard *.hpp)
cfiles = $(wildcard *.cpp)
objects = $(addprefix $(OBJDIR),$(patsubst %.cpp,%.o,$(cfiles)))
deps = $(addprefix $(OBJDIR),$(patsubst %.cpp,%.dep,$(cfiles)))
tpls = $(wildcard $(TPLDIR)*.tpl)
imgs = $(wildcard $(IMGDIR)*.tpl)


DEPEND = $(OBJDIR)make.depend

headers = $(wildcard *.hpp)

localoutfile=$(OBJDIR)$(outfile)

$(localoutfile):$(objects) $(LIBS)
$(localoutfile):mocks $(objects) $(LIBS)
@printf "$c---- Link $@ ----$e"
@$(LINK) $(LINK_FLAGS) $(PROFILEFLAG) $+ -o $@

all: $(localoutfile)
no_mocks_msg:
@echo "-- NO MOCKS"

updir: updir_msg
$(MAKE) -C ..

updir_msg:
@echo "-- updir"

MOCKDIR=.mocks
MOCKDIR_DOXY_SRC=.mocks_doxy
MOCKDIR_DOXY_DEST=.mocks_xml

ifneq ($(mock_files),)
mocks: mocks_doxy mocks_xml mocks_build mocks_clean
else
mocks: no_mocks_msg
endif

mocks_clean:
@echo "-- mocks_clean"
rm -rf $(MOCKDIR)
rm -rf $(MOCKDIR_DOXY_SRC)
rm -rf $(MOCKDIR_DOXY_DEST)

mocks_mkdir:
@echo "-- mocks_mkdir"
mkdir -p $(MOCKDIR)
mkdir -p $(MOCKDIR_DOXY_SRC)

mocks_doxy: updir mocks_clean mocks_mkdir
@echo "Generate dependencies for $(mock_files)"
$(CP) -D MOCK_RUN -M -MM $(mock_files) $(INCLUDE) | ../obj/mocks --link

mocks_xml:
@echo "-- mocks_xml"
doxygen MOCKS.doxy

mocks_build:
../obj/mocks

show_Basedir:
@printf "\n"
Expand Down
Empty file modified csource/makedir/izcolors.mak
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion csource/makedir/izextern.mak
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endif
# BOOST version
################################
ifeq ("$(IZ_BOOST_VERSION)","")
IZ_BOOST_VERSION=1_42
IZ_BOOST_VERSION=1_42_0
endif

# alleen de gebruikte libs worden meegelinkt; er zijn er nog (veel) meer...
Expand Down
Empty file modified csource/mocks/IndexParser.hpp
100644 → 100755
Empty file.
Empty file modified csource/mocks/IndexParser.ppc
100644 → 100755
Empty file.
26 changes: 26 additions & 0 deletions csource/mocks/MyMock.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
*** @file
*** @brief "$Id$"
**/

#ifndef __MYMOCK_HPP__
#define __MYMOCK_HPP__

#include <Stringize.hpp>
#define MOCK_CAT( a,b ) a##b
#define MOCK_NS_HELPER( subject ) namespace mock_generator_settings { struct MOCK_CAT( Mock,subject ) : public subject {}; }
#define MOCK_INCLUDE_HELPER( subject ) STRINGIZE( MOCK_CAT( .mocks/Mock,subject ).hpp )

#endif

#ifdef MOCK

#ifdef MOCK_RUN
MOCK_NS_HELPER( MOCK )
#else
#include MOCK_INCLUDE_HELPER( MOCK )
#endif

#undef MOCK
#undef MOCK_HIDE_PROTECTED
#endif
Empty file modified csource/mocks/Parent.cpp
100644 → 100755
Empty file.
Empty file modified csource/mocks/Parent.hpp
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions csource/mocks/SettingsParser.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ SettingsParser::~SettingsParser()

TiXmlElement* SettingsParser::findNamespace( TiXmlElement* element )
{
while ( element != 0 && NAMESPACE_ATTRIB != element->Attribute( KIND_ATTRIB.c_str() ) )
while ( element != 0 && KIND_NAMESPACE != element->Attribute( ATTRIB_KIND.c_str() ) )
{
element = element->NextSiblingElement( COMPOUND_TAG );
element = element->NextSiblingElement( TAG_COMPOUND );
}

return element;
Expand All @@ -55,11 +55,11 @@ TiXmlElement* SettingsParser::findNextMock( TiXmlElement* current )
{
if ( current == 0 )
{
current = this->findNamespace( mDoc.RootElement()->FirstChildElement( COMPOUNDDEF_TAG ) );
return current->FirstChildElement( MOCK_TAG );
current = this->findNamespace( mDoc.RootElement()->FirstChildElement( TAG_COMPOUNDDEF ) );
return current->FirstChildElement( TAG_MOCK );
}

return current->NextSiblingElement( MOCK_TAG );
return current->NextSiblingElement( TAG_MOCK );
}

bool SettingsParser::findMock()
Expand All @@ -75,5 +75,5 @@ std::string SettingsParser::mockName() const

std::string SettingsParser::mockRefID() const
{
return mCurrent->Attribute( REFID_ATTRIB.c_str() );
return mCurrent->Attribute( ATTRIB_REFID.c_str() );
}
Empty file modified csource/mocks/SettingsParser.hpp
100644 → 100755
Empty file.
16 changes: 8 additions & 8 deletions csource/mocks/StructList.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ using std::string;

void StructList::collectMockers( StructParser& sp, Structure& mock )
{
while ( sp.findMocker() )
{
Mocker theMocker( sp.getType(), sp.getName(), sp.getConst() );
while ( sp.findParameter() )
{
Mocker::Parameter param( sp.getType(), sp.getName() );
}
}
// while ( sp.findMocker() )
// {
// Mocker theMocker( sp.getType(), sp.getName(), sp.getConst() );
// while ( sp.findParameter() )
// {
// Mocker::Parameter param( sp.getType(), sp.getName() );
// }
// }
}

void StructList::collectParents( StructParser& sp, Structure& mock )
Expand Down
Empty file modified csource/mocks/StructList.hpp
100644 → 100755
Empty file.
12 changes: 7 additions & 5 deletions csource/mocks/StructParser.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
#include "StructParser.hpp"
#include "tagnames.hpp"

#include <string>
#include <utility>

#include <loki/SafeFormat.h>

using Loki::Printf;
using std::make_pair;
using std::string;

// *tors

Expand Down Expand Up @@ -59,18 +61,18 @@ TiXmlElement* StructParser::findNextMocker( TiXmlElement* pCurrent )
? mCompoundDefElement->FirstChildElement( TAG_MEMBER )
: pCurrent->NextSiblingElement( TAG_MEMBER ) );
}
while ( pCurrent && ( pCurrent->Attribute( ATTRIB_STATIC ) == YES || pCurrent->Attribute( ATTRIB_VIRTUAL ) == VIRTUAL_NON ) );
while ( pCurrent && ( *( pCurrent->Attribute( ATTRIB_STATIC ) ) == YES || *( pCurrent->Attribute( ATTRIB_VIRTUAL ) ) == VIRTUAL_NON ) );
return pCurrent;
}

TiXmlElement* StructParser::findNextParent( TiXmlElement* pCurrent )
{
if ( pCurrent == 0 )
{
return mCompoundDefElement->FirstChildElement( PARENT_TAG );
return mCompoundDefElement->FirstChildElement( TAG_PARENT );
}

return pCurrent->NextSiblingElement( PARENT_TAG );
return pCurrent->NextSiblingElement( TAG_PARENT );
}

bool StructParser::findParent()
Expand All @@ -86,10 +88,10 @@ std::string StructParser::getName()

std::string StructParser::getRefID()
{
return mCurrent->Attribute( REFID_ATTRIB.c_str() );
return mCurrent->Attribute( ATTRIB_REFID.c_str() );
}

std::string StructParser::getVisibility()
{
return mCurrent->Attribute( VISIBILITY_ATTRIB.c_str() );
return mCurrent->Attribute( ATTRIB_VISIBILITY.c_str() );
}
1 change: 1 addition & 0 deletions csource/mocks/StructParser.hpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class StructParser
private:
TiXmlElement* mCompoundDefElement;

TiXmlElement* findNextMocker( TiXmlElement* pCurrent );
TiXmlElement* findNextParent( TiXmlElement* element );

};
Expand Down
2 changes: 1 addition & 1 deletion csource/mocks/Structure.hpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef __STRUCTURE_HPP__
#define __STRUCTURE_HPP__

#include "Mocker.hpp"
// #include "Mocker.hpp"
#include "Parent.hpp"

#include <string>
Expand Down
Empty file modified csource/mocks/XmlParser.cpp
100644 → 100755
Empty file.
Empty file modified csource/mocks/XmlParser.hpp
100644 → 100755
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions csource/mocks/test/Makefile → csource/mocks/example/Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ MOCKDIR=.mocks
MOCKDIR_DOXY_SRC=.mocks_doxy
MOCKDIR_DOXY_DEST=.mocks_xml

mock_files := $(shell grep -l mock_generator_settings *.?pp)

ifneq ($(mock_files),)
mocks: mocks_doxy mocks_xml mocks_build mocks_clean
else
mocks:
endif

mocks_clean:
rm -rf $(MOCKDIR)
Expand All @@ -42,8 +48,8 @@ mocks_mkdir:
mkdir -p $(MOCKDIR_DOXY_SRC)

mocks_doxy: updir mocks_clean mocks_mkdir
@echo "Generate dependencies for $(cfiles)"
$(CP) -M -MM $(cfiles) | ../obj/mocks --link
@echo "Generate dependencies for $(mock_files)"
$(CP) -D MOCK_RUN -M -MM $(mock_files) $(INCLUDE) | ../obj/mocks --link

mocks_xml:
doxygen MOCKS.doxy
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file modified csource/mocks/main.cpp
100644 → 100755
Empty file.
16 changes: 8 additions & 8 deletions csource/mocks/tagnames.hpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ const std::string XMLPATH = "./.mocks_xml/";
const std::string YES = "yes";
const std::string NO = "no";

const std::string COMPOUND_TAG = "compound";
const std::string COMPOUNDDEF_TAG = "compounddef";
const std::string TAG_COMPOUND = "compound";
const std::string TAG_COMPOUNDDEF = "compounddef";
const std::string TAG_MEMBER = "memberdef";
const std::string MOCK_TAG = "innerclass";
const std::string PARENT_TAG = "basecompoundref";
const std::string SECTION_TAG = "sectiondef";
const std::string TAG_MOCK = "innerclass";
const std::string TAG_PARENT = "basecompoundref";
const std::string TAG_SECTION = "sectiondef";

const std::string ATTRIB_CONST = "const";
const std::string KIND_ATTRIB = "kind";
const std::string NAMESPACE_ATTRIB = "namespace";
const std::string REFID_ATTRIB = "refid";
const std::string ATTRIB_KIND = "kind";
const std::string ATTRIB_NAMESPACE = "namespace";
const std::string ATTRIB_REFID = "refid";
const std::string ATTRIB_STATIC = "static";
const std::string ATTRIB_VIRTUAL = "virt";
const std::string ATTRIB_VISIBILITY = "prot";
Expand Down

0 comments on commit 54121cb

Please sign in to comment.