Changeset f3c1737


Ignore:
Timestamp:
Jul 6, 2017, 4:19:42 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
3873b5a1
Parents:
955d27e9
Message:

Update longrun test to have consistent times and added missing tests

Location:
src/tests
Files:
9 edited

Legend:

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

    r955d27e9 rf3c1737  
    1010## Author           : Thierry Delisle
    1111## Created On       : Fri Jun 16 10:57:34 2017
    12 ## Last Modified By : 
    13 ## Last Modified On : 
     12## Last Modified By :
     13## Last Modified On :
    1414## Update Count     : 0
    1515###############################################################################
     
    1717repeats=10
    1818max_time=30
    19 preempt=10_000ul
     19preempt=1_000ul
    2020
    2121REPEAT = ${abs_top_srcdir}/tools/repeat -s
     
    2525CC = @CFA_BINDIR@/@CFA_NAME@
    2626
    27 TESTS = barge block create disjoint processor stack wait yield
     27TESTS = barge block create disjoint enter enter3 processor stack wait yield
    2828
    2929.INTERMEDIATE: ${TESTS}
  • src/tests/preempt_longrun/Makefile.in

    r955d27e9 rf3c1737  
    450450repeats = 10
    451451max_time = 30
    452 preempt = 10_000ul
     452preempt = 1_000ul
    453453REPEAT = ${abs_top_srcdir}/tools/repeat -s
    454454BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -debug -O2 -DPREEMPTION_RATE=${preempt}
    455 TESTS = barge block create disjoint processor stack wait yield
     455TESTS = barge block create disjoint enter enter3 processor stack wait yield
    456456all: all-am
    457457
     
    663663        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
    664664        "$$tst" $(AM_TESTS_FD_REDIRECT)
     665enter.log: enter
     666        @p='enter'; \
     667        b='enter'; \
     668        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
     669        --log-file $$b.log --trs-file $$b.trs \
     670        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
     671        "$$tst" $(AM_TESTS_FD_REDIRECT)
     672enter3.log: enter3
     673        @p='enter3'; \
     674        b='enter3'; \
     675        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
     676        --log-file $$b.log --trs-file $$b.trs \
     677        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
     678        "$$tst" $(AM_TESTS_FD_REDIRECT)
    665679processor.log: processor
    666680        @p='processor'; \
  • src/tests/preempt_longrun/create.c

    r955d27e9 rf3c1737  
    1515
    1616int main(int argc, char* argv[]) {
    17         for(int i = 0; i < 100_000ul; i++) {
     17        for(int i = 0; i < 250_000ul; i++) {
    1818                Worker w;
    1919        }
  • src/tests/preempt_longrun/enter.c

    r955d27e9 rf3c1737  
    44
    55#undef N
    6 static const unsigned long N  = 50_000ul;
     6static const unsigned long N  = 70_000ul;
    77
    88#ifndef PREEMPTION_RATE
  • src/tests/preempt_longrun/processor.c

    r955d27e9 rf3c1737  
    1515
    1616int main(int argc, char* argv[]) {
    17         for(int i = 0; i < 100_000ul; i++) {
     17        for(int i = 0; i < 10_000ul; i++) {
    1818                processor p;
    1919        }
  • src/tests/preempt_longrun/yield.c

    r955d27e9 rf3c1737  
    1313
    1414void main(Worker * this) {
    15         for(int i = 0; i < 100_000ul; i++) {
     15        for(int i = 0; i < 325_000ul; i++) {
    1616                yield();
    1717        }
  • src/tests/sched-int-block.c

    r955d27e9 rf3c1737  
    66
    77#ifndef N
    8 #define N 100_000
     8#define N 10_000
    99#endif
    1010
  • src/tests/sched-int-wait.c

    r955d27e9 rf3c1737  
    5050                unsigned action = (unsigned)rand48() % 4;
    5151                switch( action ) {
    52                         case 0: 
     52                        case 0:
    5353                                signal( &condABC, &globalA, &globalB, &globalC );
    5454                                break;
    55                         case 1: 
     55                        case 1:
    5656                                signal( &condAB , &globalA, &globalB );
    5757                                break;
    58                         case 2: 
     58                        case 2:
    5959                                signal( &condBC , &globalB, &globalC );
    6060                                break;
    61                         case 3: 
     61                        case 3:
    6262                                signal( &condAC , &globalA, &globalC );
    6363                                break;
     
    6767                }
    6868                yield();
    69         }       
     69        }
    7070}
    7171
  • src/tests/thread.c

    r955d27e9 rf3c1737  
    44#include <thread>
    55
    6 // thread First;
    7 // void main(First* this);
     6thread First  { semaphore* lock; };
     7thread Second { semaphore* lock; };
    88
    9 // thread Second;
    10 // void main(Second* this);
    11 
    12 thread First  { signal_once* lock; };
    13 thread Second { signal_once* lock; };
    14 
    15 void ?{}( First * this, signal_once* lock ) { this->lock = lock; }
    16 void ?{}( Second * this, signal_once* lock ) { this->lock = lock; }
     9void ?{}( First * this, semaphore* lock ) { this->lock = lock; }
     10void ?{}( Second * this, semaphore* lock ) { this->lock = lock; }
    1711
    1812void main(First* this) {
     
    2115                yield();
    2216        }
    23         signal(this->lock);
     17        V(this->lock);
    2418}
    2519
    2620void main(Second* this) {
    27         wait(this->lock);
     21        P(this->lock);
    2822        for(int i = 0; i < 10; i++) {
    2923                sout | "Second : Suspend No." | i + 1 | endl;
     
    3428
    3529int main(int argc, char* argv[]) {
    36         signal_once lock;
     30        semaphore lock = { 0 };
    3731        sout | "User main begin" | endl;
    3832        {
Note: See TracChangeset for help on using the changeset viewer.