Changes in / [270fdcf:d16cf16]
- Location:
- src/tests
- Files:
-
- 1 deleted
- 11 edited
-
.gitignore (modified) (1 diff)
-
concurrent/coroutineYield.c (modified) (3 diffs)
-
concurrent/signal/disjoint.c (modified) (1 diff)
-
concurrent/signal/wait.c (modified) (1 diff)
-
long_tests.h (modified) (1 diff)
-
preempt_longrun/Makefile.am (modified) (2 diffs)
-
preempt_longrun/Makefile.in (modified) (2 diffs)
-
preempt_longrun/enter.c (modified) (1 diff)
-
preempt_longrun/enter3.c (modified) (1 diff)
-
preempt_longrun/stack.c (modified) (2 diffs)
-
preempt_longrun/update-type (deleted)
-
preempt_longrun/yield.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.gitignore
r270fdcf rd16cf16 1 1 .out/ 2 2 .err/ 3 .type -
src/tests/concurrent/coroutineYield.c
r270fdcf rd16cf16 5 5 #include <time> 6 6 7 #define __kick_rate 150000ul8 7 #include "long_tests.h" 9 8 … … 26 25 void main(Coroutine& this) { 27 26 while(true) { 28 #if !defined(TEST_FOREVER) 29 sout | "Coroutine 1" | endl; 30 #endif 27 sout | "Coroutine 1" | endl; 31 28 yield(); 32 #if !defined(TEST_FOREVER) 33 sout | "Coroutine 2" | endl; 34 #endif 29 sout | "Coroutine 2" | endl; 35 30 suspend(); 36 31 } … … 41 36 Coroutine c; 42 37 for(int i = 0; TEST(i < N); i++) { 43 #if !defined(TEST_FOREVER) 44 sout | "Thread 1" | endl; 45 #endif 38 sout | "Thread 1" | endl; 46 39 resume(c); 47 #if !defined(TEST_FOREVER) 48 sout | "Thread 2" | endl; 49 #endif 40 sout | "Thread 2" | endl; 50 41 yield(); 51 42 KICK_WATCHDOG; -
src/tests/concurrent/signal/disjoint.c
r270fdcf rd16cf16 69 69 } 70 70 71 #if !defined(TEST_FOREVER) 72 d.counter++; 73 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 74 #endif 71 d.counter++; 72 73 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 75 74 76 75 return TEST(d.counter < N); -
src/tests/concurrent/signal/wait.c
r270fdcf rd16cf16 12 12 #include <time> 13 13 14 #define __kick_rate 12000ul15 14 #include "long_tests.h" 16 15 -
src/tests/long_tests.h
r270fdcf rd16cf16 4 4 5 5 #if defined(TEST_FOREVER) 6 7 static unsigned long long __kick_count = 0;8 #if !defined(__kick_rate)9 #define __kick_rate 5000ul10 #endif11 12 6 #define TEST(x) 1 13 #define KICK_WATCHDOG do { __kick_count++; if(__kick_count > __kick_rate) { write(STDOUT_FILENO, ".", 1); __kick_count = 0; } } while(0) 14 15 16 #else 17 7 #define KICK_WATCHDOG write(STDOUT_FILENO, ".", 1) 8 #elif defined(TEST_LONG) 18 9 #define TEST(x) x 19 10 #define KICK_WATCHDOG 20 11 #else 12 #define TEST(x) x 13 #define KICK_WATCHDOG 21 14 #endif -
src/tests/preempt_longrun/Makefile.am
r270fdcf rd16cf16 25 25 TIME = /usr/bin/time -f "%E" 26 26 27 # $(shell ./update-type $(type)) 28 # ./update-type $(type) 29 30 UPDATED_TYPE = $(shell ./update-type $(type)) 31 32 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell cat .type | tr a-z A-Z) 27 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell echo $(type) | tr a-z A-Z) 33 28 CFLAGS = ${BUILD_FLAGS} 34 29 CC = @CFA_BINDIR@/@CFA_NAME@ … … 50 45 51 46 clean-local: 52 rm -f ${TESTS} core* out.log .type47 rm -f ${TESTS} core* out.log 53 48 54 % : %.c ${CC} ${UPDATED_TYPE}49 % : %.c ${CC} 55 50 ${AM_V_GEN}${CC} ${CFLAGS} ${<} $(debug) -o ${@} 56 51 -
src/tests/preempt_longrun/Makefile.in
r270fdcf rd16cf16 456 456 WATCHDOG = ${abs_top_srcdir}/tools/watchdog 457 457 TIME = /usr/bin/time -f "%E" 458 459 # $(shell ./update-type $(type)) 460 # ./update-type $(type) 461 UPDATED_TYPE = $(shell ./update-type $(type)) 462 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell cat .type | tr a-z A-Z) 458 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell echo $(type) | tr a-z A-Z) 463 459 TESTS = block coroutine create disjoint enter enter3 processor stack wait yield 464 460 all: all-am … … 893 889 894 890 clean-local: 895 rm -f ${TESTS} core* out.log .type896 897 % : %.c ${CC} ${UPDATED_TYPE}891 rm -f ${TESTS} core* out.log 892 893 % : %.c ${CC} 898 894 ${AM_V_GEN}${CC} ${CFLAGS} ${<} $(debug) -o ${@} 899 895 -
src/tests/preempt_longrun/enter.c
r270fdcf rd16cf16 4 4 #include <time> 5 5 6 #define __kick_rate 75000ul7 6 #include "long_tests.h" 8 7 -
src/tests/preempt_longrun/enter3.c
r270fdcf rd16cf16 4 4 #include <time> 5 5 6 #define __kick_rate 75000ul7 6 #include "long_tests.h" 8 7 -
src/tests/preempt_longrun/stack.c
r270fdcf rd16cf16 4 4 #include <time> 5 5 6 #define __kick_rate 5000000ul7 6 #include "long_tests.h" 8 7 … … 18 17 19 18 void main(worker_t & this) { 20 while(TEST(0)) { 21 volatile long long p = 5_021_609ul; 22 volatile long long a = 326_417ul; 23 volatile long long n = 1l; 24 for (volatile long long i = 0; i < p; i++) { 25 n *= a; 26 n %= p; 27 KICK_WATCHDOG; 28 } 19 volatile long long p = 5_021_609ul; 20 volatile long long a = 326_417ul; 21 volatile long long n = 1l; 22 for (volatile long long i = 0; TEST(i < p); i++) { 23 n *= a; 24 n %= p; 25 KICK_WATCHDOG; 26 } 29 27 30 if( !TEST(n == a) ) { 31 abort(); 32 } 28 if( !TEST(n == a) ) { 29 abort(); 33 30 } 34 31 } -
src/tests/preempt_longrun/yield.c
r270fdcf rd16cf16 3 3 #include <time> 4 4 5 #define __kick_rate 550000ul6 5 #include "long_tests.h" 7 6
Note:
See TracChangeset
for help on using the changeset viewer.