Commit graph

134 commits

Author SHA1 Message Date
afe07bdb16 decommission the safe-bool-idiom (closes #477)
obsoleted by C++11

 * in most cases, it can be replaced by an explicit conversion operator
 * especially for the Lumiera Forward Iterators, we need an implicit conversion
2017-04-02 06:42:23 +02:00
05aaa74422 MERGE Doxygen clean-up done during the last months 2017-04-01 23:59:00 +02:00
b4e0f6bf40 Doxygen: fill in the last missing file level comments for plain-C tests
now each and every source file should be marked with a @file doxygen comment
2017-02-22 03:46:23 +01:00
155bf95ce5 Doxygen: magically insert a reference to the test class
this bit of Sed magic relies on the fact that we happen to write
the almost correct class name of a test into the header comment.

HOWTO:
for F in $(find tests -type f \( -name '*.cpp' \)  -exec egrep -q '§§TODO§§' {} \; -print);
  do sed -r -i -e'
    2          {h;x;s/\s+(.+)\(Test\).*$/\\ref \1_test/;x};
    /§§TODO§§/ {s/§§TODO§§//;G;s/\n//}'
    $F;
done
2017-02-22 03:17:18 +01:00
24b3bec4be Doxygen: prepare all unit tests for inclusion in the documentation
Doxygen will only process files with a @file documentation comment.
Up to now, none of our test code has such a comment, preventing the
cross-links to unit tests from working.

This is unfortunate, since unit tests, and even the code comments there,
can be considered as the most useful form of technical documentation.
Thus I'll start an initiative to fill in those missing comments automatically
2017-02-22 01:54:20 +01:00
dd041ff80c Library: thread self recognition implemented and tested (closes #1054) 2017-01-07 01:01:39 +01:00
d74f1447f3 Library: thread self recognition feature defined (#1054) 2017-01-06 23:26:33 +01:00
00077d0431 ProcDispatcher: decide on requirements and implementation structure (#1049) 2016-12-15 20:48:35 +01:00
dbc75fac7d Doxygen: we missed the plain C code 2016-11-03 18:26:43 +01:00
48e9b7594a Doxygen: identify all files lacking a @file comment
reason is, only files with a @file comment will be processed
with further documentation commands. For this reason, our Doxygen
documentation is lacking a lot of entries.

HOWTO:
find src -type f \( -name '*.cpp' -or -name '*.hpp' \) -not -exec egrep -q '\*.+@file' {} \; -print -exec sed -i -r -e'\_\*/_,$ { 1,+0 a\
\
\
/** @file §§§\
 ** TODO §§§\
 */
}' {} \;
2016-11-03 18:20:10 +01:00
aa17106c41 link tests with stringent application scope dependencies (closes #938)
- the tests covering threadind support and object monitors
  are located in the backend test-library and linked against liblumierabackend.so
- some fundamental facilities of proc-layer moved from the library tree
  into the basic components tree, since *testing* them requires at least
  to link against liblumieracommon.so
2014-10-17 21:15:59 +02:00
ada5cefaaf re-arrange tests according to layer structure
the buildsystem will now pick up and link
all test cases according to the layer, e.g.
backend tests will automatically be linked
against the backend + library solely.
2013-01-07 05:43:01 +01:00
b2d6074097 cleanup test includes 2011-12-02 21:34:29 +01:00
ad59049ed0 disable broken Thread-joining test. See Ticket #803 2011-05-21 06:52:50 +02:00
3f1b7651e9 GPL header whitespace 2010-12-17 23:28:49 +01:00
Stefan Kangas
0fac2b6569 Use CHECK instead of ENSURE in test suite. (Ticket #250) 2010-12-17 21:08:44 +01:00
Stefan Kangas
518f4bac1a Use CHECK instead of REQUIRE in test suite. (Ticket #250) 2010-12-17 21:05:50 +01:00
Christian Thaeter
c66b71deb2 extend fileheader with some flags and endianess mark 2010-07-21 06:13:59 +02:00
Christian Thaeter
c908cf4807 Start of 'fileheader' implementation
Lumiera will create and use some files on its own (caches, indices). This
lies the foundation for identifying this files.
2010-07-21 06:13:59 +02:00
Christian Thaeter
f967f9427b FIX: tmpbuf.h includes in backend 2010-07-21 05:05:32 +02:00
Christian Thaeter
ccbdcfdef9 cosmetics, remove quotes in filedescriptor test 2010-07-21 04:50:03 +02:00
Christian Thaeter
da23204bf3 Exclusive file locking
This adds global exclusive advisory file locks on a per-thread basis.
Only exclusive locking for a whole file is supported to setup headers etc.
Finer grained locking will be handled somewhere else.
2010-07-21 04:49:51 +02:00
Christian Thaeter
2dfef6cac4 add nobug flag to FILE_MMAP_SECTION() macro 2010-07-21 04:49:50 +02:00
Christian Thaeter
a8339fb5d0 add mmaping of exact blocks
namely file headers needs to be accessed unaligned and exactly as given,
this adds mmap functions to create mmap objects to do this.
2010-07-21 04:49:50 +02:00
Christian Thaeter
c4cbde9853 add a 'bias' to offset mmaped clusters
We will need cluster/page aligned access for certain files (indices),
this files will contain an initial header describing the contents. A bias
is used to step over this header and align the following data.
2010-07-21 04:49:40 +02:00
Christian Thaeter
4fee3d85cf testsuite update, new test.h to be in sync with nobug
test.h introduces a PLANNED_TEST() macro for C code, shows what tests
are provided and so on (the nobug version did that since some time).

test names are now passed as identifers and translated to strings by the
macros.

A lot fixes for existing tests, replace some printfs with ECHO, cosmetics.

one threadpool (sync_many) test is broken and set to PLANNED, this needs
further testsuite support for dispatching output.

add a TEST nobug flag to test.h
2010-07-21 04:49:18 +02:00
Christian Thaeter
3201ae5d8c remove acquirer list for mmap regions in use, refcount is enough 2010-07-21 04:28:42 +02:00
Christian Thaeter
e0939e9469 improve the mmap handling
* add frontend interfaces to file to get a mmaping
 * SECTION macro to encapsulate mmap access
 * mmap_address() translating an actual offset to address
 * add some tests
 * some test cosmetics
2010-07-21 04:28:42 +02:00
Michael Ploujnikov
433448ff44 use _join() instead of a second _sync() to wait for the worker to finish 2010-02-12 07:20:32 -05:00
Michael Ploujnikov
d80ae17ea4 test simple-sync: avoid a race condition in output checking by using an assert 2010-02-10 20:53:44 -05:00
Michael Ploujnikov
62b70bfd7e test sync-joinable: use asserts instead of checking the program output 2010-02-10 20:53:32 -05:00
Michael Ploujnikov
5d929f1522 test sync-many: replace output checking with asserts
Also modify the input value right after passing to a worker thread. This is a better test of synchronization.
2010-02-10 20:53:13 -05:00
Christian Thaeter
26f88bc3f1 Merge remote branch 'plouj/second-tp-attempt' into backend_devel
* plouj/second-tp-attempt:
  basic joinable thread test
  joinable thread sync test
2010-02-08 18:20:05 +01:00
Christian Thaeter
33a0591689 Make resourcecollector initialization explicit
instead automatic initialization, the resourcecollector is pulled up as
backend service.
2010-02-05 09:20:52 +01:00
Christian Thaeter
d350a250fa Move the resourcecollector to the backend, closes #521 2010-02-05 08:58:19 +01:00
Michael Ploujnikov
c64984b859 Merge remote branch 'ct/backend_devel' into second-tp-attempt 2010-02-04 22:48:03 -05:00
Christian Thaeter
cdd8136524 uppercase the 'TESTS' nobug flag for the testsuite, fix tests
this flag is little special and can be confused with runtime flags
2010-02-04 09:47:29 +01:00
Michael Ploujnikov
48829bc9ad basic joinable thread test 2010-02-03 17:06:27 -05:00
Michael Ploujnikov
bd6ed5aa88 joinable thread sync test
Right now causes 32bytes to be lost
2010-02-03 08:02:41 -05:00
Michael Ploujnikov
73f1bbae2a added two sync tests
one with a single thread and one with 100 randomly sleeping ones
2010-02-02 20:44:35 -05:00
Michael Ploujnikov
8588fa2b9c it is more proper to use cond_sync flags for *CONDITION_SECTIONs 2010-02-01 07:25:49 -05:00
Michael Ploujnikov
b799321dff add a threads/threadpool NOBUG flag hierarchy
and remove redundant/errorneous flag initializations as a result
also use the test flag from logging.h
2010-02-01 07:25:06 -05:00
Michael Ploujnikov
c57c02ea45 replace an old test with a compile-only one which spawns way too many threads 2010-01-31 20:05:05 -05:00
Michael Ploujnikov
79f8481f99 increase the delay in threads to 10ms 2010-01-31 19:46:48 -05:00
Michael Ploujnikov
64ab9f6bf7 wrap prime test in usleep() to make the thread likely to be re-scheduled 2010-01-31 13:33:47 -05:00
Michael Ploujnikov
6aacf490a3 add a comile-only test with threads sleeping for random intervals 2010-01-29 22:42:28 -05:00
Michael Ploujnikov
362069ea53 make the process-function test run really quickly 2010-01-29 22:42:28 -05:00
Michael Ploujnikov
f69006aa54 test spawning a bunch of short sleeping threads 2010-01-29 22:42:20 -05:00
Christian Thaeter
74560cdd99 remove some lock sections in thread two_acquire_test
After acquired, the caller 'owns' the thread handle and can inspect it,
the associated thread is defined to be waiting for a wakeup signal
(and then one shouldn't do unlocked access to the thread handle)
2010-01-30 03:30:08 +01:00
Christian Thaeter
4aa5380311 FIX: two-threads-acquire test, eternal wait for wakeup signal 2010-01-30 02:57:57 +01:00