diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2011-06-17 13:15:52 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-06-17 13:24:39 -0500 |
| commit | b301c77be3ab2b9c097f2e3df47e96a907221ed9 (patch) | |
| tree | ec39f064c115847aa0d93b1e14d7e4746294eefe /src/lib | |
| parent | 609d6810b8bc92dc979f8bbb8e7e7d7b7b5d9490 (diff) | |
| download | talos-hostboot-b301c77be3ab2b9c097f2e3df47e96a907221ed9.tar.gz talos-hostboot-b301c77be3ab2b9c097f2e3df47e96a907221ed9.zip | |
Create testcore directory for kernel-level tests.
Change-Id: I4b6235edec59c0a97f53af431752d2f4dfabcfa9
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/151
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/makefile | 2 | ||||
| -rw-r--r-- | src/lib/test/makefile | 6 | ||||
| -rw-r--r-- | src/lib/test/synctest.H | 93 |
3 files changed, 0 insertions, 101 deletions
diff --git a/src/lib/makefile b/src/lib/makefile index 3fdb3a8b1..86735cf22 100644 --- a/src/lib/makefile +++ b/src/lib/makefile @@ -4,6 +4,4 @@ OBJS = string.o stdlib.o assert.o stdio.o OBJS += syscall_stub.o syscall_task.o syscall_msg.o OBJS += syscall_mmio.o syscall_time.o sync.o -SUBDIRS = test.d - include ${ROOTPATH}/config.mk diff --git a/src/lib/test/makefile b/src/lib/test/makefile deleted file mode 100644 index 723f4b36b..000000000 --- a/src/lib/test/makefile +++ /dev/null @@ -1,6 +0,0 @@ -ROOTPATH = ../../.. - -MODULE = testsyslib -TESTS = *.H - -include ${ROOTPATH}/config.mk diff --git a/src/lib/test/synctest.H b/src/lib/test/synctest.H deleted file mode 100644 index 5a53d2e0a..000000000 --- a/src/lib/test/synctest.H +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef __SYNCTEST_H -#define __SYNCTEST_H -/** - * @file synctest.H - * - * @brief Test cases for the sycronization -*/ - -#include <cxxtest/TestSuite.H> -#include <sys/sync.h> -#include <sys/task.h> - -class SyncTest: public CxxTest::TestSuite -{ - public: - - - void testMutex() - { - mutex_init(&mutex); - barrier_init(&barrier, 7); - - task_create(func1, this); - task_create(func2, this); - task_create(func2, this); - task_create(func2, this); - task_create(func2, this); - task_create(func2, this); - barrier_wait(&barrier); - TS_TRACE("ALL THREADS ENDED"); - } - - void testBarrier() - { - barrier_t barrier; - barrier_init(&barrier,3); - task_create(func3,&barrier); - task_create(func4,&barrier); - barrier_wait(&barrier); - TS_TRACE("B0"); - barrier_destroy(&barrier); - } - - private: - - mutex_t mutex; - barrier_t barrier; - - static void func1(void * i_p) - { - SyncTest * my = (SyncTest *) i_p; - mutex_t * mutex = &(my->mutex); - barrier_t * barrier = &(my->barrier); - - mutex_lock(mutex); - for(int i = 0; i < 100000; ++i); - TS_TRACE("ME FIRST"); - mutex_unlock(mutex); - barrier_wait(barrier); - task_end(); - } - - static void func2(void * i_p) - { - SyncTest * my = (SyncTest *) i_p; - mutex_t * mutex = &(my->mutex); - barrier_t * barrier = &(my->barrier); - - mutex_lock(mutex); - TS_TRACE("ME NEXT"); - mutex_unlock(mutex); - barrier_wait(barrier); - task_end(); - } - - static void func3(void * i_p) - { - barrier_t * barrier = (barrier_t *) i_p; - barrier_wait(barrier); - TS_TRACE("B1"); - task_end(); - } - static void func4(void * i_p) - { - barrier_t * barrier = (barrier_t *) i_p; - barrier_wait(barrier); - TS_TRACE("B2"); - task_end(); - } - -}; -#endif - |

