Ignore:
Timestamp:
Jun 11, 2018, 10:16:04 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
3fc59bdb
Parents:
85b1deb
Message:

Added the option to make longrun tests run until failure

Location:
src/tests/preempt_longrun
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/tests/preempt_longrun/Makefile.am

    r85b1deb r7bdcac1  
    1919preempt=10ul\`ms
    2020debug=-debug
     21type=LONG
    2122
    2223REPEAT = ${abs_top_srcdir}/tools/repeat
     24WATCHDOG = ${abs_top_srcdir}/tools/watchdog
    2325TIME = /usr/bin/time -f "%E"
    2426
    25 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -DLONG_TEST
     27BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell echo $(type) | tr a-z A-Z)
    2628CFLAGS = ${BUILD_FLAGS}
    2729CC = @CFA_BINDIR@/@CFA_NAME@
     
    2931TESTS = block coroutine create disjoint enter enter3 processor stack wait yield
    3032
    31 .INTERMEDIATE: ${TESTS}
     33# .INTERMEDIATE: ${TESTS}
    3234
    3335all-local: ${TESTS:=.run}
     36
     37runall : ${TESTS:=.run}
     38        @ echo "All programs terminated normally"
     39
     40watchall : ${TESTS:=.watch}
     41        @ echo "All programs terminated normally"
     42
     43compileall : ${TESTS}
     44        @ echo "Compiled"
    3445
    3546clean-local:
     
    4455        @ echo -e "${<}: SUCCESS\n"
    4556
     57%.watch : % ${WATCHDOG}
     58        @ time ${WATCHDOG} ./${<}
     59        @ rm ${<}
     60        @ echo -e "${<}: SUCCESS\n"
     61
    4662%.time : % ${REPEAT}
    4763        @ ${REPEAT} -i -s -- $(repeats) $(TIME) -a -o times.log ./${<}
     
    4965        @ echo -e "${<}: SUCCESS\n"
    5066
    51 ${REPEAT}:
     67${REPEAT}: ${abs_top_srcdir}/tools/Makefile
    5268        @+make -C ${abs_top_srcdir}/tools/
     69
     70${WATCHDOG}: ${abs_top_srcdir}/tools/Makefile
     71        @+make -C ${abs_top_srcdir}/tools/
  • src/tests/preempt_longrun/Makefile.in

    r85b1deb r7bdcac1  
    452452preempt = 10ul\`ms
    453453debug = -debug
     454type = LONG
    454455REPEAT = ${abs_top_srcdir}/tools/repeat
     456WATCHDOG = ${abs_top_srcdir}/tools/watchdog
    455457TIME = /usr/bin/time -f "%E"
    456 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -DLONG_TEST
     458BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell echo $(type) | tr a-z A-Z)
    457459TESTS = block coroutine create disjoint enter enter3 processor stack wait yield
    458460all: all-am
     
    873875
    874876
    875 .INTERMEDIATE: ${TESTS}
     877# .INTERMEDIATE: ${TESTS}
    876878
    877879all-local: ${TESTS:=.run}
     880
     881runall : ${TESTS:=.run}
     882        @ echo "All programs terminated normally"
     883
     884watchall : ${TESTS:=.watch}
     885        @ echo "All programs terminated normally"
     886
     887compileall : ${TESTS}
     888        @ echo "Compiled"
    878889
    879890clean-local:
     
    888899        @ echo -e "${<}: SUCCESS\n"
    889900
     901%.watch : % ${WATCHDOG}
     902        @ time ${WATCHDOG} ./${<}
     903        @ rm ${<}
     904        @ echo -e "${<}: SUCCESS\n"
     905
    890906%.time : % ${REPEAT}
    891907        @ ${REPEAT} -i -s -- $(repeats) $(TIME) -a -o times.log ./${<}
     
    893909        @ echo -e "${<}: SUCCESS\n"
    894910
    895 ${REPEAT}:
     911${REPEAT}: ${abs_top_srcdir}/tools/Makefile
     912        @+make -C ${abs_top_srcdir}/tools/
     913
     914${WATCHDOG}: ${abs_top_srcdir}/tools/Makefile
    896915        @+make -C ${abs_top_srcdir}/tools/
    897916
  • src/tests/preempt_longrun/create.c

    r85b1deb r7bdcac1  
    22#include <thread>
    33#include <time>
     4
     5#include "long_tests.h"
    46
    57#ifndef PREEMPTION_RATE
     
    1921int main(int argc, char* argv[]) {
    2022        processor p;
    21         for(int i = 0; i < N; i++) {
     23        for(int i = 0; TEST(i < N); i++) {
    2224                worker_t w[7];
     25                KICK_WATCHDOG;
    2326        }
    2427}
  • src/tests/preempt_longrun/enter.c

    r85b1deb r7bdcac1  
    33#include <thread>
    44#include <time>
     5
     6#include "long_tests.h"
    57
    68#ifndef PREEMPTION_RATE
     
    1517
    1618monitor mon_t {};
    17 void foo( mon_t & mutex this ) {}
     19void foo( mon_t & mutex this ) {
     20        KICK_WATCHDOG;
     21}
    1822
    1923mon_t mon;
    2024thread worker_t {};
    2125void main( worker_t & this ) {
    22         for( unsigned long i = 0; i < N; i++ ) {
     26        for( unsigned long i = 0; TEST(i < N); i++ ) {
    2327                foo( mon );
    2428        }
  • src/tests/preempt_longrun/enter3.c

    r85b1deb r7bdcac1  
    33#include <thread>
    44#include <time>
     5
     6#include "long_tests.h"
    57
    68#ifndef PREEMPTION_RATE
     
    1820mon_t mon1, mon2, mon3;
    1921
    20 void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {}
     22void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {
     23        KICK_WATCHDOG;
     24}
    2125
    2226thread worker_t {};
    2327
    2428void main( worker_t & this ) {
    25         for( unsigned long i = 0; i < N; i++ ) {
     29        for( unsigned long i = 0; TEST(i < N); i++ ) {
    2630                foo( mon1, mon2, mon3 );
    2731        }
  • src/tests/preempt_longrun/processor.c

    r85b1deb r7bdcac1  
    44
    55#include <unistd.h>
     6
     7#include "long_tests.h"
    68
    79#ifndef PREEMPTION_RATE
     
    1719int main(int argc, char* argv[]) {
    1820        processor * p[15];
    19         write(STDOUT_FILENO, "Preparing\n", sizeof("Preparing\n"));
    2021        for ( int pi = 0; pi < 15; pi++ ) {
    2122                p[pi] = new();
    2223        }
    23         write(STDOUT_FILENO, "Starting\n", sizeof("Starting\n"));
    24         for ( int i = 0; i < N; i++) {
     24        for ( int i = 0; TEST(i < N); i++) {
    2525                int pi = i % 15;
    2626                delete( p[pi] );
    2727                p[pi] = new();
     28                KICK_WATCHDOG;
    2829        }
    29         write(STDOUT_FILENO, "Stopping\n", sizeof("Stopping\n"));
    3030        for ( int pi = 0; pi < 15; pi++ ) {
    3131                delete( p[pi] );
    3232        }
    33         write(STDOUT_FILENO, "Done\n", sizeof("Done\n"));
    3433}
  • src/tests/preempt_longrun/stack.c

    r85b1deb r7bdcac1  
    33#include <thread>
    44#include <time>
     5
     6#include "long_tests.h"
    57
    68#ifndef PREEMPTION_RATE
     
    1820        volatile long long a = 326_417ul;
    1921        volatile long long n = 1l;
    20         for (volatile long long i = 0; i < p; i++) {
     22        for (volatile long long i = 0; TEST(i < p); i++) {
    2123                n *= a;
    2224                n %= p;
     25                KICK_WATCHDOG;
    2326        }
    2427
    25         if( n != a ) {
     28        if( !TEST(n == a) ) {
    2629                abort();
    2730        }
  • src/tests/preempt_longrun/yield.c

    r85b1deb r7bdcac1  
    22#include <thread>
    33#include <time>
     4
     5#include "long_tests.h"
    46
    57#ifndef PREEMPTION_RATE
     
    1113}
    1214
    13 #ifdef LONG_TEST
     15#ifdef TEST_LONG
    1416static const unsigned long N = 9_750_000ul;
    1517#else
     
    2022
    2123void main(worker_t & this) {
    22         for(int i = 0; i < N; i++) {
     24        for(int i = 0; TEST(i < N); i++) {
    2325                yield();
     26                KICK_WATCHDOG;
    2427        }
    2528}
Note: See TracChangeset for help on using the changeset viewer.