Commit graph

124 commits

Author SHA1 Message Date
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
Christian Thaeter
f57d637b59 Merge commit 'dc87e78590ea86615d3ebe90d23af4548445b941' into backend_devel
* commit 'dc87e78590ea86615d3ebe90d23af4548445b941':
  add a two-thread acquire test
  show the state of the thread in question
  minor fixes: remove an old comment and change another
  fix the prime test algorithm
  use unsigned long for even more digits!
2010-01-30 00:48:04 +01:00
Michael Ploujnikov
dc87e78590 add a two-thread acquire test
currently this results in a deadlock between lumiera_threadpool_destroy() and thread_loop()
2010-01-26 17:02:31 -05:00
Christian Thaeter
9fc68c9d32 Merge remote branch 'public/nobug201001.2' into backend_devel
* public/nobug201001.2:
  integrating nobug context passing
  updates for nobug 201001.2

Conflicts:
	configure.ac
	src/lib/condition.h
	src/lib/reccondition.h
	tests/backend/test-threads.c
2010-01-23 06:56:39 +01:00
Christian Thaeter
c15f2247d7 integrating nobug context passing
Somewhat more intrusive than the previous patch,
adds contexts everywhere except for sync.hpp where only default ctors
are used.
2010-01-23 01:40:27 +01:00
Michael Ploujnikov
fca6cd786b fix the prime test algorithm
actually test for the output of the function
2010-01-20 07:54:26 -05:00
Michael Ploujnikov
fb61813650 use unsigned long for even more digits! 2010-01-18 12:43:28 -05:00
Michael Ploujnikov
ffdbc7083b use the largest prime that can fit in an it
don't hard-code the number in the test
2010-01-18 12:16:45 -05:00
Christian Thaeter
020908d623 Make threadpool_destroy wait until all threads are finished
adds a state to each threadpool which can be only offline or online.
One can not acquire new threads when the pool is offline.

no need for waits in the teststuite anymore.
2010-01-18 17:53:33 +01:00
Christian Thaeter
d659b1e8e7 fix a PLANNED test glitch 2010-01-17 17:34:23 +01:00
Michael Ploujnikov
de7debc557 fix comilation by using an existing TEST macro 2010-01-16 17:27:02 -05:00