Changes in / [d16cf16:270fdcf]


Ignore:
Location:
src/tests
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.gitignore

    rd16cf16 r270fdcf  
    11.out/
    22.err/
     3.type
  • src/tests/concurrent/coroutineYield.c

    rd16cf16 r270fdcf  
    55#include <time>
    66
     7#define __kick_rate 150000ul
    78#include "long_tests.h"
    89
     
    2526void main(Coroutine& this) {
    2627        while(true) {
    27                 sout | "Coroutine 1" | endl;
     28                #if !defined(TEST_FOREVER)
     29                        sout | "Coroutine 1" | endl;
     30                #endif
    2831                yield();
    29                 sout | "Coroutine 2" | endl;
     32                #if !defined(TEST_FOREVER)
     33                        sout | "Coroutine 2" | endl;
     34                #endif
    3035                suspend();
    3136        }
     
    3641        Coroutine c;
    3742        for(int i = 0; TEST(i < N); i++) {
    38                 sout | "Thread 1" | endl;
     43                #if !defined(TEST_FOREVER)
     44                        sout | "Thread 1" | endl;
     45                #endif
    3946                resume(c);
    40                 sout | "Thread 2" | endl;
     47                #if !defined(TEST_FOREVER)
     48                        sout | "Thread 2" | endl;
     49                #endif
    4150                yield();
    4251                KICK_WATCHDOG;
  • src/tests/concurrent/signal/disjoint.c

    rd16cf16 r270fdcf  
    6969        }
    7070
    71         d.counter++;
    72 
    73         if( (d.counter % 1000) == 0 ) sout | d.counter | endl;
     71        #if !defined(TEST_FOREVER)
     72                d.counter++;
     73                if( (d.counter % 1000) == 0 ) sout | d.counter | endl;
     74        #endif
    7475
    7576        return TEST(d.counter < N);
  • src/tests/concurrent/signal/wait.c

    rd16cf16 r270fdcf  
    1212#include <time>
    1313
     14#define __kick_rate 12000ul
    1415#include "long_tests.h"
    1516
  • src/tests/long_tests.h

    rd16cf16 r270fdcf  
    44
    55#if   defined(TEST_FOREVER)
     6
     7static unsigned long long __kick_count = 0;
     8#if !defined(__kick_rate)
     9#define __kick_rate 5000ul
     10#endif
     11
    612#define TEST(x) 1
    7 #define KICK_WATCHDOG write(STDOUT_FILENO, ".", 1)
    8 #elif defined(TEST_LONG)
     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
    918#define TEST(x) x
    1019#define KICK_WATCHDOG
    11 #else
    12 #define TEST(x) x
    13 #define KICK_WATCHDOG
     20
    1421#endif
  • src/tests/preempt_longrun/Makefile.am

    rd16cf16 r270fdcf  
    2525TIME = /usr/bin/time -f "%E"
    2626
    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)
     27# $(shell ./update-type $(type))
     28# ./update-type $(type)
     29
     30UPDATED_TYPE = $(shell ./update-type $(type))
     31
     32BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell cat .type | tr a-z A-Z)
    2833CFLAGS = ${BUILD_FLAGS}
    2934CC = @CFA_BINDIR@/@CFA_NAME@
     
    4550
    4651clean-local:
    47         rm -f ${TESTS} core* out.log
     52        rm -f ${TESTS} core* out.log .type
    4853
    49 % : %.c ${CC}
     54% : %.c ${CC} ${UPDATED_TYPE}
    5055        ${AM_V_GEN}${CC} ${CFLAGS} ${<} $(debug) -o ${@}
    5156
  • src/tests/preempt_longrun/Makefile.in

    rd16cf16 r270fdcf  
    456456WATCHDOG = ${abs_top_srcdir}/tools/watchdog
    457457TIME = /usr/bin/time -f "%E"
    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)
     458
     459# $(shell ./update-type $(type))
     460# ./update-type $(type)
     461UPDATED_TYPE = $(shell ./update-type $(type))
     462BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell cat .type | tr a-z A-Z)
    459463TESTS = block coroutine create disjoint enter enter3 processor stack wait yield
    460464all: all-am
     
    889893
    890894clean-local:
    891         rm -f ${TESTS} core* out.log
    892 
    893 % : %.c ${CC}
     895        rm -f ${TESTS} core* out.log .type
     896
     897% : %.c ${CC} ${UPDATED_TYPE}
    894898        ${AM_V_GEN}${CC} ${CFLAGS} ${<} $(debug) -o ${@}
    895899
  • src/tests/preempt_longrun/enter.c

    rd16cf16 r270fdcf  
    44#include <time>
    55
     6#define __kick_rate 75000ul
    67#include "long_tests.h"
    78
  • src/tests/preempt_longrun/enter3.c

    rd16cf16 r270fdcf  
    44#include <time>
    55
     6#define __kick_rate 75000ul
    67#include "long_tests.h"
    78
  • src/tests/preempt_longrun/stack.c

    rd16cf16 r270fdcf  
    44#include <time>
    55
     6#define __kick_rate 5000000ul
    67#include "long_tests.h"
    78
     
    1718
    1819void main(worker_t & this) {
    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         }
     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                }
    2729
    28         if( !TEST(n == a) ) {
    29                 abort();
     30                if( !TEST(n == a) ) {
     31                        abort();
     32                }
    3033        }
    3134}
  • src/tests/preempt_longrun/yield.c

    rd16cf16 r270fdcf  
    33#include <time>
    44
     5#define __kick_rate 550000ul
    56#include "long_tests.h"
    67
Note: See TracChangeset for help on using the changeset viewer.