test driven planning

next steps will be to invent a mock UI element
and then to wire and operat this mock through the UI-Bus
This commit is contained in:
Fischlurch 2015-11-26 22:23:43 +01:00
parent bb627fc1f8
commit 42c2569bb8
3 changed files with 311 additions and 19 deletions

View file

@ -7,6 +7,16 @@ return: 0
END
PLANNED "the abstracted tangible UI element" AbstractTangible_test <<END
return: 0
END
PLANNED "building block of the UI-Bus" BusTerm_test <<END
return: 0
END
PLANNED "Concept demonstration: retrieve session contents" SessionStructureMapping_test <<END
return: 0
END
@ -15,22 +25,3 @@ END
PLANNED "Concept demonstration: update hierarchical elements" TangibleUpdate_test <<END
return: 0
END
PLANNED "ModelClip_test" ModelClip_test <<END
END
PLANNED "ModelGroupTrack_test" ModelGroupTrack_test <<END
END
PLANNED "ModelParentTrack_test" ModelParentTrack_test <<END
END
PLANNED "ModelProject_test" ModelProject_test <<END
END
PLANNED "ModelSequence_test" ModelSequence_test <<END
END
PLANNED "ModelTrack_test" ModelTrack_test <<END
END

View file

@ -0,0 +1,149 @@
/*
AbstractTangible(Test) - cover the operations of any tangible UI element
Copyright (C) Lumiera.org
2015, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
/** @file abstract-tangible-test.cpp
* Verify the common base shared by all interface elements of relevance.
** This test is not so much a test, than a test of the test support for testing
** [primary elements][gui::model::Tangible] of the Lumiera GTK UI. Any such element
** is connected to the [UI-Bus][gui::UiBus] and responds to some generic actions and
** interaction patterns. This is the foundation of any presentation state recording
** and restoration, and it serves to invoke any persistent action on the
** [Session] through a single channel and access point.
**
** What is covered here is actually a **test mock**. Which in turn enables us
** to cover interface interactions and behaviour in a generic fashion, without
** actually having to operate the interface.
**
** @note as of 11/2015 this is a draft into the blue...
** @todo WIP ///////////////////////TICKET #959
** @todo WIP ///////////////////////TICKET #956
** @todo WIP ///////////////////////TICKET #975
** @todo WIP ///////////////////////TICKET #961 : tests to pass...
**
** @see gui::UiBus
**
*/
#include "lib/test/run.hpp"
//#include "gui/model/session-facade.hpp"
//#include "gui/model/diagnostics.hpp"
//#include "lib/util.hpp"
//#include <boost/lexical_cast.hpp>
//#include <iostream>
//#include <string>
//#include <map>
//using boost::lexical_cast;
//using util::contains;
//using std::string;
//using std::cout;
//using std::endl;
namespace gui {
namespace model{
namespace test {
namespace { // test fixture...
}//(End) test fixture
/***********************************************************************//**
* @test cover the basic operations of any tangible UI element,
* with the help of a mock UI element.
* - creation
* - destruction
* - command invocation
* - state mark
* - state mark replay
* - message casting
* - error state indication
*
* @see SessionElementQuery_test
* @see gui::model::SessionFacade
*/
class AbstractTangible_test : public Test
{
virtual void
run (Arg)
{
verify_mockManipulation();
invokeCommand();
markState();
notify();
mutate();
}
/** @test how to retrieve and enumerate session contents
* as operation initiated from GUI display code
*/
void
verify_mockManipulation ()
{
UNIMPLEMENTED ("setup and usage of an UI-Element mock");
}
void
invokeCommand ()
{
UNIMPLEMENTED ("invoke an action, pass arguments");
}
void
markState ()
{
UNIMPLEMENTED ("mark interface state");
}
void
notify ()
{
UNIMPLEMENTED ("receive various kinds of notifications");
}
void
mutate ()
{
UNIMPLEMENTED ("mutate the element by diff message");
}
};
/** Register this test class... */
LAUNCHER (AbstractTangible_test, "unit gui");
}}} // namespace gui::model::test

152
tests/gui/bus-term-test.cpp Normal file
View file

@ -0,0 +1,152 @@
/*
BusTerm(Test) - cover the building block of the UI-Bus
Copyright (C) Lumiera.org
2015, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "lib/test/run.hpp"
//#include "gui/model/session-facade.hpp"
//#include "gui/model/diagnostics.hpp"
//#include "lib/util.hpp"
//#include <boost/lexical_cast.hpp>
//#include <iostream>
//#include <string>
//#include <map>
//using boost::lexical_cast;
//using util::contains;
//using std::string;
//using std::cout;
//using std::endl;
namespace gui {
namespace model{
namespace test {
namespace { // test fixture...
}//(End) test fixture
/**************************************************************************//**
* @test cover the standard node element (terminal element) within the UI-Bus,
* with the help of an attached mock UI element.
*
* This test enacts the fundamental generic communication patterns
* to verify the messaging behaviour
* - attaching a [BusTerm]
* - generating a command invocation
* - argument passing
* - capture a _state mark_
* - replay a _state mark_
* - cast messages and error states downstream
* - generic operating of interface states
* - detaching on element destruction
*
* @see AbstractTangible_test
* @see gui::model::Tangible
* @see gui::ctrl::BusTerm
*/
class BusTerm_test : public Test
{
virtual void
run (Arg)
{
attachNewBusTerm();
commandInvocation();
captureStateMark();
replayStateMark();
verifyNotifications();
clearStates();
pushDiff();
destroy();
}
void
attachNewBusTerm ()
{
UNIMPLEMENTED ("build a new BusTerm and verify connectivity");
}
void
commandInvocation ()
{
UNIMPLEMENTED ("pass a message to invoke an action");
}
void
captureStateMark ()
{
UNIMPLEMENTED ("message to capture interface state");
}
void
replayStateMark ()
{
UNIMPLEMENTED ("replay previously captured state information");
}
void
verifyNotifications ()
{
UNIMPLEMENTED ("send notifications to a distinct element");
}
void
clearStates ()
{
UNIMPLEMENTED ("broadcast state reset");
}
void
pushDiff ()
{
UNIMPLEMENTED ("push a mutation diff towards an interface element");
}
void
destroy ()
{
UNIMPLEMENTED ("detach and destroy the test BusTerm");
}
};
/** Register this test class... */
LAUNCHER (BusTerm_test, "unit gui");
}}} // namespace gui::model::test