Commit graph

4309 commits

Author SHA1 Message Date
2e4d74747e implement logging overrides in the Test-Nexus implementation
the actual functionality is forwareded to the base class,
which is the regular Nexus Hub
2016-01-02 19:16:37 +01:00
3230660d86 implement, cover and use the log clearing function 2016-01-02 02:00:07 +01:00
c6945a452e need helper functionality for tests to scrap existing log contents
...this is necessary whenever the mocked facility covered
by log matching is managed automatically as singleton,
because then other test cases will leave garbage
in the log
2016-01-02 01:41:53 +01:00
d27d9f79c2 define first test case to cover the UI-Bus side of basic element interactions
this test is intended as counterpart to
AbstractTangible_test::verify_mockManipulation()

It creates a mock element and verifies bidirectional
connnectivity to the UI-Bus
2016-01-02 01:23:09 +01:00
603f9e2b7d DOC: fix some Doxygen link syntax
I worked under the erroneous assumption, that Doxygen
will use its internal entity-IDs as the link-IDs when
generating mardown-links. Yes, this seemed logical and
this would be the way I'd implement it....

But seemingly, Doxygen is not so consistent when it
comes to questions of syntax. The same holds true for
markdown, which lacking a coherent definition anyway.

Another problem is that Doxygen's auto-link generation
frequently fails, for reasons not yet clear to me.
Sometimes it seems to be necessary to give it a nudge
by including the \ref command. While I'm not willing
to go into focussed invstigation of Doxygen syntax
right now, at least I've done a search-and-replace
to remove the malformed links I've written the
last days
2015-12-27 03:16:49 +01:00
dddcbe9994 DOC: supply basics of UI-Bus and generic UI-element protocol
the initial draft of this concept is in place now, and
the first round of unit tests pass. I've got some understanding
of the purpose of the interactions and involved elements
and I'm confident this design is evolving in a sane way.

Note: extensive documentation is in the TiddlyWiki,
here I've just pasted and reworded some paragraphs from there
and integrated them into the Doxygen docs
2015-12-27 01:58:15 +01:00
a91d6a3bae implement and cover the zombie network 2015-12-26 22:56:43 +01:00
d7191959cf fix a zombie segementation fault
hey, it's still X-mas...
2015-12-26 21:53:46 +01:00
8cd31443b1 invent a suicidal zombie terminal
yeah, it's X-mas time,
letz build a diagnostic network of deceased widgets...
2015-12-26 20:41:24 +01:00
f23b482d7d adjust test code to get MockElm log joining to PASS
the "log joining" functionality was already implemented
and covered with the generic event log facility, but this test
here was drafted even before that, meaning that the semantics
of matchingn on the log, especially on events, as been
implemented slightly different than planned
2015-12-26 04:55:00 +01:00
b9ef66b221 provide and cover a mock implementation of receiving notification messages 2015-12-26 04:40:38 +01:00
3c24b4f8e4 should provide a generic entry point for all "state mark" messages 2015-12-26 03:03:46 +01:00
3239ea1f87 occasional clean-up of somewhat confusing variable names in test
you'd expect a variable s1 to be a string, wouldn't you?
2015-12-26 02:34:22 +01:00
9aa1fec369 UI-Element protocol: clarify the role of the doExpand() extension point
and let the concrete extension point decide if the corresponding
state change was actually relevant and should be persisted
2015-12-26 00:59:16 +01:00
3a287bf134 implement the generic expand/collapse mechanism 2015-12-25 03:53:26 +01:00
a9552ceace add stubs for the specific implementation within Widget and Controller 2015-12-25 03:51:19 +01:00
5564a51a79 build/platform: make lib SigC++ available for GUI test code
Explanation: sigC++ was already linked as transitive dependency
from gtkmm, since it is used for the "signal-slot" system wihin GTK.
But now we want to use sigC++ itself from our generic UI-Backbone,
so we need to pick up the additional compiler and linker flags
and use them when building the relevant parts of both the application
and the test suite
2015-12-25 03:06:33 +01:00
4d1fcd6dcb implement logging/identification of mock UI elements 2015-12-25 00:41:14 +01:00
972045d8f8 fix a segfault caused by re-entrance
at the point when we're connecting a new node to the UI-Bus,
the new node's BusTerm is not yet initialised, since we need
the uplink connection we're about to create for setting up
this BusTerm.

Consequently, the new nodes's ID is not yet initialised,
so we need to pass this endpoint-ID explicitly to the
registration function.
2015-12-24 22:43:41 +01:00
38e6d635dc implement routing in the UI-Bus hub 2015-12-24 22:27:37 +01:00
37802fd699 complete wiring of nexus and core services
since, by definition, the Nexus is "the" up-link,
all we need is clever overriding of the relevant
handling functions, so the nexus will care for the routing,
while the CoreService cares for command and presentation
state handling
2015-12-19 04:05:21 +01:00
449fa16444 WIP: draft of the UI backbone setup
- front-end handle
- Nexus == routing hub
- CoreService == service access point for command invocation
2015-12-19 03:40:19 +01:00
0f793e0a79 untangle the setup of test nexus 2015-12-18 19:50:57 +01:00
d673d1ed1c better naming of the test facility
I think it is a shame to waste the nice name "nexus"
just for a test facility; rather I've named our central
routing hub in the UI-Bus gui::ctrl::Nexus


So it makes sense to name the fake for unit testing
the test-nexus (we're not at nexus 5 yet)
2015-12-18 19:50:57 +01:00
f19ebd63d0 pondering about how to connect the central bus hub
...especially since we need a faked UI backbone for unit testing
2015-12-18 19:50:02 +01:00
af98d75da4 consider the bus side of the generic UI base in more detail
especially define the outline of the bus communication
and connection management
2015-12-18 01:02:19 +01:00
59c2d2b482 WIP: start implementing the generic UI base 2015-12-16 23:24:11 +01:00
a9a6aabcbc return to topic: UI element protocol
next step will be to rig the mock element and set up
and cover the basic / generic element behaviour

This changeset
 - adapts the (planned) unit test to the semantic of
   the EventLog, which is now fully implemented

 - adjusts the function names on the public Tangible interface,
   to be better in line with the naming convention of the
   corrsponding operations on the UI-Bus:

   * "mark" operations are towards the UI element
   * "note" messages are from the UI element towards some
     state manager, which can be reached via the bus
2015-12-16 02:16:53 +01:00
cb4a0a6e60 change the EventLog header to store a "this" attribute
seems more logical than calling the attribute "ID",
especially since we're now able to use the on("xyz") matcher
2015-12-15 23:44:34 +01:00
c8068496d1 EventLog unit test PASS
so this turned out to be rather expensive,
while actually not difficult to implement.
On the way, I've learned
- how to build a backtracking matcher, based on
  a filtering (monadic) structure and chained lambdas
- learned the hard way how (not) to return a container
  by move-reference
- made first contact with the regular expressions
  now available from the standard library
2015-12-13 05:03:36 +01:00
d0cdae2cee implement matching on regular expressions 2015-12-13 03:24:25 +01:00
c13b859aa5 fix typo in test assertion 2015-12-13 02:02:54 +01:00
42a5668831 implement further match refinements (type, attribute, target) 2015-12-12 23:41:24 +01:00
941fe3a9b9 factor out util function to "stringify" arbitrary arguments
this function is of use also for creating a vector of strings
from a bunch of C-Strings, but it could also be used to
construct other stuff initialised by strings (e.g. RegExps)
2015-12-12 23:18:25 +01:00
33f7fe116a implement refinement filter on log entry's arguments.
Whew! functional programming is such a powerful concept.
You get additional refinement and lazy backtracking
basically for free....
2015-12-12 03:13:32 +01:00
5bc6919bdb implement the specialised event or call-matching logic 2015-12-12 02:23:12 +01:00
80ffdc1f05 provide the remaining, specialised logging calls 2015-12-12 01:35:38 +01:00
261bcc9fdb implement logging of "events" with additional ID / classifier 2015-12-12 01:28:42 +01:00
4522e209fb implement generic log entry with arbitrary fields 2015-12-12 01:24:52 +01:00
894ef68a8f EventLog: implement logging of function invocations 2015-12-12 01:01:46 +01:00
7d9108a079 diagnostics formatting helper: set limited precision for doubles
this deals with a recurring problem in test code:
very common "simple" fractional values can not be represented
precisely as binary floating point. The classical example is 0.1

Since this is a diagnostics facility, we can cheat around this
insidious problem by just setting a limited rendering precision.

Floating point numbers behave deterministic; you just need
to know how to deal with limited precision.
2015-12-12 00:55:28 +01:00
761154ae63 stub the code into submission.... 2015-12-11 20:02:30 +01:00
a9096d8781 WIP: draft further logging functionality to cover
damn nasty how much (eays to implement) functionality
you obviously want to have on any logging facility.
2015-12-11 02:27:14 +01:00
f489343401 WIP: draft behaviour of function call logging 2015-12-10 22:51:31 +01:00
bf92333339 implement log joining in shared heap storage 2015-12-09 01:18:15 +01:00
cd8e6d874c EventLog: switch to shared PImpl
this is prerequisite for joining and sharing logs
2015-12-08 22:14:29 +01:00
09afbb0e12 change implementation technique: use flags instead of exceptions
abandon the use of an assertion exception to signal match failure,
rather use a final bool conversion to retrieve the results.

Error messages are now delivered by side effect into STDERR


The reason is we're unable to deliver the desisred behaviour
with the chosen DSL syntax in C++ ; on a second thought the
new approach is even better aligned with the overall way
we're writing tests in Lumiera. And we produce match-trace
messages to indicate the complete matching path now
2015-12-08 03:20:52 +01:00
b3881696e5 this solution for negative matches is not usable
implemented a solution to determine negative matches.
But because this solution relies on throwing from a destructor,
it is not possible to catch the resulting assertion failure.
Not sure why (AFAIK there is no second exception thrown
while unwinding the stack), but throwing from dtors is
considered "undefined behaviour" anyway.

So this solution is of limited use


beyond that solution, I'm not sure if the desired syntax
can be implemented at all in C++. Seems that we need to build
a bracketing construct, first to initiate a negated match
and finally, after all queries, to detect if there happened
any failure or not
2015-12-08 01:10:02 +01:00
00df7ff477 draft behaviour of helper for negated machtes 2015-12-07 23:47:07 +01:00
272d62d5a3 log handling const correctness
adding log entries requires full access,
whereas matching log entries is const,
since it doesn't alter the log
2015-12-06 04:37:41 +01:00