Commit graph

45 commits

Author SHA1 Message Date
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
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
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
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
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
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
Michael Ploujnikov
56cf53adb3 fix compilation 2010-01-07 18:36:51 -05:00
Christian Thaeter
a698128cfc new no-function test, sleep a bit before destroying the threadpool 2009-12-24 01:55:24 +01:00
Michael Ploujnikov
f2406c23a1 bork bork bork
by pulling this you agree to...
2009-12-23 13:10:31 -05:00
Michael Ploujnikov
eedfafb0d0 convert lumiera_thread_state to using the enum string trick and use it in a test 2009-11-29 18:06:14 -05:00
Michael Ploujnikov
fc16de332f convert lumiera_thread_class to using the enum string trick and use it in a test 2009-11-29 17:55:20 -05:00
Michael Ploujnikov
98519c57da reduce the number of threads spawned in tests to avoid EAGAIN errors from pthread_create (at least on my 2.6.31.5-127.fc12.x86_64 Core2Duo T9600 system) 2009-11-27 11:39:23 -05:00
Michael Ploujnikov
99eb790027 rename LUMIERA_THREAD_* to LUMIERA_THREADCLASS_* in enum lumiera_thread_class 2009-11-26 11:21:31 -05:00
Michael Ploujnikov
af80622ef5 begin implementing a 'soft' thread count limit per pool
add LUMIERA_DIE in cases where this soft limit is reached
add LUMIERA_DIE when pthread_create fails to create threads - serious
add a test which tries to break the soft limit
2009-11-26 10:24:18 -05:00
Michael Ploujnikov
bd076e4210 reduce the number of threads spawned in a test 2009-11-26 10:24:18 -05:00
Michael Ploujnikov
07962b5314 add comments about locking in lumiera_threadpool_release_thread()
output the size of the created thread struct
don't print "destroying thread" (lets tests become shorter with repeated matching)
add a test which spans many threads in all pools
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
d6d81f2e44 added lumiera_threadpool_destroy()
added locking and checks to lumiera_threadpool_acquire_thread()
added a nobug flag to threads.c
added lumiera_thread_destroy()
added lumiera_thread_delete()
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
414b8b99c3 updated test passes
fixed problem with copying lists
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
75696986e4 test passes 2009-11-26 10:24:17 -05:00
Michael Ploujnikov
10f79290a1 add lumiera_threadpool_release_thread
make the test compile
change from type to kind
2009-11-26 10:24:17 -05:00
Michael Ploujnikov
9dd838b129 acquire() test started, so far, everything just compiles 2009-11-26 10:24:17 -05:00
Michael Ploujnikov
00eb4eda46 partial code skeleton 2009-11-26 10:24:17 -05:00