Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Activate a lot more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Jan 4, 2018
1 parent 5dabf18 commit 829f6d6
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 109 deletions.
72 changes: 35 additions & 37 deletions pthread/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ MISC_TEST_OBJS = \
# Depends on unimplemented newlib functions
# stress1.o \
#SEM_TEST_OBJS = \
# semaphore1.o \
# semaphore2.o \
# semaphore3.o \
# semaphore4.o \
# semaphore4t.o \
# semaphore5.o \
# semaphore6.o
SEM_TEST_OBJS = \
semaphore1.o \
semaphore2.o \
semaphore3.o \
semaphore4.o \
semaphore4t.o \
semaphore5.o \
semaphore6.o

BARRIER_TEST_OBJS = \
barrier1.o \
Expand Down Expand Up @@ -116,39 +116,37 @@ SPIN_TEST_OBJS = \

CONDVAR_TEST_OBJS = \
condvar1.o \
condvar2.o \
condvar2_1.o \
condvar3.o \
condvar3_1.o \
condvar3_2.o \
condvar3_3.o \
condvar4.o \
condvar5.o \
condvar6.o \
condvar7.o \
condvar8.o \
condvar9.o
# Needs NP method
# condvar1_1.o \
# condvar1_2.o \
# Needs ftime
# condvar2.o \
# condvar2_1.o \
# condvar3.o \
# condvar3_1.o \
# condvar3_2.o \
# condvar3_3.o \
# condvar4.o \
# condvar5.o \
# condvar6.o \
# condvar7.o \
# condvar8.o \
# condvar9.o
#
RWLOCK_TEST_OBJS = \
rwlock1.o \
# Needs ftime
# rwlock2.o \
# rwlock2_t.o \
# rwlock3.o \
# rwlock3_t.o \
# rwlock4.o \
# rwlock4_t.o \
# rwlock5.o \
# rwlock5_t.o \
# rwlock6.o \
# rwlock6_t.o \
# rwlock6_t2.o \
# rwlock7.o \
# rwlock8.o
rwlock2.o \
rwlock2_t.o \
rwlock3.o \
rwlock3_t.o \
rwlock4.o \
rwlock4_t.o \
rwlock5.o \
rwlock5_t.o \
rwlock6.o \
rwlock6_t.o \
rwlock6_t2.o \
rwlock7.o \
rwlock8.o

CANCEL_TEST_OBJS = \
cancel1.o \
Expand Down Expand Up @@ -179,7 +177,7 @@ OBJS = $(MUTEX_TEST_OBJS) $(MISC_OBJS) $(MISC_TEST_OBJS) $(THREAD_TEST_OBJS) $(S

all: $(PROGRAM).nro

CFLAGS += -I../ -I../sys/switch
CFLAGS += -I../ -I../sys/switch -finstrument-functions
$(PROGRAM).nro.so: ${OBJS} $(LIBTRANSITOR_NRO_LIB) $(LIBTRANSISTOR_COMMON_LIBS)
$(LD) $(LD_FLAGS) -o $@ ${OBJS} $(LIBTRANSISTOR_NRO_LDFLAGS)

Expand Down
154 changes: 82 additions & 72 deletions pthread/tests/test_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ static void runSemTests(void)
pthread_test_semaphore2();

printf("Semaphore test #3\n");
pthread_test_semaphore3();

printf("Our semaphore's getvalue returns the number of pre-signaling values");
printf("which is different from Linux returning the number of waiting threads.\n");
//pthread_test_semaphore3();

printf("Semaphore test #4\n");
pthread_test_semaphore4();
printf("Ditto, and this tests cancel behavior, which we don't implement (yet).\n");
//pthread_test_semaphore4();

printf("Semaphore test #4t\n");
pthread_test_semaphore4t();
printf("Ditto\n");
//pthread_test_semaphore4t();

printf("Semaphore test #5\n");
pthread_test_semaphore5();
Expand Down Expand Up @@ -95,11 +98,11 @@ static void runThreadTests(void)
pthread_test_exit3();

printf("Exit test #4\n");
printf("Cannot call pthread_exit() on a thread not created through pthread_create()");
printf("Cannot call pthread_exit() on a thread not created through pthread_create()\n");
//pthread_test_exit4();

printf("Exit test #5\n");
printf("Cannot call pthread_exit() on a thread not created through pthread_create()");
printf("Cannot call pthread_exit() on a thread not created through pthread_create()\n");
//pthread_test_exit5();

/* These tests can not be run in series with other tests,
Expand Down Expand Up @@ -213,13 +216,15 @@ static void runMutexTests(void)
pthread_test_mutex3r();

printf("Mutex test #4\n");
pthread_test_mutex4();
printf("Depends on undefined behavior. OpenBSD's undef is to abort, causing test to fail.\n");
//pthread_test_mutex4();

printf("Mutex test #5\n");
pthread_test_mutex5();

printf("Mutex test #6\n");
pthread_test_mutex6();
printf("Depends on undefined behavior (unlocking from another thread). OpenBSD's undef is to abort, causing test to fail.\n");
//pthread_test_mutex6();

printf("Mutex test #6e\n");
pthread_test_mutex6e();
Expand All @@ -228,7 +233,8 @@ static void runMutexTests(void)
pthread_test_mutex6es();

printf("Mutex test #6n\n");
pthread_test_mutex6n();
printf("Depends on undefined behavior (unlocking from another thread). OpenBSD's undef is to abort, causing test to fail.\n");
//pthread_test_mutex6n();

printf("Mutex test #6r\n");
pthread_test_mutex6r();
Expand All @@ -237,10 +243,12 @@ static void runMutexTests(void)
pthread_test_mutex6rs();

printf("Mutex test #6s\n");
pthread_test_mutex6s();
printf("Depends on undefined behavior (unlocking from another thread). OpenBSD's undef is to abort, causing test to fail.\n");
//pthread_test_mutex6s();

printf("Mutex test #7\n");
pthread_test_mutex7();
printf("Depends on undefined behavior (unlocking an unlocked mutex). OpenBSD's undef is to abort, causing test to fail.\n");
//pthread_test_mutex7();

printf("Mutex test #7e\n");
pthread_test_mutex7e();
Expand Down Expand Up @@ -287,47 +295,49 @@ static void runCondvarTests()
printf("Condvar test #1\n");
pthread_test_condvar1();

//printf("Condvar test #1-1\n");
//pthread_test_condvar1_1();
/*printf("Condvar test #1-1\n");
pthread_test_condvar1_1();
//printf("Condvar test #1-2\n");
//pthread_test_condvar1_2();
printf("Condvar test #1-2\n");
pthread_test_condvar1_2();*/

//printf("Condvar test #2\n");
//pthread_test_condvar2();
printf("Condvar test #2\n");
pthread_test_condvar2();

//printf("Condvar test #2-1\n");
//pthread_test_condvar2_1();
printf("Condvar test #2-1\n");
pthread_test_condvar2_1();

//printf("Condvar test #3\n");
//pthread_test_condvar3();
printf("Condvar test #3\n");
pthread_test_condvar3();

//printf("Condvar test #3-1\n");
//pthread_test_condvar3_1();
printf("Condvar test #3-1\n");
pthread_test_condvar3_1();

//printf("Condvar test #3-2\n");
//pthread_test_condvar3_2();
printf("Condvar test #3-2\n");
pthread_test_condvar3_2();

//printf("Condvar test #3-3\n");
//pthread_test_condvar3_3();
printf("Condvar test #3-3\n");
pthread_test_condvar3_3();

//printf("Condvar test #4\n");
//pthread_test_condvar4();
printf("Condvar test #4\n");
pthread_test_condvar4();

//printf("Condvar test #5\n");
//pthread_test_condvar5();
printf("Condvar test #5\n");
pthread_test_condvar5();

//printf("Condvar test #6\n");
printf("Condvar test #6\n");
printf("Test is unsound. It relies on timing. Needs to be rewritten.\n");
// TODO: Rewrite this to be sound
//pthread_test_condvar6();

//printf("Condvar test #7\n");
//pthread_test_condvar7();
printf("Condvar test #7\n");
pthread_test_condvar7();

//printf("Condvar test #8\n");
//pthread_test_condvar8();
printf("Condvar test #8\n");
pthread_test_condvar8();

//printf("Condvar test #9\n");
//pthread_test_condvar9();
printf("Condvar test #9\n");
pthread_test_condvar9();

}

Expand All @@ -342,44 +352,44 @@ static void runRwlockTests()
printf("Rwlock test #1\n");
pthread_test_rwlock1();

//printf("Rwlock test #2\n");
//pthread_test_rwlock2();
printf("Rwlock test #2\n");
pthread_test_rwlock2();

//printf("Rwlock test #2t\n");
//pthread_test_rwlock2t();
printf("Rwlock test #2t\n");
pthread_test_rwlock2t();

//printf("Rwlock test #3\n");
//pthread_test_rwlock3();
printf("Rwlock test #3\n");
pthread_test_rwlock3();

//printf("Rwlock test #3t\n");
//pthread_test_rwlock3t();
printf("Rwlock test #3t\n");
pthread_test_rwlock3t();

//printf("Rwlock test #4\n");
//pthread_test_rwlock4();
printf("Rwlock test #4\n");
pthread_test_rwlock4();

//printf("Rwlock test #4t\n");
//pthread_test_rwlock4t();
printf("Rwlock test #4t\n");
pthread_test_rwlock4t();

//printf("Rwlock test #5\n");
//pthread_test_rwlock5();
printf("Rwlock test #5\n");
pthread_test_rwlock5();

//printf("Rwlock test #5t\n");
//pthread_test_rwlock5t();
printf("Rwlock test #5t\n");
pthread_test_rwlock5t();

//printf("Rwlock test #6\n");
//pthread_test_rwlock6();
printf("Rwlock test #6\n");
pthread_test_rwlock6();

//printf("Rwlock test #6t\n");
//pthread_test_rwlock6t();
printf("Rwlock test #6t\n");
pthread_test_rwlock6t();

//printf("Rwlock test #6t2\n");
//pthread_test_rwlock6t2();
printf("Rwlock test #6t2\n");
pthread_test_rwlock6t2();

//printf("Rwlock test #7\n");
//pthread_test_rwlock7();
printf("Rwlock test #7\n");
pthread_test_rwlock7();

//printf("Rwlock test #8\n");
//pthread_test_rwlock8();
printf("Rwlock test #8\n");
pthread_test_rwlock8();

}

Expand Down Expand Up @@ -472,14 +482,14 @@ void pte_test_main()
printf(" Test iteration #%d\n\n",i);
printf("=========================\n");

runThreadTests();
runMiscTests();
//runMutexTests();
//runSemTests();
//runCondvarTests();
//runBarrierTests();
//runSpinTests();
//runRwlockTests();
///runThreadTests();
///runMiscTests();
///runMutexTests();
///runSemTests();
runCondvarTests();
runBarrierTests();
runSpinTests();
runRwlockTests();
//runCancelTests();
//runExceptionTests();
//runBenchTests();
Expand Down

0 comments on commit 829f6d6

Please sign in to comment.